Merge "Add support and test for P210 format" into main
diff --git a/Android.bp b/Android.bp
index 68115aa..baf3291 100644
--- a/Android.bp
+++ b/Android.bp
@@ -86,9 +86,3 @@
"VtsHalHidlTargetTestBase",
],
}
-
-dirgroup {
- name: "trusty_dirgroup_hardware_interfaces",
- dirs: ["."],
- visibility: ["//trusty/vendor/google/aosp/scripts"],
-}
diff --git a/METADATA b/METADATA
deleted file mode 100644
index d97975c..0000000
--- a/METADATA
+++ /dev/null
@@ -1,3 +0,0 @@
-third_party {
- license_type: NOTICE
-}
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 4902497..0f2fe99 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -228,6 +228,13 @@
],
}
+rust_defaults {
+ name: "latest_android_hardware_audio_core_rust",
+ rustlibs: [
+ latest_android_hardware_audio_core + "-rust",
+ ],
+}
+
// Used for the standalone sounddose HAL
aidl_interface {
name: "android.hardware.audio.core.sounddose",
@@ -303,6 +310,7 @@
"android.hardware.audio_defaults",
"latest_android_hardware_audio_common_import_interface",
"latest_android_media_audio_common_types_import_interface",
+ "latest_android_media_audio_eraser_types_import_interface",
],
srcs: [
"android/hardware/audio/effect/AcousticEchoCanceler.aidl",
@@ -317,6 +325,7 @@
"android/hardware/audio/effect/DynamicsProcessing.aidl",
"android/hardware/audio/effect/EnvironmentalReverb.aidl",
"android/hardware/audio/effect/Equalizer.aidl",
+ "android/hardware/audio/effect/Eraser.aidl",
"android/hardware/audio/effect/Flags.aidl",
"android/hardware/audio/effect/HapticGenerator.aidl",
"android/hardware/audio/effect/IEffect.aidl",
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
index 115da1d..36f22ae 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
@@ -44,6 +44,7 @@
const String EFFECT_TYPE_UUID_DYNAMICS_PROCESSING = "7261676f-6d75-7369-6364-28e2fd3ac39e";
const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e";
const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_ERASER = "fa81a9ac-588b-11ed-9b6a-0242ac120002";
const String EFFECT_TYPE_UUID_HAPTIC_GENERATOR = "1411e6d6-aecd-4021-a1cf-a6aceb0d71e5";
const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1";
const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b";
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Eraser.aidl
similarity index 78%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
copy to audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Eraser.aidl
index d88d5c8..5d8abd5 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Eraser.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,12 +31,15 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.security.see.hwcrypto;
-parcelable MemoryBufferParameter {
- android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
- int sizeBytes;
- union MemoryBuffer {
- ParcelFileDescriptor input;
- ParcelFileDescriptor output;
+package android.hardware.audio.effect;
+@VintfStability
+union Eraser {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.media.audio.eraser.Capability capability;
+ android.media.audio.eraser.Configuration configuration;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Eraser.Tag commonTag;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
index ff33c42..40a49de 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Parameter.aidl
@@ -63,6 +63,7 @@
android.hardware.audio.effect.Volume.Id volumeTag;
android.hardware.audio.effect.Parameter.Tag commonTag;
android.hardware.audio.effect.Spatializer.Id spatializerTag;
+ android.hardware.audio.effect.Eraser.Id eraserTag;
}
@VintfStability
parcelable Common {
@@ -95,5 +96,6 @@
android.hardware.audio.effect.Visualizer visualizer;
android.hardware.audio.effect.Volume volume;
android.hardware.audio.effect.Spatializer spatializer;
+ android.hardware.audio.effect.Eraser eraser;
}
}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/State.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/State.aidl
index 17f9814..873fb43 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/State.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/State.aidl
@@ -37,4 +37,5 @@
INIT,
IDLE,
PROCESSING,
+ DRAINING,
}
diff --git a/audio/aidl/android/hardware/audio/effect/CommandId.aidl b/audio/aidl/android/hardware/audio/effect/CommandId.aidl
index d940b42..de573bf 100644
--- a/audio/aidl/android/hardware/audio/effect/CommandId.aidl
+++ b/audio/aidl/android/hardware/audio/effect/CommandId.aidl
@@ -33,25 +33,39 @@
/**
* Start effect engine processing.
* An effect instance must start processing data and transfer to PROCESSING state if it is in
- * IDLE state and have all necessary information. Otherwise it must:
- * 1. Throw a EX_ILLEGAL_STATE exception if effect is not in IDLE state, or
- * 2. Throw a EX_TRANSACTION_FAILED for all other errors.
+ * IDLE or DRAINING state and has all necessary information. Otherwise, it must:
+ * 1. Throw an EX_ILLEGAL_STATE exception if the effect is not in IDLE or DRAINING state, or
+ * 2. Throw an EX_TRANSACTION_FAILED for all other errors.
*
- * Depending on parameters set to the effect instance, effect may do process or reverse
- * process after START command.
+ * If an effect instance in DRAINING state receives a START command, it must transit back to
+ * PROCESSING state.
*/
START = 0,
/**
- * Stop effect engine processing with all resource kept.
- * The currently processed audio data will be discarded if the effect engine is in PROCESSING
- * state.
- * Effect instance must do nothing and return ok when it receive STOP command in IDLE state.
+ * Stop effect engine processing with all resources kept.
+ * If the effect is in **PROCESSING** state:
+ * - It must transition to **IDLE** state if no intermediate operations are required.
+ * - It must transition to **DRAINING** state if draining (e.g., fading) is required.
+ * - The instance must automatically transition to **IDLE** after draining.
+ * - It must ignore any new `STOP` commands during **DRAINING**.
+ * - `START` commands during **DRAINING** must transition the instance back to
+ * **PROCESSING**.
+ * If the effect instance is already in **IDLE** state, it must do nothing and return success.
+ *
+ * If the effect instance transitions to DRAINING state:
+ * 1. It must automatically transition to IDLE after completing draining tasks.
+ * 2. It must ignore any new STOP commands received during the DRAINING state.
+ * 3. START commands during DRAINING must immediately transfer the instance back to PROCESSING.
+ *
*/
STOP = 1,
/**
* Keep all parameter settings but reset the buffer content, stop engine processing, and transit
- * instance state to IDLE if its in PROCESSING state.
+ * the instance state to IDLE if it is in PROCESSING state.
* Effect instance must be able to handle RESET command at IDLE and PROCESSING states.
+ *
+ * If the implementation includes intermediate operations such as draining, the RESET command
+ * must bypass DRAINING and immediately transition the state to IDLE.
*/
RESET = 2,
diff --git a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
index b152f76..62e9bd4 100644
--- a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
@@ -70,6 +70,10 @@
*/
const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b";
/**
+ * UUID for Audio eraser effect type.
+ */
+ const String EFFECT_TYPE_UUID_ERASER = "fa81a9ac-588b-11ed-9b6a-0242ac120002";
+ /**
* UUID for Haptic Generator type.
*/
const String EFFECT_TYPE_UUID_HAPTIC_GENERATOR = "1411e6d6-aecd-4021-a1cf-a6aceb0d71e5";
diff --git a/audio/aidl/android/hardware/audio/effect/Eraser.aidl b/audio/aidl/android/hardware/audio/effect/Eraser.aidl
new file mode 100644
index 0000000..990c6c0
--- /dev/null
+++ b/audio/aidl/android/hardware/audio/effect/Eraser.aidl
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.audio.effect;
+
+import android.hardware.audio.effect.VendorExtension;
+import android.media.audio.eraser.Capability;
+import android.media.audio.eraser.Configuration;
+import android.media.audio.eraser.Mode;
+
+/**
+ * The Audio Eraser Effect is an audio effect that combines multiple capabilities to manipulate and
+ * enhance audio streams.
+ *
+ * The Audio Eraser Effect integrates three primary components:
+ *
+ * Sound Separator: Detects and splits the input audio into multiple sound sources.
+ * Sound Classifier: Classifies each separated sound source into predefined categories based on the
+ * AudioSet ontology.
+ * Remixer: Adjusts the gain factor (volume) of each classified sound source according to specified
+ * configurations, then recombines them into a single output audio stream.
+ *
+ * The Audio Eraser Effect operates in different modes, each leveraging a subset of these
+ * components to achieve specific functionalities as defined in `android.media.audio.eraser.Mode`.
+ *
+ * Flow Diagrams for each operation mode as below.
+ *
+ * ERASER:
+ * +-----------------+
+ * +-->| Sound Classifier|---+
+ * | +-----------------+ |
+ * | |
+ *+----------------+ +----------------+ | +-----------------+ | +----------------+
+ *| Input Audio |------>| Sound Separator|---+-->| Sound Classifier|---+-->| Remixer |
+ *+----------------+ +----------------+ | +-----------------+ | +--------+-------+
+ * | | |
+ * | +-----------------+ | |
+ * +-->| Sound Classifier|---+ |
+ * +-----------------+ |
+ * | v
+ * v +----------------+
+ * {Classification Metadata} | Output Audio |
+ * +----------------+
+ *
+ * CLASSIFIER:
+ *+----------------+ +-----------------+ +-----------------+
+ *| Input Audio |------>| Sound Classifier|------>| Original Audio |
+ *+----------------+ +-----------------+ +-----------------+
+ * |
+ * v
+ * {Classification Metadata}
+ *
+ */
+@VintfStability
+union Eraser {
+ /**
+ * Parameter Id with union tag to identify the parameters for getParameter().
+ */
+ @VintfStability
+ union Id {
+ VendorExtension vendorExtensionTag;
+ Eraser.Tag commonTag;
+ }
+
+ /**
+ * Vendor extension parameters which can be customized.
+ */
+ VendorExtension vendor;
+
+ /**
+ * Eraser capability, defines supported input/output data formats, available work modes, and
+ * the specific capabilities of the sound classifier and separator
+ */
+ Capability capability;
+
+ /**
+ * Eraser configuration, contains the list of configurations for the eraser effect.
+ */
+ Configuration configuration;
+}
diff --git a/audio/aidl/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
index 6fd9161..d57e67d 100644
--- a/audio/aidl/android/hardware/audio/effect/Parameter.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Parameter.aidl
@@ -26,6 +26,7 @@
import android.hardware.audio.effect.DynamicsProcessing;
import android.hardware.audio.effect.EnvironmentalReverb;
import android.hardware.audio.effect.Equalizer;
+import android.hardware.audio.effect.Eraser;
import android.hardware.audio.effect.HapticGenerator;
import android.hardware.audio.effect.LoudnessEnhancer;
import android.hardware.audio.effect.NoiseSuppression;
@@ -111,6 +112,10 @@
* Parameter tag defined for Spatializer parameters.
*/
Spatializer.Id spatializerTag;
+ /**
+ * Parameter tag defined for eraser parameters.
+ */
+ Eraser.Id eraserTag;
}
/**
@@ -198,6 +203,8 @@
Visualizer visualizer;
Volume volume;
Spatializer spatializer;
+ // Eraser added at android.hardware.audio.effect.V3
+ Eraser eraser;
}
Specific specific;
diff --git a/audio/aidl/android/hardware/audio/effect/State.aidl b/audio/aidl/android/hardware/audio/effect/State.aidl
index 85a4afc..1b698d7 100644
--- a/audio/aidl/android/hardware/audio/effect/State.aidl
+++ b/audio/aidl/android/hardware/audio/effect/State.aidl
@@ -24,18 +24,18 @@
* it should transfer to IDLE state after handle the command successfully. Effect instance should
* consume minimal resource and transfer to INIT state after it was close().
*
- * Refer to State.gv for detailed state diagram.
+ * Refer to the state machine diagram `state.gv` for a detailed state diagram.
*/
@VintfStability
@Backing(type="byte")
enum State {
-
/**
* An effect instance is in INIT state by default after it was created with
* IFactory.createEffect(). When an effect instance is in INIT state, it should have instance
* context initialized, and ready to handle IEffect.setParameter(), IEffect.open() as well as
* all getter interfaces.
*
+ * **Requirements in INIT state:**
* In INIT state, effect instance must:
* 1. Not handle any IEffect.command() and return EX_ILLEGAL_STATE with any Command.Id.
* 2. Be able to handle all parameter setting with IEffect.setParameter().
@@ -43,28 +43,32 @@
* IEffect.getState().
* 4. Be able to handle IEffect.open() successfully after configuration.
*
- * Client is expected to do necessary configuration with IEffect.setParameter(), get all
- * resource ready with IEffect.open(), and make sure effect instance transfer to IDLE state
- * before sending commands with IEffect.command() interface. Effect instance must transfer
- * from INIT to IDLE state after handle IEffect.open() call successfully.
+ * **State Transitions:**
+ * - Transitions to **IDLE** after successful `IEffect.open()`.
+ * - Remains in **INIT** on `IEffect.getState()` and `IEffect.getDescriptor()`.
+ * - Transitions to the final state on `IFactory.destroyEffect()`.
*/
INIT,
+
/**
* An effect instance transfer to IDLE state after it was open successfully with IEffect.open()
* in INIT state, or after it was stop/reset with Command.Id.STOP/RESET in PROCESSING state.
*
- * In IDLE state, effect instance must:
+ * **Requirements in IDLE state:**
* 1. Be able to start effect processing engine with IEffect.command(Command.Id.START) call.
* 2. Be able to handle all parameter setting with IEffect.setParameter().
* 3. Be able to handle all getter interface calls like IEffect.getParameter() and
* IEffect.getState().
*
- * The following state transfer can happen in IDLE state:
- * 1. Transfer to PROCESSING if instance receive an START command and start processing data
- * successfully.
- * 2. Transfer to INIT if instance receive a close() call.
+ * **State Transitions:**
+ * - Transitions to **PROCESSING** on `IEffect.command(CommandId.START)` after starting
+ * processing data successfully.
+ * - Transitions to **INIT** on `IEffect.close()`.
+ * - Remains in **IDLE** on `IEffect.getParameter()`, `IEffect.setParameter()`,
+ * `IEffect.getDescriptor()`, `IEffect.command(CommandId.RESET)`, and `IEffect.reopen()`.
*/
IDLE,
+
/**
* An effect instance is in PROCESSING state after it receive an START command and start
* processing data successfully. Effect instance will transfer from PROCESSING to IDLE state if
@@ -75,12 +79,50 @@
* the case of a close() call received when instance in PROCESSING state, it should try to stop
* processing and transfer to IDLE first before close().
*
- * In PROCESSING state, effect instance must:
+ * **Requirements in PROCESSING state:**
* 1. Return EX_ILLEGAL_STATE if it's not able to handle any parameter settings at runtime.
* 2. Be able to handle STOP and RESET for IEffect.command() interface, and return
* EX_ILLEGAL_STATE for all other commands.
* 3. Must be able to handle all get* interface calls like IEffect.getParameter() and
* IEffect.getState().
+ *
+ * **State Transitions:**
+ * - Transitions to **IDLE** on `IEffect.command(CommandId.STOP)` ( if no draining is required
+ * or implemented) or `IEffect.command(CommandId.RESET)`.
+ * - Transitions to **DRAINING** on `IEffect.command(CommandId.STOP)` if draining is required.
+ * - Remains in **PROCESSING** on `IEffect.getParameter()`, `IEffect.setParameter()`,
+ * `IEffect.getDescriptor()`, and `IEffect.reopen()`.
+ *
+ * **Notes:**
+ * - Clients should avoid calling `IEffect.close()` directly in this state; instead, they should
+ * stop processing with `CommandId.STOP` before closing.
+ * - If `IEffect.close()` is called in this state, the effect instance should stop processing,
+ * transition to **IDLE**, and then close.
*/
PROCESSING,
+
+ /**
+ * DRAINING is an optional transitional state where the effect instance completes processing
+ * remaining input buffers or finalizes operations (e.g., fading) before stopping completely.
+ * This state is typically entered after a `CommandId.STOP` command in the PROCESSING state when
+ * draining is required.
+ *
+ * **Requirements in DRAINING state:**
+ * 1. Must handle `CommandId.START` and transition back to **PROCESSING**.
+ * 2. Must handle getter interface calls like `IEffect.getParameter()` and `IEffect.getState()`.
+ * 3. Must automatically transition to **IDLE** after draining is complete.
+ *
+ * **State Transitions:**
+ * - Transitions to **PROCESSING** on `IEffect.command(CommandId.START)`.
+ * - Transitions to **IDLE** on `IEffect.command(CommandId.RESET)`.
+ * - Transitions to **IDLE** automatically after draining is complete.
+ * - Remains in **DRAINING** on `IEffect.getParameter()`, `IEffect.setParameter()`,
+ * `IEffect.getDescriptor()`, and `IEffect.reopen()`.
+ *
+ * **Notes:**
+ * - If not implemented, the effect instance may transition directly from **PROCESSING** to
+ * **IDLE** without this intermediate state.
+ * - Any `CommandId.STOP` commands received during **DRAINING** should be ignored.
+ */
+ DRAINING,
}
diff --git a/audio/aidl/android/hardware/audio/effect/state.gv b/audio/aidl/android/hardware/audio/effect/state.gv
index 22c70c8..2a8194e 100644
--- a/audio/aidl/android/hardware/audio/effect/state.gv
+++ b/audio/aidl/android/hardware/audio/effect/state.gv
@@ -13,26 +13,56 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
// To render: "dot -Tpng state.gv -o state.png"
+
digraph effect_state_machine {
- node[shape = point style = filled fillcolor = black width = 0.5] I;
- node[shape = doublecircle] F;
- node[shape = oval width = 1];
- node[fillcolor = lightgreen] INIT;
- node[fillcolor = lightblue] IDLE;
- node[fillcolor = lightyellow] PROCESSING;
- I -> INIT[label = "IFactory.createEffect" labelfontcolor = "navy"];
- INIT -> F[label = "IFactory.destroyEffect"];
- INIT -> IDLE[label = "IEffect.open()" labelfontcolor = "lime"];
- IDLE -> PROCESSING[label = "IEffect.command(START"];
- PROCESSING -> IDLE[label = "IEffect.command(STOP)\nIEffect.command(RESET)"];
- IDLE -> INIT[label = "IEffect.close()"];
+ rankdir=LR; // Left to Right layout
- INIT -> INIT[label = "IEffect.getState\nIEffect.getDescriptor"];
- IDLE -> IDLE[label = "IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.command(RESET)\nIEffect.reopen"];
- PROCESSING
- -> PROCESSING
- [label = "IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.reopen"];
+ label="Effect State Machine";
+ fontsize=20;
+ labelloc=top;
+
+ node [fontname="Helvetica", fontsize=12, style=filled];
+
+ // Initial state node
+ I [shape=point, fillcolor=black, width=0.2];
+
+ // Final state node
+ F [shape=doublecircle, fillcolor=white, width=0.2];
+
+ // Define other nodes with colors
+ INIT [shape=ellipse, fillcolor=lightgreen];
+ IDLE [shape=ellipse, fillcolor=lightblue];
+ PROCESSING [shape=ellipse, fillcolor=lightyellow];
+ DRAINING [shape=ellipse, fillcolor=lightgrey];
+
+ // Transitions
+ I -> INIT [label="IFactory.createEffect", fontcolor="navy"];
+
+ INIT -> F [label="IFactory.destroyEffect"];
+
+ INIT -> IDLE [label="IEffect.open()", fontcolor="lime"];
+
+ IDLE -> PROCESSING [label="IEffect.command(START)"];
+
+ PROCESSING -> IDLE [label="IEffect.command(STOP)\nIEffect.command(RESET)"];
+
+ PROCESSING -> DRAINING [label="IEffect.command(STOP)", fontcolor="orange"];
+
+ DRAINING -> IDLE [label="Draining complete\n(IEffect.command(RESET)\nautomatic)"];
+
+ DRAINING -> PROCESSING [label="IEffect.command(START)\n(Interrupt draining)"];
+
+ IDLE -> INIT [label="IEffect.close()"];
+
+ // Self-loops
+ INIT -> INIT [label="IEffect.getState\nIEffect.getDescriptor"];
+
+ IDLE -> IDLE [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.command(RESET)\nIEffect.reopen"];
+
+ PROCESSING -> PROCESSING [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.reopen"];
+
+ DRAINING -> DRAINING [label="IEffect.getParameter\nIEffect.setParameter\nIEffect.getDescriptor\nIEffect.reopen\nFading"];
+
}
diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index ce29635..52ae936 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -29,7 +29,6 @@
#include <aidl/android/media/audio/common/AudioIoFlags.h>
#include <aidl/android/media/audio/common/AudioMode.h>
#include <aidl/android/media/audio/common/AudioOutputFlags.h>
-#include <aidl/android/media/audio/common/AudioPolicyForcedConfig.h>
#include <aidl/android/media/audio/common/PcmType.h>
#include <android/binder_auto_utils.h>
#include <utils/FastStrcmp.h>
@@ -63,31 +62,6 @@
::aidl::android::media::audio::common::AudioMode::CALL_SCREEN,
};
-constexpr std::array<::aidl::android::media::audio::common::AudioPolicyForcedConfig, 17>
- kValidAudioPolicyForcedConfig = {
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::NONE,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::SPEAKER,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::HEADPHONES,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::BT_SCO,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::BT_A2DP,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::WIRED_ACCESSORY,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::BT_CAR_DOCK,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::BT_DESK_DOCK,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::ANALOG_DOCK,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::DIGITAL_DOCK,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::NO_BT_A2DP,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::SYSTEM_ENFORCED,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::
- HDMI_SYSTEM_AUDIO_ENFORCED,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::
- ENCODED_SURROUND_NEVER,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::
- ENCODED_SURROUND_ALWAYS,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::
- ENCODED_SURROUND_MANUAL,
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig::BT_BLE,
-};
-
constexpr bool iequals(const std::string& str1, const std::string& str2) {
return str1.length() == str2.length() &&
!fasticmp<strncmp>(str1.c_str(), str2.c_str(), str1.length());
@@ -168,12 +142,6 @@
kValidAudioModes.end();
}
-constexpr bool isValidAudioPolicyForcedConfig(
- ::aidl::android::media::audio::common::AudioPolicyForcedConfig config) {
- return std::find(kValidAudioPolicyForcedConfig.begin(), kValidAudioPolicyForcedConfig.end(),
- config) != kValidAudioPolicyForcedConfig.end();
-}
-
static inline bool maybeVendorExtension(const std::string& s) {
// Only checks whether the string starts with the "vendor prefix".
static const std::string vendorPrefix = "VX_";
diff --git a/audio/aidl/default/CapEngineConfigXmlConverter.cpp b/audio/aidl/default/CapEngineConfigXmlConverter.cpp
index a6e78b9..20fbca4 100644
--- a/audio/aidl/default/CapEngineConfigXmlConverter.cpp
+++ b/audio/aidl/default/CapEngineConfigXmlConverter.cpp
@@ -96,8 +96,8 @@
} else if (!fastcmp<strncmp>(criterionName.c_str(), kXsdcForceConfigForUse,
strlen(kXsdcForceConfigForUse))) {
AudioHalCapCriterionV2::ForceConfigForUse value;
- value.forceUse = VALUE_OR_RETURN(convertForceUseCriterionToAidl(criterionName));
- value.values.emplace_back(VALUE_OR_RETURN(convertForcedConfigToAidl(criterionValue)));
+ value.values.emplace_back(
+ VALUE_OR_RETURN(convertForceUseToAidl(criterionName, criterionValue)));
rule.criterionAndValue = AudioHalCapCriterionV2::make<Tag::forceConfigForUse>(value);
} else {
LOG(ERROR) << __func__ << " unrecognized criterion " << criterionName;
diff --git a/audio/aidl/default/EffectContext.cpp b/audio/aidl/default/EffectContext.cpp
index 26c88b2..b354dd1 100644
--- a/audio/aidl/default/EffectContext.cpp
+++ b/audio/aidl/default/EffectContext.cpp
@@ -258,4 +258,18 @@
return RetCode::SUCCESS;
}
+RetCode EffectContext::startDraining() {
+ mIsDraining = true;
+ return RetCode::SUCCESS;
+}
+
+RetCode EffectContext::finishDraining() {
+ mIsDraining = false;
+ return RetCode::SUCCESS;
+}
+
+bool EffectContext::isDraining() {
+ return mIsDraining;
+}
+
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index 3e61335..7857f53 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -79,7 +79,6 @@
std::lock_guard lg(mImplMutex);
RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "alreadyClosed");
- // TODO: b/302036943 add reopen implementation
RETURN_IF(!mImplContext, EX_NULL_POINTER, "nullContext");
mImplContext->dupeFmqWithReopen(ret);
return ndk::ScopedAStatus::ok();
@@ -347,7 +346,7 @@
{
std::lock_guard lg(mImplMutex);
- if (mState != State::PROCESSING) {
+ if (mState != State::PROCESSING && mState != State::DRAINING) {
LOG(DEBUG) << getEffectNameWithVersion()
<< " skip process in state: " << toString(mState);
return;
diff --git a/audio/aidl/default/EffectThread.cpp b/audio/aidl/default/EffectThread.cpp
index b515385..1a52c13 100644
--- a/audio/aidl/default/EffectThread.cpp
+++ b/audio/aidl/default/EffectThread.cpp
@@ -68,7 +68,11 @@
RetCode EffectThread::startThread() {
{
std::lock_guard lg(mThreadMutex);
- mStop = false;
+ if (mDraining) {
+ mDraining = false;
+ } else {
+ mStop = false;
+ }
mCv.notify_one();
}
@@ -87,6 +91,25 @@
return RetCode::SUCCESS;
}
+RetCode EffectThread::startDraining() {
+ std::lock_guard lg(mThreadMutex);
+ mDraining = true;
+ mCv.notify_one();
+
+ LOG(VERBOSE) << mName << __func__;
+ return RetCode::SUCCESS;
+}
+
+RetCode EffectThread::finishDraining() {
+ std::lock_guard lg(mThreadMutex);
+ mDraining = false;
+ mStop = true;
+ mCv.notify_one();
+
+ LOG(VERBOSE) << mName << __func__;
+ return RetCode::SUCCESS;
+}
+
void EffectThread::threadLoop() {
pthread_setname_np(pthread_self(), mName.substr(0, kMaxTaskNameLen - 1).c_str());
setpriority(PRIO_PROCESS, 0, mPriority);
diff --git a/audio/aidl/default/XsdcConversion.cpp b/audio/aidl/default/XsdcConversion.cpp
index ba6110d..b42d7f5 100644
--- a/audio/aidl/default/XsdcConversion.cpp
+++ b/audio/aidl/default/XsdcConversion.cpp
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include <inttypes.h>
#include <unordered_set>
@@ -5,6 +21,7 @@
#define LOG_TAG "AHAL_Config"
#include <android-base/logging.h>
#include <android-base/strings.h>
+#include <android/binder_enums.h>
#include <aidl/android/media/audio/common/AudioPort.h>
#include <aidl/android/media/audio/common/AudioPortConfig.h>
@@ -20,9 +37,7 @@
using aidl::android::hardware::audio::common::iequals;
using aidl::android::hardware::audio::common::isValidAudioMode;
-using aidl::android::hardware::audio::common::isValidAudioPolicyForcedConfig;
using aidl::android::hardware::audio::common::kValidAudioModes;
-using aidl::android::hardware::audio::common::kValidAudioPolicyForcedConfig;
using aidl::android::media::audio::common::AudioChannelLayout;
using aidl::android::media::audio::common::AudioContentType;
using aidl::android::media::audio::common::AudioDevice;
@@ -38,7 +53,6 @@
using aidl::android::media::audio::common::AudioHalVolumeCurve;
using aidl::android::media::audio::common::AudioIoFlags;
using aidl::android::media::audio::common::AudioMode;
-using aidl::android::media::audio::common::AudioPolicyForcedConfig;
using aidl::android::media::audio::common::AudioPolicyForceUse;
using aidl::android::media::audio::common::AudioPort;
using aidl::android::media::audio::common::AudioPortConfig;
@@ -49,9 +63,10 @@
using aidl::android::media::audio::common::AudioSource;
using aidl::android::media::audio::common::AudioStreamType;
using aidl::android::media::audio::common::AudioUsage;
-using ::android::BAD_VALUE;
-using ::android::base::unexpected;
-using ::android::utilities::convertTo;
+using android::BAD_VALUE;
+using android::base::unexpected;
+using android::utilities::convertTo;
+using ndk::enum_range;
namespace ap_xsd = android::audio::policy::configuration;
namespace eng_xsd = android::audio::policy::engine::configuration;
@@ -531,18 +546,6 @@
return result;
}
-ConversionResult<AudioPolicyForcedConfig> convertForcedConfigToAidl(
- const std::string& xsdcForcedConfigCriterionType) {
- const auto it = std::find_if(
- kValidAudioPolicyForcedConfig.begin(), kValidAudioPolicyForcedConfig.end(),
- [&](const auto& config) { return toString(config) == xsdcForcedConfigCriterionType; });
- if (it == kValidAudioPolicyForcedConfig.end()) {
- LOG(ERROR) << __func__ << " invalid forced config " << xsdcForcedConfigCriterionType;
- return unexpected(BAD_VALUE);
- }
- return *it;
-}
-
ConversionResult<AudioMode> convertTelephonyModeToAidl(const std::string& xsdcModeCriterionType) {
const auto it = std::find_if(kValidAudioModes.begin(), kValidAudioModes.end(),
[&xsdcModeCriterionType](const auto& mode) {
@@ -637,6 +640,16 @@
return aidlDeviceAddresses;
}
+ConversionResult<AudioMode> convertAudioModeToAidl(const std::string& xsdcAudioModeType) {
+ const auto it = std::find_if(enum_range<AudioMode>().begin(), enum_range<AudioMode>().end(),
+ [&](const auto v) { return toString(v) == xsdcAudioModeType; });
+ if (it == enum_range<AudioMode>().end()) {
+ LOG(ERROR) << __func__ << " invalid audio mode " << xsdcAudioModeType;
+ return unexpected(BAD_VALUE);
+ }
+ return *it;
+}
+
ConversionResult<std::vector<AudioMode>> convertTelephonyModesToAidl(
const eng_xsd::CriterionTypeType& xsdcTelephonyModeCriterionType) {
if (xsdcTelephonyModeCriterionType.getValues().empty()) {
@@ -647,71 +660,97 @@
for (eng_xsd::ValuesType xsdcValues : xsdcTelephonyModeCriterionType.getValues()) {
aidlAudioModes.reserve(xsdcValues.getValue().size());
for (const eng_xsd::ValueType& xsdcValue : xsdcValues.getValue()) {
- int integerValue = xsdcValue.getNumerical();
- if (!isValidAudioMode(AudioMode(integerValue))) {
- LOG(ERROR) << __func__ << " invalid audio mode " << integerValue;
- return unexpected(BAD_VALUE);
- }
- aidlAudioModes.push_back(AudioMode(integerValue));
+ aidlAudioModes.push_back(
+ VALUE_OR_RETURN(convertAudioModeToAidl(xsdcValue.getLiteral())));
}
}
return aidlAudioModes;
}
-ConversionResult<std::vector<AudioPolicyForcedConfig>> convertForcedConfigsToAidl(
+ConversionResult<std::vector<AudioPolicyForceUse>> convertForceUseConfigsToAidl(
+ const std::string& criterionValue,
const eng_xsd::CriterionTypeType& xsdcForcedConfigCriterionType) {
if (xsdcForcedConfigCriterionType.getValues().empty()) {
LOG(ERROR) << __func__ << " no values provided";
return unexpected(BAD_VALUE);
}
- std::vector<AudioPolicyForcedConfig> aidlForcedConfigs;
+ std::vector<AudioPolicyForceUse> aidlForcedConfigs;
for (eng_xsd::ValuesType xsdcValues : xsdcForcedConfigCriterionType.getValues()) {
aidlForcedConfigs.reserve(xsdcValues.getValue().size());
for (const eng_xsd::ValueType& xsdcValue : xsdcValues.getValue()) {
- int integerValue = xsdcValue.getNumerical();
- if (!isValidAudioPolicyForcedConfig(AudioPolicyForcedConfig(integerValue))) {
- LOG(ERROR) << __func__ << " invalid forced config mode " << integerValue;
- return unexpected(BAD_VALUE);
- }
- aidlForcedConfigs.push_back(AudioPolicyForcedConfig(integerValue));
+ aidlForcedConfigs.push_back(
+ VALUE_OR_RETURN(convertForceUseToAidl(criterionValue, xsdcValue.getLiteral())));
}
}
return aidlForcedConfigs;
}
-ConversionResult<AudioPolicyForceUse> convertForceUseCriterionToAidl(
- const std::string& xsdcCriterionName) {
+template <typename T>
+ConversionResult<T> convertForceUseForcedConfigToAidl(
+ const std::string& xsdcForcedConfigCriterionType) {
+ const auto it = std::find_if(enum_range<T>().begin(), enum_range<T>().end(), [&](const auto v) {
+ return toString(v) == xsdcForcedConfigCriterionType;
+ });
+ if (it == enum_range<T>().end()) {
+ LOG(ERROR) << __func__ << " invalid forced config " << xsdcForcedConfigCriterionType;
+ return unexpected(BAD_VALUE);
+ }
+ return *it;
+}
+
+ConversionResult<AudioPolicyForceUse> convertForceUseToAidl(const std::string& xsdcCriterionName,
+ const std::string& xsdcCriterionValue) {
if (!fastcmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForCommunication,
- strlen(kXsdcForceConfigForCommunication))) {
- return AudioPolicyForceUse::COMMUNICATION;
+ strlen(kXsdcForceConfigForCommunication))) {
+ const auto deviceCategory = VALUE_OR_RETURN(
+ convertForceUseForcedConfigToAidl<AudioPolicyForceUse::CommunicationDeviceCategory>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::forCommunication>(deviceCategory);
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForMedia,
strlen(kXsdcForceConfigForMedia))) {
- return AudioPolicyForceUse::MEDIA;
+ const auto deviceCategory = VALUE_OR_RETURN(
+ convertForceUseForcedConfigToAidl<AudioPolicyForceUse::MediaDeviceCategory>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::forMedia>(deviceCategory);
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForRecord,
strlen(kXsdcForceConfigForRecord))) {
- return AudioPolicyForceUse::RECORD;
+ const auto deviceCategory = VALUE_OR_RETURN(
+ convertForceUseForcedConfigToAidl<AudioPolicyForceUse::CommunicationDeviceCategory>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::forRecord>(deviceCategory);
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForDock,
- strlen(kXsdcForceConfigForDock))) {
- return AudioPolicyForceUse::DOCK;
+ strlen(kXsdcForceConfigForDock))) {
+ const auto dockType =
+ VALUE_OR_RETURN(convertForceUseForcedConfigToAidl<AudioPolicyForceUse::DockType>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::dock>(dockType);
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForSystem,
strlen(kXsdcForceConfigForSystem))) {
- return AudioPolicyForceUse::SYSTEM;
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::systemSounds>(xsdcCriterionValue ==
+ "SYSTEM_ENFORCED");
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForHdmiSystemAudio,
strlen(kXsdcForceConfigForHdmiSystemAudio))) {
- return AudioPolicyForceUse::HDMI_SYSTEM_AUDIO;
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::hdmiSystemAudio>(
+ xsdcCriterionValue == "HDMI_SYSTEM_AUDIO_ENFORCED");
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForEncodedSurround,
strlen(kXsdcForceConfigForEncodedSurround))) {
- return AudioPolicyForceUse::ENCODED_SURROUND;
+ const auto encodedSurround = VALUE_OR_RETURN(
+ convertForceUseForcedConfigToAidl<AudioPolicyForceUse::EncodedSurroundConfig>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::encodedSurround>(encodedSurround);
}
if (!fasticmp<strncmp>(xsdcCriterionName.c_str(), kXsdcForceConfigForVibrateRinging,
strlen(kXsdcForceConfigForVibrateRinging))) {
- return AudioPolicyForceUse::VIBRATE_RINGING;
+ const auto deviceCategory = VALUE_OR_RETURN(
+ convertForceUseForcedConfigToAidl<AudioPolicyForceUse::CommunicationDeviceCategory>(
+ xsdcCriterionValue));
+ return AudioPolicyForceUse::make<AudioPolicyForceUse::forVibrateRinging>(deviceCategory);
}
LOG(ERROR) << __func__ << " unrecognized force use " << xsdcCriterionName;
return unexpected(BAD_VALUE);
@@ -747,9 +786,8 @@
}
if (!fastcmp<strncmp>(xsdcCriterion.getName().c_str(), kXsdcForceConfigForUse,
strlen(kXsdcForceConfigForUse))) {
- return AudioHalCapCriterionV2::make<Tag::forceConfigForUse>(
- VALUE_OR_RETURN(convertForceUseCriterionToAidl(xsdcCriterion.getName())),
- VALUE_OR_RETURN(convertForcedConfigsToAidl(xsdcCriterionType)));
+ return AudioHalCapCriterionV2::make<Tag::forceConfigForUse>(VALUE_OR_RETURN(
+ convertForceUseConfigsToAidl(xsdcCriterion.getName(), xsdcCriterionType)));
}
LOG(ERROR) << __func__ << " unrecognized criterion " << xsdcCriterion.getName();
return unexpected(BAD_VALUE);
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index a54f4db..2e860d8 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -36,6 +36,7 @@
<library name="downmix" path="libdownmixaidl.so"/>
<library name="dynamics_processing" path="libdynamicsprocessingaidl.so"/>
<library name="equalizersw" path="libequalizersw.so"/>
+ <library name="erasersw" path="liberasersw.so"/>
<library name="haptic_generator" path="libhapticgeneratoraidl.so"/>
<library name="loudness_enhancer" path="libloudnessenhanceraidl.so"/>
<library name="nssw" path="libnssw.so"/>
@@ -75,6 +76,7 @@
<effect name="bassboost" library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
+ <effect name="eraser" library="erasersw" uuid="fa81ab46-588b-11ed-9b6a-0242ac120002"/>
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
diff --git a/audio/aidl/default/config/audioPolicy/engine/api/current.txt b/audio/aidl/default/config/audioPolicy/engine/api/current.txt
index 8e0e9a2..017362f 100644
--- a/audio/aidl/default/config/audioPolicy/engine/api/current.txt
+++ b/audio/aidl/default/config/audioPolicy/engine/api/current.txt
@@ -148,6 +148,45 @@
method public void setValue(@Nullable java.util.List<android.audio.policy.engine.configuration.FlagType>);
}
+ public enum ForcedConfigCommunicationDeviceType {
+ method @NonNull public String getRawName();
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigCommunicationDeviceType BT_BLE;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigCommunicationDeviceType BT_SCO;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigCommunicationDeviceType NONE;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigCommunicationDeviceType SPEAKER;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigCommunicationDeviceType WIRED_ACCESSORY;
+ }
+
+ public enum ForcedConfigDockType {
+ method @NonNull public String getRawName();
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType ANALOG_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType BT_CAR_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType BT_DESK_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType DIGITAL_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType NONE;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigDockType WIRED_ACCESSORY;
+ }
+
+ public enum ForcedConfigMediaDeviceType {
+ method @NonNull public String getRawName();
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType ANALOG_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType BT_A2DP;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType DIGITAL_DOCK;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType HEADPHONES;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType NONE;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType NO_BT_A2DP;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType SPEAKER;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedConfigMediaDeviceType WIRED_ACCESSORY;
+ }
+
+ public enum ForcedEncodingSourroundConfigType {
+ method @NonNull public String getRawName();
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedEncodingSourroundConfigType ALWAYS;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedEncodingSourroundConfigType MANUAL;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedEncodingSourroundConfigType NEVER;
+ enum_constant public static final android.audio.policy.engine.configuration.ForcedEncodingSourroundConfigType UNSPECIFIED;
+ }
+
public enum PfwCriterionTypeEnum {
method @NonNull public String getRawName();
enum_constant public static final android.audio.policy.engine.configuration.PfwCriterionTypeEnum exclusive;
@@ -244,10 +283,8 @@
ctor public ValueType();
method @Nullable public String getAndroid_type();
method @Nullable public String getLiteral();
- method @Nullable public long getNumerical();
method public void setAndroid_type(@Nullable String);
method public void setLiteral(@Nullable String);
- method public void setNumerical(@Nullable long);
}
public class ValuesType {
diff --git a/audio/aidl/default/config/audioPolicy/engine/audio_policy_engine_configuration.xsd b/audio/aidl/default/config/audioPolicy/engine/audio_policy_engine_configuration.xsd
index e2508ea..c16e366 100644
--- a/audio/aidl/default/config/audioPolicy/engine/audio_policy_engine_configuration.xsd
+++ b/audio/aidl/default/config/audioPolicy/engine/audio_policy_engine_configuration.xsd
@@ -191,10 +191,9 @@
<xs:complexType name="valueType">
<xs:annotation>
<xs:documentation xml:lang="en">
- Criterion type is provided as a tuple of 'human readable' string (referred as the
- literal part, that will allow to express 'human readable' rules, numerical value
- associated in order to improve performances of the parameter framework library used,
- and an optional android type.
+ Criterion type is provided as a pair of 'human readable' string (referred as the
+ literal part, that will allow to express 'human readable' rules and an optional
+ android type.
This android type is reserved for device type mapping with parameter framework
representation on a bitfield (Only one bit is expected to represent a device) and
android representation of a type that may use several bits.
@@ -203,7 +202,6 @@
</xs:documentation>
</xs:annotation>
<xs:attribute name="literal" type="xs:string" use="required"/>
- <xs:attribute name="numerical" type="xs:long" use="required"/>
<xs:attribute name="android_type" type="longDecimalOrHexType" use="optional"/>
</xs:complexType>
@@ -409,6 +407,49 @@
</xs:restriction>
</xs:simpleType>
+ <xs:simpleType name="forcedConfigCommunicationDeviceType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="NONE"/>
+ <xs:enumeration value="SPEAKER"/>
+ <xs:enumeration value="BT_SCO"/>
+ <xs:enumeration value="BT_BLE"/>
+ <xs:enumeration value="WIRED_ACCESSORY"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="forcedConfigMediaDeviceType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="NONE"/>
+ <xs:enumeration value="SPEAKER"/>
+ <xs:enumeration value="HEADPHONES"/>
+ <xs:enumeration value="BT_A2DP"/>
+ <xs:enumeration value="ANALOG_DOCK"/>
+ <xs:enumeration value="DIGITAL_DOCK"/>
+ <xs:enumeration value="WIRED_ACCESSORY"/>
+ <xs:enumeration value="NO_BT_A2DP"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="forcedConfigDockType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="NONE"/>
+ <xs:enumeration value="BT_CAR_DOCK"/>
+ <xs:enumeration value="BT_DESK_DOCK"/>
+ <xs:enumeration value="ANALOG_DOCK"/>
+ <xs:enumeration value="DIGITAL_DOCK"/>
+ <xs:enumeration value="WIRED_ACCESSORY"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="forcedEncodingSourroundConfigType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="UNSPECIFIED"/>
+ <xs:enumeration value="NEVER"/>
+ <xs:enumeration value="ALWAYS"/>
+ <xs:enumeration value="MANUAL"/>
+ </xs:restriction>
+ </xs:simpleType>
+
<xs:simpleType name="sourceEnumType">
<xs:restriction base="xs:string">
<xs:enumeration value="AUDIO_SOURCE_DEFAULT"/>
diff --git a/audio/aidl/default/eraser/Android.bp b/audio/aidl/default/eraser/Android.bp
new file mode 100644
index 0000000..c495d8e
--- /dev/null
+++ b/audio/aidl/default/eraser/Android.bp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package {
+ default_team: "trendy_team_android_media_audio_framework",
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_library_shared {
+ name: "liberasersw",
+ defaults: [
+ "aidlaudioeffectservice_defaults",
+ ],
+ srcs: [
+ "Eraser.cpp",
+ ":effectCommonFile",
+ ],
+ relative_install_path: "soundfx",
+ visibility: [
+ "//hardware/interfaces/audio/aidl/default:__subpackages__",
+ ],
+}
diff --git a/audio/aidl/default/eraser/Eraser.cpp b/audio/aidl/default/eraser/Eraser.cpp
new file mode 100644
index 0000000..59cc9a2
--- /dev/null
+++ b/audio/aidl/default/eraser/Eraser.cpp
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "AHAL_Eraser"
+
+#include "Eraser.h"
+
+#include <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
+
+#include <optional>
+
+using aidl::android::hardware::audio::common::getChannelCount;
+using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::EraserSw;
+using aidl::android::hardware::audio::effect::getEffectImplUuidEraserSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidEraser;
+using aidl::android::hardware::audio::effect::IEffect;
+using aidl::android::hardware::audio::effect::State;
+using aidl::android::media::audio::common::AudioChannelLayout;
+using aidl::android::media::audio::common::AudioUuid;
+
+extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
+ std::shared_ptr<IEffect>* instanceSpp) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEraserSw()) {
+ LOG(ERROR) << __func__ << "uuid not supported";
+ return EX_ILLEGAL_ARGUMENT;
+ }
+ if (!instanceSpp) {
+ LOG(ERROR) << __func__ << " invalid input parameter!";
+ return EX_ILLEGAL_ARGUMENT;
+ }
+
+ *instanceSpp = ndk::SharedRefBase::make<EraserSw>();
+ LOG(DEBUG) << __func__ << " instance " << instanceSpp->get() << " created";
+ return EX_NONE;
+}
+
+extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEraserSw()) {
+ LOG(ERROR) << __func__ << "uuid not supported";
+ return EX_ILLEGAL_ARGUMENT;
+ }
+ *_aidl_return = EraserSw::kDescriptor;
+ return EX_NONE;
+}
+
+namespace aidl::android::hardware::audio::effect {
+
+const std::string EraserSw::kEffectName = "EraserSw";
+const Descriptor EraserSw::kDescriptor = {
+ .common = {.id = {.type = getEffectTypeUuidEraser(), .uuid = getEffectImplUuidEraserSw()},
+ .flags = {.type = Flags::Type::INSERT,
+ .insert = Flags::Insert::FIRST,
+ .hwAcceleratorMode = Flags::HardwareAccelerator::NONE},
+ .name = EraserSw::kEffectName,
+ .implementor = "The Android Open Source Project"}};
+
+ndk::ScopedAStatus EraserSw::getDescriptor(Descriptor* _aidl_return) {
+ LOG(DEBUG) << __func__ << kDescriptor.toString();
+ *_aidl_return = kDescriptor;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EraserSw::setParameterSpecific(const Parameter::Specific& specific) {
+ RETURN_IF(Parameter::Specific::eraser != specific.getTag(), EX_ILLEGAL_ARGUMENT,
+ "EffectNotSupported");
+ RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");
+
+ auto& param = specific.get<Parameter::Specific::eraser>();
+ return mContext->setParam(param.getTag(), param);
+}
+
+ndk::ScopedAStatus EraserSw::getParameterSpecific(const Parameter::Id& id,
+ Parameter::Specific* specific) {
+ RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");
+
+ auto tag = id.getTag();
+ RETURN_IF(Parameter::Id::eraserTag != tag, EX_ILLEGAL_ARGUMENT, "wrongIdTag");
+ auto eraserId = id.get<Parameter::Id::eraserTag>();
+ auto eraserTag = eraserId.getTag();
+ switch (eraserTag) {
+ case Eraser::Id::commonTag: {
+ auto specificTag = eraserId.get<Eraser::Id::commonTag>();
+ std::optional<Eraser> param = mContext->getParam(specificTag);
+ if (!param.has_value()) {
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "EraserTagNotSupported");
+ }
+ specific->set<Parameter::Specific::eraser>(param.value());
+ break;
+ }
+ default: {
+ LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "EraserTagNotSupported");
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+std::shared_ptr<EffectContext> EraserSw::createContext(const Parameter::Common& common) {
+ if (mContext) {
+ LOG(DEBUG) << __func__ << " context already exist";
+ } else {
+ mContext = std::make_shared<EraserSwContext>(1 /* statusFmqDepth */, common);
+ }
+ return mContext;
+}
+
+RetCode EraserSw::releaseContext() {
+ if (mContext) {
+ mContext.reset();
+ }
+ return RetCode::SUCCESS;
+}
+
+EraserSw::~EraserSw() {
+ cleanUp();
+ LOG(DEBUG) << __func__;
+}
+
+ndk::ScopedAStatus EraserSw::command(CommandId command) {
+ std::lock_guard lg(mImplMutex);
+ RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "instanceNotOpen");
+
+ switch (command) {
+ case CommandId::START:
+ RETURN_OK_IF(mState == State::PROCESSING);
+ mState = State::PROCESSING;
+ mContext->enable();
+ startThread();
+ RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
+ "notifyEventFlagNotEmptyFailed");
+ break;
+ case CommandId::STOP:
+ RETURN_OK_IF(mState == State::IDLE || mState == State::DRAINING);
+ if (mVersion < kDrainSupportedVersion) {
+ mState = State::IDLE;
+ stopThread();
+ mContext->disable();
+ } else {
+ mState = State::DRAINING;
+ startDraining();
+ mContext->startDraining();
+ }
+ RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
+ "notifyEventFlagNotEmptyFailed");
+ break;
+ case CommandId::RESET:
+ mState = State::IDLE;
+ RETURN_IF(notifyEventFlag(mDataMqNotEmptyEf) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
+ "notifyEventFlagNotEmptyFailed");
+ stopThread();
+ mImplContext->disable();
+ mImplContext->reset();
+ mImplContext->resetBuffer();
+ break;
+ default:
+ LOG(ERROR) << getEffectNameWithVersion() << __func__ << " instance still processing";
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "CommandIdNotSupported");
+ }
+ LOG(VERBOSE) << getEffectNameWithVersion() << __func__
+ << " transfer to state: " << toString(mState);
+ return ndk::ScopedAStatus::ok();
+}
+
+// Processing method running in EffectWorker thread.
+IEffect::Status EraserSw::effectProcessImpl(float* in, float* out, int samples) {
+ RETURN_VALUE_IF(!mContext, (IEffect::Status{EX_NULL_POINTER, 0, 0}), "nullContext");
+ IEffect::Status procStatus{STATUS_NOT_ENOUGH_DATA, 0, 0};
+ procStatus = mContext->process(in, out, samples);
+ if (mState == State::DRAINING && procStatus.status == STATUS_NOT_ENOUGH_DATA) {
+ drainingComplete_l();
+ }
+
+ return procStatus;
+}
+
+void EraserSw::drainingComplete_l() {
+ if (mState != State::DRAINING) return;
+
+ LOG(DEBUG) << getEffectNameWithVersion() << __func__;
+ finishDraining();
+ mState = State::IDLE;
+}
+
+EraserSwContext::EraserSwContext(int statusDepth, const Parameter::Common& common)
+ : EffectContext(statusDepth, common) {
+ LOG(DEBUG) << __func__;
+}
+
+EraserSwContext::~EraserSwContext() {
+ LOG(DEBUG) << __func__;
+}
+
+template <typename TAG>
+std::optional<Eraser> EraserSwContext::getParam(TAG tag) {
+ if (mParamsMap.find(tag) != mParamsMap.end()) {
+ return mParamsMap.at(tag);
+ }
+ return std::nullopt;
+}
+
+template <typename TAG>
+ndk::ScopedAStatus EraserSwContext::setParam(TAG tag, Eraser eraser) {
+ mParamsMap[tag] = eraser;
+ return ndk::ScopedAStatus::ok();
+}
+
+IEffect::Status EraserSwContext::process(float* in, float* out, int samples) {
+ LOG(DEBUG) << __func__ << " in " << in << " out " << out << " samples " << samples;
+ IEffect::Status procStatus = {EX_ILLEGAL_ARGUMENT, 0, 0};
+ const auto inputChannelCount = getChannelCount(mCommon.input.base.channelMask);
+ const auto outputChannelCount = getChannelCount(mCommon.output.base.channelMask);
+ if (inputChannelCount < outputChannelCount) {
+ LOG(ERROR) << __func__ << " invalid channel count, in: " << inputChannelCount
+ << " out: " << outputChannelCount;
+ return procStatus;
+ }
+
+ if (samples <= 0 || 0 != samples % inputChannelCount) {
+ LOG(ERROR) << __func__ << " invalid samples: " << samples;
+ return procStatus;
+ }
+
+ const int iFrames = samples / inputChannelCount;
+ const float gainPerSample = 1.f / iFrames;
+ for (int i = 0; i < iFrames; i++) {
+ if (isDraining()) {
+ const float gain = (iFrames - i - 1) * gainPerSample;
+ for (size_t c = 0; c < outputChannelCount; c++) {
+ out[c] = in[c] * gain;
+ }
+ } else {
+ std::memcpy(out, in, outputChannelCount * sizeof(float));
+ }
+
+ in += inputChannelCount;
+ out += outputChannelCount;
+ }
+
+ // drain for one cycle
+ if (isDraining()) {
+ procStatus.status = STATUS_NOT_ENOUGH_DATA;
+ finishDraining();
+ } else {
+ procStatus.status = STATUS_OK;
+ }
+ procStatus.fmqConsumed = static_cast<int32_t>(iFrames * inputChannelCount);
+ procStatus.fmqProduced = static_cast<int32_t>(iFrames * outputChannelCount);
+
+ return procStatus;
+}
+
+} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/eraser/Eraser.h b/audio/aidl/default/eraser/Eraser.h
new file mode 100644
index 0000000..7bf2f57
--- /dev/null
+++ b/audio/aidl/default/eraser/Eraser.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "effect-impl/EffectContext.h"
+#include "effect-impl/EffectImpl.h"
+
+#include <fmq/AidlMessageQueue.h>
+
+#include <unordered_map>
+#include <vector>
+
+namespace aidl::android::hardware::audio::effect {
+
+class EraserSwContext final : public EffectContext {
+ public:
+ EraserSwContext(int statusDepth, const Parameter::Common& common);
+ ~EraserSwContext() final;
+
+ template <typename TAG>
+ std::optional<Eraser> getParam(TAG tag);
+ template <typename TAG>
+ ndk::ScopedAStatus setParam(TAG tag, Eraser eraser);
+
+ IEffect::Status process(float* in, float* out, int samples);
+
+ private:
+ std::unordered_map<Eraser::Tag, Eraser> mParamsMap;
+};
+
+class EraserSw final : public EffectImpl {
+ public:
+ static const std::string kEffectName;
+ static const Capability kCapability;
+ static const Descriptor kDescriptor;
+ ~EraserSw() final;
+
+ ndk::ScopedAStatus getDescriptor(Descriptor* _aidl_return) final;
+ ndk::ScopedAStatus setParameterSpecific(const Parameter::Specific& specific)
+ REQUIRES(mImplMutex) final;
+ ndk::ScopedAStatus getParameterSpecific(const Parameter::Id& id, Parameter::Specific* specific)
+ REQUIRES(mImplMutex) final;
+
+ std::shared_ptr<EffectContext> createContext(const Parameter::Common& common)
+ REQUIRES(mImplMutex) final;
+ RetCode releaseContext() REQUIRES(mImplMutex) final;
+
+ std::string getEffectName() final { return kEffectName; };
+ IEffect::Status effectProcessImpl(float* in, float* out, int samples)
+ REQUIRES(mImplMutex) final;
+
+ ndk::ScopedAStatus command(CommandId command) final;
+ void drainingComplete_l() REQUIRES(mImplMutex);
+
+ private:
+ static const std::vector<Range::SpatializerRange> kRanges;
+ std::shared_ptr<EraserSwContext> mContext GUARDED_BY(mImplMutex);
+};
+} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/core-impl/XsdcConversion.h b/audio/aidl/default/include/core-impl/XsdcConversion.h
index e855a3e..f00206b 100644
--- a/audio/aidl/default/include/core-impl/XsdcConversion.h
+++ b/audio/aidl/default/include/core-impl/XsdcConversion.h
@@ -1,6 +1,20 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include <string>
-#include <unordered_map>
-#include <unordered_set>
#include <aidl/android/media/audio/common/AudioHalCapCriterion.h>
#include <aidl/android/media/audio/common/AudioHalCapCriterionType.h>
@@ -21,10 +35,8 @@
static constexpr const char kXsdcForceConfigForUse[] = "ForceUseFor";
-ConversionResult<aidlaudiocommon::AudioPolicyForceUse> convertForceUseCriterionToAidl(
- const std::string& xsdcCriterionName);
-ConversionResult<aidlaudiocommon::AudioPolicyForcedConfig> convertForcedConfigToAidl(
- const std::string& xsdcForcedConfigCriterionType);
+ConversionResult<aidlaudiocommon::AudioPolicyForceUse> convertForceUseToAidl(
+ const std::string& xsdcCriterionName, const std::string& xsdcCriterionValue);
ConversionResult<aidlaudiocommon::AudioDeviceAddress> convertDeviceAddressToAidl(
const std::string& xsdcAddress);
ConversionResult<aidlaudiocommon::AudioMode> convertTelephonyModeToAidl(
diff --git a/audio/aidl/default/include/effect-impl/EffectContext.h b/audio/aidl/default/include/effect-impl/EffectContext.h
index 02a4caa..9e44349 100644
--- a/audio/aidl/default/include/effect-impl/EffectContext.h
+++ b/audio/aidl/default/include/effect-impl/EffectContext.h
@@ -86,7 +86,12 @@
virtual RetCode disable();
virtual RetCode reset();
+ virtual RetCode startDraining();
+ virtual RetCode finishDraining();
+ virtual bool isDraining();
+
protected:
+ bool mIsDraining = false;
int mVersion = 0;
size_t mInputFrameSize = 0;
size_t mOutputFrameSize = 0;
diff --git a/audio/aidl/default/include/effect-impl/EffectThread.h b/audio/aidl/default/include/effect-impl/EffectThread.h
index ec2a658..9abcdb8 100644
--- a/audio/aidl/default/include/effect-impl/EffectThread.h
+++ b/audio/aidl/default/include/effect-impl/EffectThread.h
@@ -38,6 +38,8 @@
RetCode destroyThread();
RetCode startThread();
RetCode stopThread();
+ RetCode startDraining();
+ RetCode finishDraining();
// Will call process() in a loop if the thread is running.
void threadLoop();
@@ -49,6 +51,9 @@
*/
virtual void process() = 0;
+ protected:
+ bool mDraining GUARDED_BY(mThreadMutex) = false;
+
private:
static constexpr int kMaxTaskNameLen = 15;
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index cbd42c0..5b2230d 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -14,6 +14,7 @@
"latest_android_hardware_audio_common_ndk_static",
"latest_android_hardware_audio_effect_ndk_static",
"latest_android_media_audio_common_types_ndk_static",
+ "latest_android_media_audio_eraser_types_ndk_static",
"use_libaidlvintf_gtest_helper_static",
"VtsHalTargetTestDefaults",
],
@@ -115,6 +116,9 @@
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
static_libs: ["libaudioaidlranges"],
srcs: ["VtsHalDynamicsProcessingTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
@@ -166,6 +170,9 @@
name: "VtsHalVisualizerTargetTest",
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
srcs: ["VtsHalVisualizerTargetTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index d716975..787bd12 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -124,7 +124,7 @@
return;
}
- ASSERT_NO_FATAL_FAILURE(expectState(effect, State::IDLE));
+ ASSERT_TRUE(expectState(effect, State::IDLE));
updateFrameSize(common);
}
@@ -155,7 +155,7 @@
if (effect) {
ASSERT_STATUS(status, effect->close());
if (status == EX_NONE) {
- ASSERT_NO_FATAL_FAILURE(expectState(effect, State::INIT));
+ ASSERT_TRUE(expectState(effect, State::INIT));
}
}
}
@@ -166,12 +166,14 @@
ASSERT_STATUS(status, effect->getDescriptor(&desc));
}
- static void expectState(std::shared_ptr<IEffect> effect, State expectState,
- binder_status_t status = EX_NONE) {
- ASSERT_NE(effect, nullptr);
- State state;
- ASSERT_STATUS(status, effect->getState(&state));
- ASSERT_EQ(expectState, state);
+ static bool expectState(std::shared_ptr<IEffect> effect, State expectState) {
+ if (effect == nullptr) return false;
+
+ if (State state; EX_NONE != effect->getState(&state).getStatus() || expectState != state) {
+ return false;
+ }
+
+ return true;
}
static void commandIgnoreRet(std::shared_ptr<IEffect> effect, CommandId command) {
@@ -190,12 +192,14 @@
switch (command) {
case CommandId::START:
- ASSERT_NO_FATAL_FAILURE(expectState(effect, State::PROCESSING));
+ ASSERT_TRUE(expectState(effect, State::PROCESSING));
break;
case CommandId::STOP:
- FALLTHROUGH_INTENDED;
+ ASSERT_TRUE(expectState(effect, State::IDLE) ||
+ expectState(effect, State::DRAINING));
+ break;
case CommandId::RESET:
- ASSERT_NO_FATAL_FAILURE(expectState(effect, State::IDLE));
+ ASSERT_TRUE(expectState(effect, State::IDLE));
break;
default:
return;
@@ -371,11 +375,30 @@
return functor(result);
}
+ // keep writing data to the FMQ until effect transit from DRAINING to IDLE
+ static void waitForDrain(std::vector<float>& inputBuffer, std::vector<float>& outputBuffer,
+ const std::shared_ptr<IEffect>& effect,
+ std::unique_ptr<EffectHelper::StatusMQ>& statusMQ,
+ std::unique_ptr<EffectHelper::DataMQ>& inputMQ,
+ std::unique_ptr<EffectHelper::DataMQ>& outputMQ, int version) {
+ State state;
+ while (effect->getState(&state).getStatus() == EX_NONE && state == State::DRAINING) {
+ EXPECT_NO_FATAL_FAILURE(
+ EffectHelper::writeToFmq(statusMQ, inputMQ, inputBuffer, version));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(
+ statusMQ, 1, outputMQ, outputBuffer.size(), outputBuffer, std::nullopt));
+ }
+ ASSERT_TRUE(State::IDLE == state);
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, outputBuffer));
+ return;
+ }
+
static void processAndWriteToOutput(std::vector<float>& inputBuffer,
std::vector<float>& outputBuffer,
const std::shared_ptr<IEffect>& effect,
IEffect::OpenEffectReturn* openEffectReturn,
- int version = -1, int times = 1) {
+ int version = -1, int times = 1,
+ bool callStopReset = true) {
// Initialize AidlMessagequeues
auto statusMQ = std::make_unique<EffectHelper::StatusMQ>(openEffectReturn->statusMQ);
ASSERT_TRUE(statusMQ->isValid());
@@ -401,10 +424,15 @@
}
// Disable the process
- ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::STOP));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, outputBuffer));
+ if (callStopReset) {
+ ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::STOP));
+ EXPECT_NO_FATAL_FAILURE(waitForDrain(inputBuffer, outputBuffer, effect, statusMQ,
+ inputMQ, outputMQ, version));
+ }
- ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::RESET));
+ if (callStopReset) {
+ ASSERT_NO_FATAL_FAILURE(command(effect, CommandId::RESET));
+ }
}
// Find FFT bin indices for testFrequencies and get bin center frequencies
diff --git a/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
index 583143c..eaec88b 100644
--- a/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreConfigTargetTest.cpp
@@ -55,7 +55,6 @@
using aidl::android::media::audio::common::AudioHalVolumeGroup;
using aidl::android::media::audio::common::AudioMode;
using aidl::android::media::audio::common::AudioPolicyForceUse;
-using aidl::android::media::audio::common::AudioPolicyForcedConfig;
using aidl::android::media::audio::common::AudioProductStrategyType;
using aidl::android::media::audio::common::AudioSource;
using aidl::android::media::audio::common::AudioStreamType;
@@ -577,7 +576,7 @@
void ValidateCapSpecificConfig(const AudioHalEngineConfig::CapSpecificConfig& capCfg) {
EXPECT_TRUE(capCfg.criteriaV2.has_value());
std::unordered_set<AudioHalCapCriterionV2::Tag> criterionTagSet;
- std::unordered_set<AudioPolicyForceUse> forceUseCriterionUseSet;
+ std::unordered_set<AudioPolicyForceUse::Tag> forceUseCriterionUseSet;
for (const auto& criterion : capCfg.criteriaV2.value()) {
EXPECT_TRUE(criterion.has_value());
if (criterion.value().getTag() != AudioHalCapCriterionV2::forceConfigForUse) {
@@ -585,7 +584,9 @@
} else {
auto forceUseCriterion =
criterion.value().get<AudioHalCapCriterionV2::forceConfigForUse>();
- EXPECT_TRUE(forceUseCriterionUseSet.insert(forceUseCriterion.forceUse).second);
+ ASSERT_FALSE(forceUseCriterion.values.empty());
+ EXPECT_TRUE(forceUseCriterionUseSet.insert(forceUseCriterion.values[0].getTag())
+ .second);
}
EXPECT_NO_FATAL_FAILURE(ValidateAudioHalCapCriterion(criterion.value()));
}
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 0c201cc..6e8d410 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -20,6 +20,8 @@
#define LOG_TAG "VtsHalDynamicsProcessingTest"
#include <android-base/logging.h>
+#include <audio_utils/power.h>
+#include <audio_utils/primitives.h>
#include <Utils.h>
@@ -44,26 +46,25 @@
class DynamicsProcessingTestHelper : public EffectHelper {
public:
DynamicsProcessingTestHelper(std::pair<std::shared_ptr<IFactory>, Descriptor> pair,
- int32_t channelLayOut = AudioChannelLayout::LAYOUT_STEREO) {
+ int32_t channelLayOut = AudioChannelLayout::LAYOUT_STEREO)
+ : mChannelLayout(channelLayOut),
+ mChannelCount(::aidl::android::hardware::audio::common::getChannelCount(
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout))) {
std::tie(mFactory, mDescriptor) = pair;
- mChannelLayout = channelLayOut;
- mChannelCount = ::aidl::android::hardware::audio::common::getChannelCount(
- AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout));
}
// setup
void SetUpDynamicsProcessingEffect() {
ASSERT_NE(nullptr, mFactory);
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
-
Parameter::Specific specific = getDefaultParamSpecific();
Parameter::Common common = createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- 0x100 /* iFrameCount */, 0x100 /* oFrameCount */,
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, kFrameCount /* iFrameCount */,
+ kFrameCount /* oFrameCount */,
AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout),
AudioChannelLayout::make<AudioChannelLayout::layoutMask>(mChannelLayout));
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
ASSERT_NE(nullptr, mEffect);
mEngineConfigApplied = mEngineConfigPreset;
}
@@ -113,6 +114,8 @@
// get set params and validate
void SetAndGetDynamicsProcessingParameters();
+ bool isAllParamsValid();
+
// enqueue test parameters
void addEngineConfig(const DynamicsProcessing::EngineArchitecture& cfg);
void addPreEqChannelConfig(const std::vector<DynamicsProcessing::ChannelConfig>& cfg);
@@ -126,9 +129,12 @@
static constexpr float kPreferredProcessingDurationMs = 10.0f;
static constexpr int kBandCount = 5;
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kFrameCount = 2048;
std::shared_ptr<IFactory> mFactory;
std::shared_ptr<IEffect> mEffect;
Descriptor mDescriptor;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
DynamicsProcessing::EngineArchitecture mEngineConfigApplied;
DynamicsProcessing::EngineArchitecture mEngineConfigPreset{
.resolutionPreference =
@@ -148,12 +154,12 @@
static const std::set<DynamicsProcessing::StageEnablement> kStageEnablementTestSet;
static const std::set<std::vector<DynamicsProcessing::InputGain>> kInputGainTestSet;
- protected:
- int mChannelCount;
-
private:
- int32_t mChannelLayout;
+ const int32_t mChannelLayout;
std::vector<std::pair<DynamicsProcessing::Tag, DynamicsProcessing>> mTags;
+
+ protected:
+ const int mChannelCount;
void CleanUp() {
mTags.clear();
mPreEqChannelEnable.clear();
@@ -329,10 +335,7 @@
}
void DynamicsProcessingTestHelper::SetAndGetDynamicsProcessingParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& dp = it.second;
-
+ for (const auto& [tag, dp] : mTags) {
// validate parameter
Descriptor desc;
ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
@@ -371,6 +374,22 @@
}
}
+bool DynamicsProcessingTestHelper::isAllParamsValid() {
+ if (mTags.empty()) {
+ return false;
+ }
+ for (const auto& [tag, dp] : mTags) {
+ // validate parameter
+ if (!isParamInRange(dp, mDescriptor.capability.range.get<Range::dynamicsProcessing>())) {
+ return false;
+ }
+ if (!isParamValid(tag, dp)) {
+ return false;
+ }
+ }
+ return true;
+}
+
void DynamicsProcessingTestHelper::addEngineConfig(
const DynamicsProcessing::EngineArchitecture& cfg) {
DynamicsProcessing dp;
@@ -446,6 +465,21 @@
mTags.push_back({DynamicsProcessing::inputGain, dp});
}
+void fillLimiterConfig(std::vector<DynamicsProcessing::LimiterConfig>& limiterConfigList,
+ int channelIndex, bool enable, int linkGroup, float attackTime,
+ float releaseTime, float ratio, float threshold, float postGain) {
+ DynamicsProcessing::LimiterConfig cfg;
+ cfg.channel = channelIndex;
+ cfg.enable = enable;
+ cfg.linkGroup = linkGroup;
+ cfg.attackTimeMs = attackTime;
+ cfg.releaseTimeMs = releaseTime;
+ cfg.ratio = ratio;
+ cfg.thresholdDb = threshold;
+ cfg.postGainDb = postGain;
+ limiterConfigList.push_back(cfg);
+}
+
/**
* Test DynamicsProcessing Engine Configuration
*/
@@ -486,7 +520,7 @@
TEST_P(DynamicsProcessingTestEngineArchitecture, SetAndGetEngineArch) {
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mCfg));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
INSTANTIATE_TEST_SUITE_P(
@@ -527,7 +561,7 @@
public:
DynamicsProcessingTestInputGain()
: DynamicsProcessingTestHelper(std::get<INPUT_GAIN_INSTANCE_NAME>(GetParam())),
- mInputGain(std::get<INPUT_GAIN_PARAM>(GetParam())){};
+ mInputGain(std::get<INPUT_GAIN_PARAM>(GetParam())) {};
void SetUp() override { SetUpDynamicsProcessingEffect(); }
@@ -538,7 +572,7 @@
TEST_P(DynamicsProcessingTestInputGain, SetAndGetInputGain) {
EXPECT_NO_FATAL_FAILURE(addInputGain(mInputGain));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
INSTANTIATE_TEST_SUITE_P(
@@ -565,40 +599,23 @@
enum LimiterConfigTestParamName {
LIMITER_INSTANCE_NAME,
LIMITER_CHANNEL,
- LIMITER_ENABLE,
LIMITER_LINK_GROUP,
- LIMITER_ADDITIONAL,
-};
-enum LimiterConfigTestAdditionalParam {
LIMITER_ATTACK_TIME,
LIMITER_RELEASE_TIME,
LIMITER_RATIO,
LIMITER_THRESHOLD,
LIMITER_POST_GAIN,
- LIMITER_MAX_NUM,
};
-using LimiterConfigTestAdditional = std::array<float, LIMITER_MAX_NUM>;
-// attackTime, releaseTime, ratio, thresh, postGain
-static constexpr std::array<LimiterConfigTestAdditional, 4> kLimiterConfigTestAdditionalParam = {
- {{-1, -60, -2.5, -2, -3.14},
- {-1, 60, -2.5, 2, -3.14},
- {1, -60, 2.5, -2, 3.14},
- {1, 60, 2.5, -2, 3.14}}};
using LimiterConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
- int32_t, bool, int32_t, LimiterConfigTestAdditional>;
+ int32_t, int32_t, float, float, float, float, float>;
-void fillLimiterConfig(DynamicsProcessing::LimiterConfig& cfg,
+void fillLimiterConfig(std::vector<DynamicsProcessing::LimiterConfig>& cfg,
const LimiterConfigTestParams& params) {
- const std::array<float, LIMITER_MAX_NUM> additional = std::get<LIMITER_ADDITIONAL>(params);
- cfg.channel = std::get<LIMITER_CHANNEL>(params);
- cfg.enable = std::get<LIMITER_ENABLE>(params);
- cfg.linkGroup = std::get<LIMITER_LINK_GROUP>(params);
- cfg.attackTimeMs = additional[LIMITER_ATTACK_TIME];
- cfg.releaseTimeMs = additional[LIMITER_RELEASE_TIME];
- cfg.ratio = additional[LIMITER_RATIO];
- cfg.thresholdDb = additional[LIMITER_THRESHOLD];
- cfg.postGainDb = additional[LIMITER_POST_GAIN];
+ fillLimiterConfig(cfg, std::get<LIMITER_CHANNEL>(params), true,
+ std::get<LIMITER_LINK_GROUP>(params), std::get<LIMITER_ATTACK_TIME>(params),
+ std::get<LIMITER_RELEASE_TIME>(params), std::get<LIMITER_RATIO>(params),
+ std::get<LIMITER_THRESHOLD>(params), std::get<LIMITER_POST_GAIN>(params));
}
class DynamicsProcessingTestLimiterConfig
@@ -607,7 +624,7 @@
public:
DynamicsProcessingTestLimiterConfig()
: DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())) {
- fillLimiterConfig(mCfg, GetParam());
+ fillLimiterConfig(mLimiterConfigList, GetParam());
}
void SetUp() override { SetUpDynamicsProcessingEffect(); }
@@ -615,36 +632,194 @@
void TearDown() override { TearDownDynamicsProcessingEffect(); }
DynamicsProcessing::LimiterConfig mCfg;
+ std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
};
TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addLimiterConfig({mCfg}));
- SetAndGetDynamicsProcessingParameters();
+ EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
- testing::Values(-1, 0, 1, 2), // channel count
- testing::Bool(), // enable
- testing::Values(3), // link group
- testing::ValuesIn(kLimiterConfigTestAdditionalParam)), // Additional
+ testing::Values(-1, 0, 1, 2), // channel index
+ testing::Values(3), // link group
+ testing::Values(-1, 1), // attackTime
+ testing::Values(-60, 60), // releaseTime
+ testing::Values(-2.5, 2.5), // ratio
+ testing::Values(-2, 2), // thresh
+ testing::Values(-3.14, 3.14) // postGain
+ ),
[](const auto& info) {
auto descriptor = std::get<LIMITER_INSTANCE_NAME>(info.param).second;
- DynamicsProcessing::LimiterConfig cfg;
+ std::vector<DynamicsProcessing::LimiterConfig> cfg;
fillLimiterConfig(cfg, info.param);
- std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
- descriptor.common.name + "_UUID_" +
- toString(descriptor.common.id.uuid) + "_limiterConfig_" +
- cfg.toString();
+ std::string name =
+ "Implementer_" + getPrefix(descriptor) + "_limiterConfig_" + cfg[0].toString();
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
});
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingTestLimiterConfig);
+using LimiterConfigDataTestParams = std::pair<std::shared_ptr<IFactory>, Descriptor>;
+
+class DynamicsProcessingLimiterConfigDataTest
+ : public ::testing::TestWithParam<LimiterConfigDataTestParams>,
+ public DynamicsProcessingTestHelper {
+ public:
+ DynamicsProcessingLimiterConfigDataTest()
+ : DynamicsProcessingTestHelper(GetParam(), AudioChannelLayout::LAYOUT_MONO) {
+ mBufferSize = kFrameCount * mChannelCount;
+ mInput.resize(mBufferSize);
+ generateSineWave(1000 /*Input Frequency*/, mInput);
+ mInputDb = calculateDb(mInput);
+ }
+
+ void SetUp() override {
+ SetUpDynamicsProcessingEffect();
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ }
+
+ void TearDown() override { TearDownDynamicsProcessingEffect(); }
+
+ float calculateDb(std::vector<float> input, size_t start = 0) {
+ return audio_utils_compute_power_mono(input.data() + start, AUDIO_FORMAT_PCM_FLOAT,
+ input.size() - start);
+ }
+
+ void computeThreshold(float ratio, float outputDb, float& threshold) {
+ EXPECT_NE(ratio, 0);
+ threshold = (mInputDb - (ratio * outputDb)) / (1 - ratio);
+ }
+
+ void computeRatio(float threshold, float outputDb, float& ratio) {
+ float inputOverThreshold = mInputDb - threshold;
+ float outputOverThreshold = outputDb - threshold;
+ EXPECT_NE(outputOverThreshold, 0);
+ ratio = inputOverThreshold / outputOverThreshold;
+ }
+
+ void setParamsAndProcess(std::vector<float>& output) {
+ EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
+ EXPECT_NO_FATAL_FAILURE(addLimiterConfig(mLimiterConfigList));
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
+ if (isAllParamsValid()) {
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+ EXPECT_GT(output.size(), kStartIndex);
+ }
+ cleanUpLimiterConfig();
+ }
+
+ void cleanUpLimiterConfig() {
+ CleanUp();
+ mLimiterConfigList.clear();
+ }
+ static constexpr float kDefaultLinkerGroup = 3;
+ static constexpr float kDefaultAttackTime = 0;
+ static constexpr float kDefaultReleaseTime = 0;
+ static constexpr float kDefaultRatio = 4;
+ static constexpr float kDefaultThreshold = 0;
+ static constexpr float kDefaultPostGain = 0;
+ static constexpr int kInputFrequency = 1000;
+ static constexpr size_t kStartIndex = 15 * kSamplingFrequency / 1000; // skip 15ms
+ std::vector<DynamicsProcessing::LimiterConfig> mLimiterConfigList;
+ std::vector<float> mInput;
+ float mInputDb;
+ int mBufferSize;
+};
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, IncreasingThresholdDb) {
+ std::vector<float> thresholdValues = {-200, -150, -100, -50, -5, 0};
+ std::vector<float> output(mInput.size());
+ float previousThreshold = -FLT_MAX;
+ for (float threshold : thresholdValues) {
+ for (int i = 0; i < mChannelCount; i++) {
+ fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
+ kDefaultReleaseTime, kDefaultRatio, threshold, kDefaultPostGain);
+ }
+ EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+ if (!isAllParamsValid()) {
+ continue;
+ }
+ float outputDb = calculateDb(output, kStartIndex);
+ if (threshold >= mInputDb || kDefaultRatio == 1) {
+ EXPECT_EQ(std::round(mInputDb), std::round(outputDb));
+ } else {
+ float calculatedThreshold = 0;
+ EXPECT_NO_FATAL_FAILURE(computeThreshold(kDefaultRatio, outputDb, calculatedThreshold));
+ ASSERT_GT(calculatedThreshold, previousThreshold);
+ previousThreshold = calculatedThreshold;
+ }
+ }
+}
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, IncreasingRatio) {
+ std::vector<float> ratioValues = {1, 10, 20, 30, 40, 50};
+ std::vector<float> output(mInput.size());
+ float threshold = -10;
+ float previousRatio = 0;
+ for (float ratio : ratioValues) {
+ for (int i = 0; i < mChannelCount; i++) {
+ fillLimiterConfig(mLimiterConfigList, i, true, kDefaultLinkerGroup, kDefaultAttackTime,
+ kDefaultReleaseTime, ratio, threshold, kDefaultPostGain);
+ }
+ EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+ if (!isAllParamsValid()) {
+ continue;
+ }
+ float outputDb = calculateDb(output, kStartIndex);
+
+ if (threshold >= mInputDb) {
+ EXPECT_EQ(std::round(mInputDb), std::round(outputDb));
+ } else {
+ float calculatedRatio = 0;
+ EXPECT_NO_FATAL_FAILURE(computeRatio(threshold, outputDb, calculatedRatio));
+ ASSERT_GT(calculatedRatio, previousRatio);
+ previousRatio = calculatedRatio;
+ }
+ }
+}
+
+TEST_P(DynamicsProcessingLimiterConfigDataTest, LimiterEnableDisable) {
+ std::vector<bool> limiterEnableValues = {false, true};
+ std::vector<float> output(mInput.size());
+ for (bool isEnabled : limiterEnableValues) {
+ for (int i = 0; i < mChannelCount; i++) {
+ // Set non-default values
+ fillLimiterConfig(mLimiterConfigList, i, isEnabled, kDefaultLinkerGroup,
+ 5 /*attack time*/, 5 /*release time*/, 10 /*ratio*/,
+ -10 /*threshold*/, 5 /*postgain*/);
+ }
+ EXPECT_NO_FATAL_FAILURE(setParamsAndProcess(output));
+ if (!isAllParamsValid()) {
+ continue;
+ }
+ if (isEnabled) {
+ EXPECT_NE(mInputDb, calculateDb(output, kStartIndex));
+ } else {
+ EXPECT_NEAR(mInputDb, calculateDb(output, kStartIndex), 0.05);
+ }
+ }
+}
+
+INSTANTIATE_TEST_SUITE_P(DynamicsProcessingTest, DynamicsProcessingLimiterConfigDataTest,
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+ [](const auto& info) {
+ auto descriptor = info.param;
+ std::string name = getPrefix(descriptor.second);
+ std::replace_if(
+ name.begin(), name.end(),
+ [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingLimiterConfigDataTest);
+
/**
* Test DynamicsProcessing ChannelConfig
*/
@@ -673,19 +848,19 @@
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
INSTANTIATE_TEST_SUITE_P(
@@ -715,12 +890,11 @@
enum EqBandConfigTestParamName {
EQ_BAND_INSTANCE_NAME,
EQ_BAND_CHANNEL,
- EQ_BAND_ENABLE,
EQ_BAND_CUT_OFF_FREQ,
EQ_BAND_GAIN
};
using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
- bool, std::vector<std::pair<int, float>>, float>;
+ std::vector<std::pair<int, float>>, float>;
void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
const EqBandConfigTestParams& params) {
@@ -730,7 +904,7 @@
for (int i = 0; i < bandCount; i++) {
cfgs[i].channel = std::get<EQ_BAND_CHANNEL>(params);
cfgs[i].band = cutOffFreqs[i].first;
- cfgs[i].enable = std::get<EQ_BAND_ENABLE>(params);
+ cfgs[i].enable = true /*Eqband Enable*/;
cfgs[i].cutoffFrequencyHz = cutOffFreqs[i].second;
cfgs[i].gainDb = std::get<EQ_BAND_GAIN>(params);
}
@@ -761,7 +935,7 @@
}
EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addPreEqBandConfigs(mCfgs));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
@@ -774,7 +948,7 @@
}
EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addPostEqBandConfigs(mCfgs));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
std::vector<std::vector<std::pair<int, float>>> kBands{
@@ -825,9 +999,8 @@
DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
- testing::Values(-1, 0, 10), // channel ID
- testing::Bool(), // band enable
- testing::ValuesIn(kBands), // cut off frequencies
+ testing::Values(-1, 0, 10), // channel index
+ testing::ValuesIn(kBands), // band index, cut off frequencies
testing::Values(-3.14f, 3.14f) // gain
),
[](const auto& info) {
@@ -851,7 +1024,6 @@
enum MbcBandConfigParamName {
MBC_BAND_INSTANCE_NAME,
MBC_BAND_CHANNEL,
- MBC_BAND_ENABLE,
MBC_BAND_CUTOFF_FREQ,
MBC_BAND_ADDITIONAL
};
@@ -877,7 +1049,7 @@
{3, 10, 2, -2, -5, 90, 2.5, 2, 2}}};
using TestParamsMbcBandConfig =
- std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
+ std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
std::vector<std::pair<int, float>>, TestParamsMbcBandConfigAdditional>;
void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
@@ -890,7 +1062,7 @@
cfgs[i] = DynamicsProcessing::MbcBandConfig{
.channel = std::get<MBC_BAND_CHANNEL>(params),
.band = cutOffFreqs[i].first,
- .enable = std::get<MBC_BAND_ENABLE>(params),
+ .enable = true /*Mbc Band Enable*/,
.cutoffFrequencyHz = cutOffFreqs[i].second,
.attackTimeMs = additional[MBC_ADD_ATTACK_TIME],
.releaseTimeMs = additional[MBC_ADD_RELEASE_TIME],
@@ -930,16 +1102,15 @@
}
EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addMbcBandConfigs(mCfgs));
- SetAndGetDynamicsProcessingParameters();
+ ASSERT_NO_FATAL_FAILURE(SetAndGetDynamicsProcessingParameters());
}
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestMbcBandConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
- testing::Values(-1, 0, 10), // channel count
- testing::Bool(), // enable
- testing::ValuesIn(kBands), // cut off frequencies
+ testing::Values(-1, 0, 10), // channel index
+ testing::ValuesIn(kBands), // band index, cut off frequencies
testing::ValuesIn(kMbcBandConfigAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
diff --git a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
index a0e43bc..a942521 100644
--- a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
@@ -19,6 +19,7 @@
#define LOG_TAG "VtsHalVisualizerTest"
#include <android-base/logging.h>
#include <android/binder_enums.h>
+#include <audio_utils/power.h>
#include "EffectHelper.h"
@@ -44,9 +45,8 @@
PARAM_MEASUREMENT_MODE,
PARAM_LATENCY,
};
-using VisualizerParamTestParam =
- std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int, Visualizer::ScalingMode,
- Visualizer::MeasurementMode, int>;
+using VisualizerTestParam = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int,
+ Visualizer::ScalingMode, Visualizer::MeasurementMode, int>;
class VisualizerTestHelper : public EffectHelper {
public:
@@ -139,10 +139,15 @@
{Visualizer::latencyMs, Visualizer::make<Visualizer::latencyMs>(latency)});
}
+ static std::unordered_set<Visualizer::ScalingMode> getScalingModeValues() {
+ return {ndk::enum_range<Visualizer::ScalingMode>().begin(),
+ ndk::enum_range<Visualizer::ScalingMode>().end()};
+ }
+
static constexpr long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
const size_t mChannelCount =
getChannelCount(AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
- AudioChannelLayout::LAYOUT_STEREO));
+ AudioChannelLayout::LAYOUT_MONO));
const size_t mBufferSizeInFrames = kInputFrameCount * mChannelCount;
const int mCaptureSize;
const int mLatency;
@@ -161,7 +166,7 @@
void CleanUp() { mCommonTags.clear(); }
};
-class VisualizerParamTest : public ::testing::TestWithParam<VisualizerParamTestParam>,
+class VisualizerParamTest : public ::testing::TestWithParam<VisualizerTestParam>,
public VisualizerTestHelper {
public:
VisualizerParamTest()
@@ -181,11 +186,6 @@
return {ndk::enum_range<Visualizer::MeasurementMode>().begin(),
ndk::enum_range<Visualizer::MeasurementMode>().end()};
}
-
- static std::unordered_set<Visualizer::ScalingMode> getScalingModeValues() {
- return {ndk::enum_range<Visualizer::ScalingMode>().begin(),
- ndk::enum_range<Visualizer::ScalingMode>().end()};
- }
};
TEST_P(VisualizerParamTest, SetAndGetCaptureSize) {
@@ -237,6 +237,82 @@
}
}
+class VisualizerDataTest : public ::testing::TestWithParam<VisualizerTestParam>,
+ public VisualizerTestHelper {
+ public:
+ VisualizerDataTest()
+ : VisualizerTestHelper(std::get<PARAM_INSTANCE_NAME>(GetParam()),
+ std::get<PARAM_CAPTURE_SIZE>(GetParam()),
+ std::get<PARAM_LATENCY>(GetParam()),
+ std::get<PARAM_SCALING_MODE>(GetParam()),
+ std::get<PARAM_MEASUREMENT_MODE>(GetParam())) {}
+
+ void SetUp() override { SetUpVisualizer(); }
+
+ void TearDown() override { TearDownVisualizer(); }
+};
+
+TEST_P(VisualizerDataTest, testScalingModeParameters) {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+
+ // This test holds true for the following range
+ static_assert(kMaxAudioSampleValue <= 1.0 && kMaxAudioSampleValue > 0.0,
+ "Valid range of kMaxAudioSample value for the test: (0.0, 1.0]");
+
+ constexpr float kPowerToleranceDb = 0.5;
+
+ generateSineWave(std::vector<int>{1000}, mInputBuffer, 1.0, mBufferSizeInFrames);
+ const float expectedPowerNormalized = audio_utils_compute_power_mono(
+ mInputBuffer.data(), AUDIO_FORMAT_PCM_FLOAT, mInputBuffer.size());
+
+ const std::vector<float> testMaxAudioSampleValueList = {
+ 0.25 * kMaxAudioSampleValue, 0.5 * kMaxAudioSampleValue, 0.75 * kMaxAudioSampleValue,
+ kMaxAudioSampleValue};
+
+ Parameter::Id idCsb;
+ Visualizer::Id vsIdCsb;
+ vsIdCsb.set<Visualizer::Id::commonTag>(Visualizer::captureSampleBuffer);
+ idCsb.set<Parameter::Id::visualizerTag>(vsIdCsb);
+
+ for (float maxAudioSampleValue : testMaxAudioSampleValueList) {
+ bool allParamsValid = true;
+ ASSERT_NO_FATAL_FAILURE(addCaptureSizeParam(mCaptureSize));
+ ASSERT_NO_FATAL_FAILURE(addScalingModeParam(mScalingMode));
+ ASSERT_NO_FATAL_FAILURE(addLatencyParam(mLatency));
+ ASSERT_NO_FATAL_FAILURE(SetAndGetParameters(&allParamsValid));
+
+ generateSineWave(std::vector<int>{1000}, mInputBuffer, maxAudioSampleValue,
+ mBufferSizeInFrames);
+
+ // The stop and reset calls to the effect are made towards the end in order to fetch the
+ // captureSampleBuffer values
+ ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput(mInputBuffer, mOutputBuffer, mEffect,
+ &mOpenEffectReturn, mVersion, 1, false));
+ if (allParamsValid) {
+ Parameter getParam;
+ EXPECT_STATUS(EX_NONE, mEffect->getParameter(idCsb, &getParam))
+ << " with: " << idCsb.toString();
+ std::vector<uint8_t> captureBuffer = getParam.get<Parameter::specific>()
+ .get<Parameter::Specific::visualizer>()
+ .get<Visualizer::captureSampleBuffer>();
+ ASSERT_EQ((size_t)mCaptureSize, captureBuffer.size());
+
+ float currPowerCsb = audio_utils_compute_power_mono(
+ captureBuffer.data(), AUDIO_FORMAT_PCM_8_BIT, mCaptureSize);
+
+ if (mScalingMode == Visualizer::ScalingMode::NORMALIZED) {
+ EXPECT_NEAR(currPowerCsb, expectedPowerNormalized, kPowerToleranceDb);
+ } else {
+ float powerI = audio_utils_compute_power_mono(
+ mInputBuffer.data(), AUDIO_FORMAT_PCM_FLOAT, mInputBuffer.size());
+ EXPECT_NEAR(currPowerCsb, powerI, kPowerToleranceDb);
+ }
+ }
+ ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
+ ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::RESET));
+ }
+}
+
std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kDescPair;
INSTANTIATE_TEST_SUITE_P(
VisualizerParamTest, VisualizerParamTest,
@@ -246,7 +322,7 @@
testing::ValuesIn(EffectHelper::getTestValueSet<Visualizer, int, Range::visualizer,
Visualizer::captureSamples>(
kDescPair, EffectHelper::expandTestValueBasic<int>)),
- testing::ValuesIn(VisualizerParamTest::getScalingModeValues()),
+ testing::ValuesIn(VisualizerTestHelper::getScalingModeValues()),
testing::ValuesIn(VisualizerParamTest::getMeasurementModeValues()),
testing::ValuesIn(EffectHelper::getTestValueSet<Visualizer, int, Range::visualizer,
Visualizer::latencyMs>(
@@ -270,6 +346,35 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VisualizerParamTest);
+INSTANTIATE_TEST_SUITE_P(
+ VisualizerDataTest, VisualizerDataTest,
+ ::testing::Combine(
+ testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidVisualizer())),
+ testing::Values(128), // captureSize
+ testing::ValuesIn(VisualizerTestHelper::getScalingModeValues()),
+ testing::Values(Visualizer::MeasurementMode::PEAK_RMS),
+ testing::Values(0) // latency
+ ),
+ [](const testing::TestParamInfo<VisualizerDataTest::ParamType>& info) {
+ auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
+ std::string captureSize = std::to_string(std::get<PARAM_CAPTURE_SIZE>(info.param));
+ std::string scalingMode = aidl::android::hardware::audio::effect::toString(
+ std::get<PARAM_SCALING_MODE>(info.param));
+ std::string measurementMode = aidl::android::hardware::audio::effect::toString(
+ std::get<PARAM_MEASUREMENT_MODE>(info.param));
+ std::string latency = std::to_string(std::get<PARAM_LATENCY>(info.param));
+
+ std::string name = getPrefix(descriptor) + "_captureSize" + captureSize +
+ "_scalingMode" + scalingMode + "_measurementMode" + measurementMode +
+ "_latency" + latency;
+ std::replace_if(
+ name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VisualizerDataTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/authsecret/1.0/vts/functional/Android.bp b/authsecret/1.0/vts/functional/Android.bp
index 853b4dd..388cf3c 100644
--- a/authsecret/1.0/vts/functional/Android.bp
+++ b/authsecret/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/authsecret/aidl/vts/Android.bp b/authsecret/aidl/vts/Android.bp
index 5ec9947..bde1a40 100644
--- a/authsecret/aidl/vts/Android.bp
+++ b/authsecret/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp
index 9f5ab97..c990e25 100644
--- a/automotive/evs/aidl/Android.bp
+++ b/automotive/evs/aidl/Android.bp
@@ -52,14 +52,14 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp b/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp
index ac1e3b1..6d994bb 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/fuzzer.cpp
@@ -25,6 +25,8 @@
using ::ndk::SharedRefBase;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // TODO(b/183141167): need to rewrite 'dump' to avoid SIGPIPE.
+ signal(SIGPIPE, SIG_IGN);
std::unique_ptr<FakeVehicleHardware> hardware = std::make_unique<FakeVehicleHardware>();
std::shared_ptr<DefaultVehicleHal> vhal =
::ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware));
diff --git a/bluetooth/1.0/vts/functional/Android.bp b/bluetooth/1.0/vts/functional/Android.bp
index 7d76b89..e68df09 100644
--- a/bluetooth/1.0/vts/functional/Android.bp
+++ b/bluetooth/1.0/vts/functional/Android.bp
@@ -30,7 +30,6 @@
srcs: ["VtsHalBluetoothV1_0TargetTest.cpp"],
static_libs: [
"android.hardware.bluetooth@1.0",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothV1_0TargetTest.xml",
test_suites: [
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 82dda61..d0edfad 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -20,7 +20,6 @@
#include <android/hardware/bluetooth/1.0/IBluetoothHci.h>
#include <android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.h>
#include <android/hardware/bluetooth/1.0/types.h>
-#include <hardware/bluetooth.h>
#include <utils/Log.h>
#include <VtsHalHidlTargetCallbackBase.h>
diff --git a/bluetooth/1.1/vts/functional/Android.bp b/bluetooth/1.1/vts/functional/Android.bp
index 6b3a3e7..27d50f5 100644
--- a/bluetooth/1.1/vts/functional/Android.bp
+++ b/bluetooth/1.1/vts/functional/Android.bp
@@ -31,7 +31,6 @@
static_libs: [
"android.hardware.bluetooth@1.1",
"android.hardware.bluetooth@1.0",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothV1_1TargetTest.xml",
test_suites: ["general-tests", "vts"],
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 687765f..37b41c6 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -20,7 +20,6 @@
#include <android/hardware/bluetooth/1.0/types.h>
#include <android/hardware/bluetooth/1.1/IBluetoothHci.h>
#include <android/hardware/bluetooth/1.1/IBluetoothHciCallbacks.h>
-#include <hardware/bluetooth.h>
#include <utils/Log.h>
#include <VtsHalHidlTargetCallbackBase.h>
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index 58710ef..2872362 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -38,6 +38,7 @@
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
int channelCountPerStream;
android.hardware.bluetooth.audio.BroadcastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ @nullable android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation audioLocation;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
index 60c276b..93c3d8c 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
@@ -59,8 +59,10 @@
int bitmask;
const int US7500 = 0x01;
const int US10000 = 0x02;
+ const int US20000 = 0x04;
const int US7500PREFERRED = 0x10;
const int US10000PREFERRED = 0x20;
+ const int US20000PREFERRED = 0x40;
}
parcelable SupportedAudioChannelCounts {
int bitmask;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
index 943d396..97fcd1f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
@@ -59,6 +59,7 @@
enum FrameDuration {
US7500 = 0x00,
US10000 = 0x01,
+ US20000 = 0x02,
}
parcelable AudioChannelAllocation {
int bitmask;
@@ -91,6 +92,7 @@
const int FRONT_RIGHT_WIDE = 0x02000000;
const int LEFT_SURROUND = 0x04000000;
const int RIGHT_SURROUND = 0x08000000;
+ const int MONO = 0x00000000;
}
parcelable OctetsPerCodecFrame {
int value;
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
index 031ee67..0613f6c 100644
--- 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
@@ -37,6 +37,7 @@
android.hardware.bluetooth.audio.Lc3Configuration lc3Config;
android.hardware.bluetooth.audio.LeAudioCodecConfiguration.VendorConfiguration vendorConfig;
android.hardware.bluetooth.audio.AptxAdaptiveLeConfiguration aptxAdaptiveLeConfig;
+ android.hardware.bluetooth.audio.OpusConfiguration opusConfig;
@VintfStability
parcelable VendorConfiguration {
ParcelableHolder extension;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
index 894a2f3..6ed0e56 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -39,6 +39,7 @@
int deviceCount;
int channelCountPerDevice;
android.hardware.bluetooth.audio.UnicastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ @nullable android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation audioLocation;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
@@ -48,5 +49,6 @@
android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
android.hardware.bluetooth.audio.UnicastCapability.VendorCapabilities vendorCapabillities;
android.hardware.bluetooth.audio.AptxAdaptiveLeCapabilities aptxAdaptiveLeCapabilities;
+ android.hardware.bluetooth.audio.OpusCapabilities opusCapabilities;
}
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index f1301fb..db3c10e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -17,6 +17,7 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.AudioLocation;
+import android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
@@ -35,8 +36,11 @@
@nullable VendorCapabilities[] vendorCapabillities;
}
CodecType codecType;
+ // @deprecated use audioLocation if present.
AudioLocation supportedChannel;
// Supported channel count for each stream
int channelCountPerStream;
LeAudioCodecCapabilities leAudioCodecCapabilities;
+ // The new audio location type, replacing supportedChannel
+ @nullable AudioChannelAllocation audioLocation;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
index fa302e3..94f0544 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificCapabilitiesLtv.aidl
@@ -50,9 +50,11 @@
parcelable SupportedFrameDurations {
const int US7500 = 0x01;
const int US10000 = 0x02;
+ const int US20000 = 0x04;
/* Bits 2-3 are RFU */
const int US7500PREFERRED = 0x10;
const int US10000PREFERRED = 0x20;
+ const int US20000PREFERRED = 0x40;
/* 8 bit wide bit mask */
int bitmask;
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
index c099ebe..2835325 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
@@ -43,9 +43,11 @@
enum FrameDuration {
US7500 = 0x00,
US10000 = 0x01,
+ US20000 = 0x02,
}
parcelable AudioChannelAllocation {
+ // @deprecated use MONO instead.
const int NOT_ALLOWED = 0x00000000;
const int FRONT_LEFT = 0x00000001;
const int FRONT_RIGHT = 0x00000002;
@@ -75,6 +77,7 @@
const int FRONT_RIGHT_WIDE = 0x02000000;
const int LEFT_SURROUND = 0x04000000;
const int RIGHT_SURROUND = 0x08000000;
+ const int MONO = 0x00000000;
// Bit mask of Audio Locations
int bitmask;
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl
index 7ce6ff3..20e6c0c 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecConfiguration.aidl
@@ -16,8 +16,9 @@
package android.hardware.bluetooth.audio;
-import android.hardware.bluetooth.audio.Lc3Configuration;
import android.hardware.bluetooth.audio.AptxAdaptiveLeConfiguration;
+import android.hardware.bluetooth.audio.Lc3Configuration;
+import android.hardware.bluetooth.audio.OpusConfiguration;
@VintfStability
union LeAudioCodecConfiguration {
@@ -28,4 +29,5 @@
Lc3Configuration lc3Config;
VendorConfiguration vendorConfig;
AptxAdaptiveLeConfiguration aptxAdaptiveLeConfig;
+ OpusConfiguration opusConfig;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
index 07688a7..9f33672 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -16,10 +16,12 @@
package android.hardware.bluetooth.audio;
+import android.hardware.bluetooth.audio.AptxAdaptiveLeCapabilities;
import android.hardware.bluetooth.audio.AudioLocation;
+import android.hardware.bluetooth.audio.CodecSpecificConfigurationLtv.AudioChannelAllocation;
import android.hardware.bluetooth.audio.CodecType;
import android.hardware.bluetooth.audio.Lc3Capabilities;
-import android.hardware.bluetooth.audio.AptxAdaptiveLeCapabilities;
+import android.hardware.bluetooth.audio.OpusCapabilities;
/**
* Used to specify the le audio unicast codec capabilities for hardware offload.
@@ -35,12 +37,16 @@
Lc3Capabilities lc3Capabilities;
VendorCapabilities vendorCapabillities;
AptxAdaptiveLeCapabilities aptxAdaptiveLeCapabilities;
+ OpusCapabilities opusCapabilities;
}
CodecType codecType;
+ // @deprecated use audioLocation if present.
AudioLocation supportedChannel;
// The number of connected device
int deviceCount;
// Supported channel count for each device
int channelCountPerDevice;
LeAudioCodecCapabilities leAudioCodecCapabilities;
+ // The new audio location type, replacing supportedChannel
+ @nullable AudioChannelAllocation audioLocation;
}
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
index 61c29d3..18fc4b2 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
@@ -82,6 +82,8 @@
CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US7500},
{CodecSpecificConfigurationLtv::FrameDuration::US10000,
CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US10000},
+ {CodecSpecificConfigurationLtv::FrameDuration::US20000,
+ CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US20000},
};
std::map<int32_t, CodecSpecificConfigurationLtv::SamplingFrequency>
@@ -532,7 +534,8 @@
direction_configurations,
const std::vector<std::optional<AseDirectionRequirement>>& requirements,
std::optional<std::vector<std::optional<AseDirectionConfiguration>>>&
- valid_direction_configurations) {
+ valid_direction_configurations,
+ bool isExact) {
if (!direction_configurations.has_value()) return;
if (!valid_direction_configurations.has_value()) {
@@ -540,55 +543,93 @@
std::vector<std::optional<AseDirectionConfiguration>>();
}
- // Exact matching process
- // Need to respect the number of device
- for (int i = 0; i < requirements.size(); ++i) {
- auto requirement = requirements[i];
- auto direction_configuration = direction_configurations.value()[i];
- if (!direction_configuration.has_value()) {
- valid_direction_configurations = std::nullopt;
- return;
- }
- auto cfg = direction_configuration.value();
- if (!filterMatchedAseConfiguration(cfg.aseConfiguration,
- requirement.value().aseConfiguration)) {
- valid_direction_configurations = std::nullopt;
- return; // No way to match
- }
- // For exact match, we require this direction to have the same allocation.
- // If stereo, need stereo.
- // If mono, need mono (modified to the correct required allocation)
- auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
- requirement.value().aseConfiguration);
- int req_channel_count = getCountFromBitmask(req_allocation_bitmask);
- int cfg_bitmask =
- getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration);
- int cfg_channel_count = getCountFromBitmask(cfg_bitmask);
- if (req_channel_count <= 1) {
- // MONO case, is a match if also mono, modify to the same allocation
- if (cfg_channel_count > 1) {
+ if (isExact) {
+ // Exact matching process
+ // Need to respect the number of device
+ for (int i = 0; i < requirements.size(); ++i) {
+ auto requirement = requirements[i];
+ auto direction_configuration = direction_configurations.value()[i];
+ if (!direction_configuration.has_value()) {
valid_direction_configurations = std::nullopt;
- return; // Not a match
+ return;
}
- // Modify the bitmask to be the same as the requirement
- for (auto& codec_cfg : cfg.aseConfiguration.codecConfiguration) {
- if (codec_cfg.getTag() ==
- CodecSpecificConfigurationLtv::Tag::audioChannelAllocation) {
- codec_cfg
- .get<CodecSpecificConfigurationLtv::Tag::audioChannelAllocation>()
- .bitmask = req_allocation_bitmask;
- break;
+ auto cfg = direction_configuration.value();
+ if (!filterMatchedAseConfiguration(
+ cfg.aseConfiguration, requirement.value().aseConfiguration)) {
+ valid_direction_configurations = std::nullopt;
+ return; // No way to match
+ }
+ // For exact match, we require this direction to have the same allocation.
+ // If stereo, need stereo.
+ // If mono, need mono (modified to the correct required allocation)
+ auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
+ requirement.value().aseConfiguration);
+ int req_channel_count = getCountFromBitmask(req_allocation_bitmask);
+ int cfg_bitmask =
+ getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration);
+ int cfg_channel_count = getCountFromBitmask(cfg_bitmask);
+ if (req_channel_count <= 1) {
+ // MONO case, is a match if also mono, modify to the same allocation
+ if (cfg_channel_count > 1) {
+ valid_direction_configurations = std::nullopt;
+ return; // Not a match
+ }
+ // Modify the bitmask to be the same as the requirement
+ for (auto& codec_cfg : cfg.aseConfiguration.codecConfiguration) {
+ if (codec_cfg.getTag() ==
+ CodecSpecificConfigurationLtv::Tag::audioChannelAllocation) {
+ codec_cfg
+ .get<CodecSpecificConfigurationLtv::Tag::
+ audioChannelAllocation>()
+ .bitmask = req_allocation_bitmask;
+ break;
+ }
+ }
+ } else {
+ // STEREO case, is a match if same allocation
+ if (req_allocation_bitmask != cfg_bitmask) {
+ valid_direction_configurations = std::nullopt;
+ return; // Not a match
}
}
- } else {
- // STEREO case, is a match if same allocation
- if (req_allocation_bitmask != cfg_bitmask) {
+ // Push to list if valid
+ valid_direction_configurations.value().push_back(cfg);
+ }
+ } else {
+ // Loose matching process
+ for (auto& requirement : requirements) {
+ if (!requirement.has_value()) continue;
+ auto req_allocation_bitmask = getLeAudioAseConfigurationAllocationBitmask(
+ requirement.value().aseConfiguration);
+ auto req_channel_count = getCountFromBitmask(req_allocation_bitmask);
+
+ auto temp = std::vector<AseDirectionConfiguration>();
+
+ for (auto direction_configuration : direction_configurations.value()) {
+ if (!direction_configuration.has_value()) continue;
+ if (!filterMatchedAseConfiguration(
+ direction_configuration.value().aseConfiguration,
+ requirement.value().aseConfiguration))
+ continue;
+ // Valid if match any requirement.
+ temp.push_back(direction_configuration.value());
+ }
+
+ // Get the best matching config based on channel allocation
+ auto total_cfg_channel_count = 0;
+ auto req_valid_configs = getValidConfigurationsFromAllocation(
+ req_allocation_bitmask, temp, isExact);
+ // Count and check required channel counts
+ for (auto& cfg : req_valid_configs) {
+ total_cfg_channel_count += getCountFromBitmask(
+ getLeAudioAseConfigurationAllocationBitmask(cfg.aseConfiguration));
+ valid_direction_configurations.value().push_back(cfg);
+ }
+ if (total_cfg_channel_count != req_channel_count) {
valid_direction_configurations = std::nullopt;
- return; // Not a match
+ return;
}
}
- // Push to list if valid
- valid_direction_configurations.value().push_back(cfg);
}
}
@@ -648,8 +689,8 @@
std::optional<LeAudioAseConfigurationSetting>
LeAudioOffloadAudioProvider::getRequirementMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
- const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
- requirement) {
+ const IBluetoothAudioProvider::LeAudioConfigurationRequirement& requirement,
+ bool isExact) {
// Create a new LeAudioAseConfigurationSetting to return
// Make context the same as the requirement
LeAudioAseConfigurationSetting filtered_setting{
@@ -662,25 +703,27 @@
// is the number of device.
// The exact matching process is as follow:
- // 1. Setting direction has the same number of cfg (ignore when null require)
+ // 1. Setting direction has the same number of cfg (ignore when null
+ // require)
// 2. For each index, it's a 1-1 filter / mapping.
+ if (isExact) {
+ if (requirement.sinkAseRequirement.has_value() &&
+ requirement.sinkAseRequirement.value().size() !=
+ setting.sinkAseConfiguration.value().size()) {
+ return std::nullopt;
+ }
- if (requirement.sinkAseRequirement.has_value() &&
- requirement.sinkAseRequirement.value().size() !=
- setting.sinkAseConfiguration.value().size()) {
- return std::nullopt;
- }
-
- if (requirement.sourceAseRequirement.has_value() &&
- requirement.sourceAseRequirement.value().size() !=
- setting.sourceAseConfiguration.value().size()) {
- return std::nullopt;
+ if (requirement.sourceAseRequirement.has_value() &&
+ requirement.sourceAseRequirement.value().size() !=
+ setting.sourceAseConfiguration.value().size()) {
+ return std::nullopt;
+ }
}
if (requirement.sinkAseRequirement.has_value()) {
filterRequirementAseDirectionConfiguration(
setting.sinkAseConfiguration, requirement.sinkAseRequirement.value(),
- filtered_setting.sinkAseConfiguration);
+ filtered_setting.sinkAseConfiguration, isExact);
if (!filtered_setting.sinkAseConfiguration.has_value()) {
return std::nullopt;
}
@@ -690,7 +733,7 @@
filterRequirementAseDirectionConfiguration(
setting.sourceAseConfiguration,
requirement.sourceAseRequirement.value(),
- filtered_setting.sourceAseConfiguration);
+ filtered_setting.sourceAseConfiguration, isExact);
if (!filtered_setting.sourceAseConfiguration.has_value()) {
return std::nullopt;
}
@@ -704,9 +747,10 @@
std::vector<IBluetoothAudioProvider::LeAudioAseConfigurationSetting>&
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement& requirement,
- bool isMatchContext) {
+ bool isMatchContext, bool isExact) {
LOG(INFO) << __func__ << ": Trying to match for the requirement "
- << requirement.toString() << ", match context = " << isMatchContext;
+ << requirement.toString() << ", match context = " << isMatchContext
+ << ", match exact = " << isExact;
for (auto& setting : matched_ase_configuration_settings) {
// Try to match context in metadata.
if (isMatchContext) {
@@ -718,7 +762,8 @@
}
auto filtered_ase_configuration_setting =
- getRequirementMatchedAseConfigurationSettings(setting, requirement);
+ getRequirementMatchedAseConfigurationSettings(setting, requirement,
+ isExact);
if (filtered_ase_configuration_setting.has_value()) {
LOG(INFO) << __func__ << ": Result found: "
<< getSettingOutputString(
@@ -768,7 +813,7 @@
// A setting must match both source and sink.
// First filter all setting matched with sink capability
if (in_remoteSinkAudioCapabilities.has_value()) {
- for (auto& setting : ase_configuration_settings)
+ for (auto& setting : ase_configuration_settings) {
for (auto& capability : in_remoteSinkAudioCapabilities.value()) {
if (!capability.has_value()) continue;
auto filtered_ase_configuration_setting =
@@ -779,6 +824,7 @@
filtered_ase_configuration_setting.value());
}
}
+ }
} else {
sink_matched_ase_configuration_settings = ase_configuration_settings;
}
@@ -808,27 +854,30 @@
// Matching priority list:
// Preferred context - exact match with allocation
+ // Preferred context - loose match with allocation
// Any context - exact match with allocation
-
- auto matched_setting_with_context = matchWithRequirement(
- matched_ase_configuration_settings, requirement, true);
- if (matched_setting_with_context.has_value()) {
- result.push_back(matched_setting_with_context.value());
- } else {
- auto matched_setting = matchWithRequirement(
- matched_ase_configuration_settings, requirement, false);
- if (matched_setting.has_value()) {
- result.push_back(matched_setting.value());
- } else {
- // Cannot find a match for this requirement
- // Immediately return
- LOG(ERROR)
- << __func__
- << ": Cannot find any match for this requirement, exitting...";
- result.clear();
- *_aidl_return = result;
- return ndk::ScopedAStatus::ok();
+ // Any context - loose match with allocation
+ bool found = false;
+ for (bool match_context : {true, false}) {
+ for (bool match_exact : {true, false}) {
+ auto matched_setting =
+ matchWithRequirement(matched_ase_configuration_settings,
+ requirement, match_context, match_exact);
+ if (matched_setting.has_value()) {
+ result.push_back(matched_setting.value());
+ found = true;
+ break;
+ }
}
+ if (found) break;
+ }
+
+ if (!found) {
+ LOG(ERROR) << __func__
+ << ": Cannot find any match for this requirement, exitting...";
+ result.clear();
+ *_aidl_return = result;
+ return ndk::ScopedAStatus::ok();
}
}
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
index 798f183..3a82b73 100644
--- a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
+++ b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.h
@@ -139,7 +139,8 @@
direction_configurations,
const std::vector<std::optional<AseDirectionRequirement>>& requirements,
std::optional<std::vector<std::optional<AseDirectionConfiguration>>>&
- valid_direction_configurations);
+ valid_direction_configurations,
+ bool isExact);
std::optional<LeAudioAseConfigurationSetting>
getCapabilitiesMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
@@ -149,7 +150,8 @@
getRequirementMatchedAseConfigurationSettings(
IBluetoothAudioProvider::LeAudioAseConfigurationSetting& setting,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
- requirement);
+ requirement,
+ bool isExact);
bool isMatchedQosRequirement(LeAudioAseQosConfiguration setting_qos,
AseQosDirectionRequirement requirement_qos);
std::optional<LeAudioBroadcastConfigurationSetting>
@@ -173,7 +175,7 @@
matched_ase_configuration_settings,
const IBluetoothAudioProvider::LeAudioConfigurationRequirement&
requirements,
- bool isMatchContext);
+ bool isMatchContext, bool isExact);
};
class LeAudioOffloadOutputAudioProvider : public LeAudioOffloadAudioProvider {
diff --git a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
index 4481238..a52d761 100644
--- a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
+++ b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
@@ -2375,6 +2375,43 @@
return capability;
}
+ LeAudioDeviceCapabilities GetOpusRemoteSinkCapability() {
+ // Create a capability specifically for vendor OPUS
+ LeAudioDeviceCapabilities capability;
+
+ auto vendor_codec = CodecId::Vendor();
+ vendor_codec.codecId = 255;
+ vendor_codec.id = 224;
+ capability.codecId = vendor_codec;
+
+ auto pref_context_metadata = MetadataLtv::PreferredAudioContexts();
+ pref_context_metadata.values =
+ GetAudioContext(AudioContext::MEDIA | AudioContext::CONVERSATIONAL |
+ AudioContext::GAME);
+ capability.metadata = {pref_context_metadata};
+
+ auto sampling_rate =
+ CodecSpecificCapabilitiesLtv::SupportedSamplingFrequencies();
+ sampling_rate.bitmask =
+ CodecSpecificCapabilitiesLtv::SupportedSamplingFrequencies::HZ16000 |
+ CodecSpecificCapabilitiesLtv::SupportedSamplingFrequencies::HZ8000 |
+ CodecSpecificCapabilitiesLtv::SupportedSamplingFrequencies::HZ48000;
+ auto frame_duration =
+ CodecSpecificCapabilitiesLtv::SupportedFrameDurations();
+ frame_duration.bitmask =
+ CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US7500 |
+ CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US10000 |
+ CodecSpecificCapabilitiesLtv::SupportedFrameDurations::US20000;
+ auto octets = CodecSpecificCapabilitiesLtv::SupportedOctetsPerCodecFrame();
+ octets.min = 0;
+ octets.max = 240;
+ auto frames = CodecSpecificCapabilitiesLtv::SupportedMaxCodecFramesPerSDU();
+ frames.value = 2;
+ capability.codecSpecificCapabilities = {sampling_rate, frame_duration,
+ octets, frames};
+ return capability;
+ }
+
LeAudioDeviceCapabilities GetDefaultRemoteSourceCapability() {
// Create a capability
LeAudioDeviceCapabilities capability;
@@ -2745,6 +2782,41 @@
return requirement;
}
+ LeAudioConfigurationRequirement GetOpusUnicastRequirement(
+ int32_t context_bits, bool is_sink_requirement,
+ bool is_source_requriement,
+ CodecSpecificConfigurationLtv::SamplingFrequency freq =
+ CodecSpecificConfigurationLtv::SamplingFrequency::HZ48000) {
+ // Create a requirements
+ LeAudioConfigurationRequirement requirement;
+ requirement.audioContext = GetAudioContext(context_bits);
+
+ auto allocation = CodecSpecificConfigurationLtv::AudioChannelAllocation();
+ allocation.bitmask =
+ CodecSpecificConfigurationLtv::AudioChannelAllocation::FRONT_LEFT |
+ CodecSpecificConfigurationLtv::AudioChannelAllocation::FRONT_RIGHT;
+
+ auto direction_ase_requriement = AseDirectionRequirement();
+ auto vendor_codec = CodecId::Vendor();
+ vendor_codec.codecId = 255;
+ vendor_codec.id = 224;
+ direction_ase_requriement.aseConfiguration.codecId = vendor_codec;
+ direction_ase_requriement.aseConfiguration.targetLatency =
+ LeAudioAseConfiguration::TargetLatency::HIGHER_RELIABILITY;
+
+ direction_ase_requriement.aseConfiguration.codecConfiguration = {
+ freq, CodecSpecificConfigurationLtv::FrameDuration::US20000, allocation
+
+ };
+ if (is_sink_requirement)
+ requirement.sinkAseRequirement = {direction_ase_requriement};
+
+ if (is_source_requriement)
+ requirement.sourceAseRequirement = {direction_ase_requriement};
+
+ return requirement;
+ }
+
LeAudioConfigurationRequirement GetUnicastGameRequirement(bool asymmetric) {
// Create a requirements
LeAudioConfigurationRequirement requirement;
@@ -3172,6 +3244,31 @@
}
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
+ GetOpusAseConfiguration) {
+ if (GetProviderFactoryInterfaceVersion() <
+ BluetoothAudioHalVersion::VERSION_AIDL_V4) {
+ GTEST_SKIP();
+ }
+
+ std::vector<std::optional<LeAudioDeviceCapabilities>> sink_capabilities = {
+ GetOpusRemoteSinkCapability()};
+ std::vector<std::optional<LeAudioDeviceCapabilities>> source_capabilities = {
+ GetDefaultRemoteSourceCapability()};
+
+ std::vector<LeAudioAseConfigurationSetting> configurations;
+ std::vector<LeAudioConfigurationRequirement> sink_requirements = {
+ GetOpusUnicastRequirement(AudioContext::MEDIA, true /* sink */,
+ false /* source */)};
+ auto aidl_retval = audio_provider_->getLeAudioAseConfiguration(
+ sink_capabilities, std::nullopt, sink_requirements, &configurations);
+
+ ASSERT_TRUE(aidl_retval.isOk());
+ if (!configurations.empty()) {
+ VerifyIfRequirementsSatisfied(sink_requirements, configurations);
+ }
+}
+
+TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
GetAseConfiguration_Multidirectional) {
if (GetProviderFactoryInterfaceVersion() <
BluetoothAudioHalVersion::VERSION_AIDL_V4) {
diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp
index d931c4d..d4968a8 100644
--- a/bluetooth/audio/utils/Android.bp
+++ b/bluetooth/audio/utils/Android.bp
@@ -90,13 +90,15 @@
cc_test {
name: "BluetoothLeAudioCodecsProviderTest",
- defaults: [
- "latest_android_hardware_bluetooth_audio_ndk_shared",
- ],
srcs: [
"aidl_session/BluetoothLeAudioCodecsProvider.cpp",
"aidl_session/BluetoothLeAudioCodecsProviderTest.cpp",
],
+ defaults: [
+ "latest_android_hardware_audio_common_ndk_static",
+ "latest_android_hardware_bluetooth_audio_ndk_static",
+ "latest_android_media_audio_common_types_ndk_static",
+ ],
header_libs: [
"libxsdc-utils",
],
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
index 37812fa..07e4997 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
@@ -92,9 +92,10 @@
/* Frame Durations */
constexpr uint8_t kLeAudioCodecFrameDur7500us = 0x00;
constexpr uint8_t kLeAudioCodecFrameDur10000us = 0x01;
+constexpr uint8_t kLeAudioCodecFrameDur20000us = 0x02;
/* Audio Allocations */
-constexpr uint32_t kLeAudioLocationNotAllowed = 0x00000000;
+constexpr uint32_t kLeAudioLocationMonoAudio = 0x00000000;
constexpr uint32_t kLeAudioLocationFrontLeft = 0x00000001;
constexpr uint32_t kLeAudioLocationFrontRight = 0x00000002;
constexpr uint32_t kLeAudioLocationFrontCenter = 0x00000004;
@@ -171,12 +172,14 @@
{kLeAudioCodecFrameDur7500us,
CodecSpecificConfigurationLtv::FrameDuration::US7500},
{kLeAudioCodecFrameDur10000us,
- CodecSpecificConfigurationLtv::FrameDuration::US10000}};
+ CodecSpecificConfigurationLtv::FrameDuration::US10000},
+ {kLeAudioCodecFrameDur20000us,
+ CodecSpecificConfigurationLtv::FrameDuration::US20000}};
/* Helper map for matching various audio channel allocation notations */
std::map<uint32_t, uint32_t> audio_channel_allocation_map = {
- {kLeAudioLocationNotAllowed,
- CodecSpecificConfigurationLtv::AudioChannelAllocation::NOT_ALLOWED},
+ {kLeAudioLocationMonoAudio,
+ CodecSpecificConfigurationLtv::AudioChannelAllocation::MONO},
{kLeAudioLocationFrontLeft,
CodecSpecificConfigurationLtv::AudioChannelAllocation::FRONT_LEFT},
{kLeAudioLocationFrontRight,
@@ -487,6 +490,9 @@
case CodecSpecificConfigurationLtv::FrameDuration::US10000:
qos.sduIntervalUs = 10000;
break;
+ case CodecSpecificConfigurationLtv::FrameDuration::US20000:
+ qos.sduIntervalUs = 20000;
+ break;
}
qos.sduIntervalUs *= frameBlockValue;
}
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
index 473777c..59c43a4 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.cpp
@@ -119,19 +119,36 @@
// Mapping octetsPerCodecFrame to bitdepth for easier comparison.
transport.bitdepth.push_back(codec_config.getOctetsPerCodecFrame());
transport.frameDurationUs.push_back(codec_config.getFrameDurationUs());
- switch (strategy_config.getAudioLocation()) {
- case setting::AudioLocation::MONO:
+ if (strategy_config.hasAudioLocation()) {
+ switch (strategy_config.getAudioLocation()) {
+ case setting::AudioLocation::MONO:
+ if (strategy_config_channel_count == 1)
+ transport.channelMode.push_back(ChannelMode::MONO);
+ else
+ transport.channelMode.push_back(ChannelMode::DUALMONO);
+ break;
+ case setting::AudioLocation::STEREO:
+ transport.channelMode.push_back(ChannelMode::STEREO);
+ break;
+ default:
+ transport.channelMode.push_back(ChannelMode::UNKNOWN);
+ break;
+ }
+ } else if (strategy_config.hasAudioChannelAllocation()) {
+ auto count =
+ std::bitset<32>(strategy_config.getAudioChannelAllocation()).count();
+ if (count <= 1) {
if (strategy_config_channel_count == 1)
transport.channelMode.push_back(ChannelMode::MONO);
else
transport.channelMode.push_back(ChannelMode::DUALMONO);
- break;
- case setting::AudioLocation::STEREO:
+ } else if (count == 2) {
transport.channelMode.push_back(ChannelMode::STEREO);
- break;
- default:
+ } else {
transport.channelMode.push_back(ChannelMode::UNKNOWN);
- break;
+ }
+ } else {
+ transport.channelMode.push_back(ChannelMode::UNKNOWN);
}
}
@@ -336,8 +353,12 @@
for (const auto& scenario : supported_scenarios) {
UnicastCapability unicast_encode_capability =
GetUnicastCapability(scenario.getEncode());
+ LOG(INFO) << __func__ << ": Unicast capability encode = "
+ << unicast_encode_capability.toString();
UnicastCapability unicast_decode_capability =
GetUnicastCapability(scenario.getDecode());
+ LOG(INFO) << __func__ << ": Unicast capability decode = "
+ << unicast_decode_capability.toString();
BroadcastCapability broadcast_capability = {.codecType =
CodecType::UNKNOWN};
@@ -384,22 +405,36 @@
return {.codecType = CodecType::UNKNOWN};
}
+ // Populate audio location
+ AudioLocation audio_location = AudioLocation::UNKNOWN;
+ if (strategy_configuration_iter->second.hasAudioLocation()) {
+ audio_location = GetAudioLocation(
+ strategy_configuration_iter->second.getAudioLocation());
+ }
+
+ // Populate audio channel allocation
+ std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>
+ audio_channel_allocation = std::nullopt;
+ if (strategy_configuration_iter->second.hasAudioChannelAllocation()) {
+ LOG(INFO) << __func__ << ": has allocation";
+ CodecSpecificConfigurationLtv::AudioChannelAllocation tmp;
+ tmp.bitmask =
+ strategy_configuration_iter->second.getAudioChannelAllocation();
+ audio_channel_allocation = tmp;
+ }
+
CodecType codec_type =
GetCodecType(codec_configuration_iter->second.getCodec());
if (codec_type == CodecType::LC3) {
return ComposeUnicastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getConnectedDevice(),
strategy_configuration_iter->second.getChannelCount(),
ComposeLc3Capability(codec_configuration_iter->second));
} else if (codec_type == CodecType::APTX_ADAPTIVE_LE ||
codec_type == CodecType::APTX_ADAPTIVE_LEX) {
return ComposeUnicastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getConnectedDevice(),
strategy_configuration_iter->second.getChannelCount(),
ComposeAptxAdaptiveLeCapability(codec_configuration_iter->second));
@@ -435,11 +470,27 @@
std::vector<std::optional<Lc3Capabilities>> bcastLc3Cap(
1, std::optional(ComposeLc3Capability(codec_configuration_iter->second)));
+ // Populate audio location
+ AudioLocation audio_location = AudioLocation::UNKNOWN;
+ if (strategy_configuration_iter->second.hasAudioLocation()) {
+ audio_location = GetAudioLocation(
+ strategy_configuration_iter->second.getAudioLocation());
+ }
+
+ // Populate audio channel allocation
+ std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>
+ audio_channel_allocation = std::nullopt;
+ if (strategy_configuration_iter->second.hasAudioChannelAllocation()) {
+ LOG(INFO) << __func__ << ": has allocation";
+ CodecSpecificConfigurationLtv::AudioChannelAllocation tmp;
+ tmp.bitmask =
+ strategy_configuration_iter->second.getAudioChannelAllocation();
+ audio_channel_allocation = tmp;
+ }
+
if (codec_type == CodecType::LC3) {
return ComposeBroadcastCapability(
- codec_type,
- GetAudioLocation(
- strategy_configuration_iter->second.getAudioLocation()),
+ codec_type, audio_location, audio_channel_allocation,
strategy_configuration_iter->second.getChannelCount(), bcastLc3Cap);
}
return {.codecType = CodecType::UNKNOWN};
@@ -448,16 +499,21 @@
template <class T>
BroadcastCapability BluetoothLeAudioCodecsProvider::ComposeBroadcastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& channel_count, const std::vector<T>& capability) {
return {.codecType = codec_type,
.supportedChannel = audio_location,
.channelCountPerStream = channel_count,
- .leAudioCodecCapabilities = std::optional(capability)};
+ .leAudioCodecCapabilities = std::optional(capability),
+ .audioLocation = audio_channel_allocation};
}
template <class T>
UnicastCapability BluetoothLeAudioCodecsProvider::ComposeUnicastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& device_cnt, const uint8_t& channel_count,
const T& capability) {
return {
@@ -467,6 +523,7 @@
.channelCountPerDevice = channel_count,
.leAudioCodecCapabilities =
UnicastCapability::LeAudioCodecCapabilities(capability),
+ .audioLocation = audio_channel_allocation,
};
}
@@ -519,38 +576,87 @@
codec_configuration.hasOctetsPerCodecFrame();
}
+bool IsValidStereoAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if ((strategy_configuration.getConnectedDevice() == 2 &&
+ strategy_configuration.getChannelCount() == 1) ||
+ (strategy_configuration.getConnectedDevice() == 1 &&
+ strategy_configuration.getChannelCount() == 2)) {
+ // Stereo
+ // 1. two connected device, one for L one for R
+ // 2. one connected device for both L and R
+ return true;
+ } else if (strategy_configuration.getConnectedDevice() == 0 &&
+ strategy_configuration.getChannelCount() == 2) {
+ // Broadcast
+ return true;
+ }
+ return false;
+}
+
+bool IsValidMonoAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if (strategy_configuration.getConnectedDevice() == 1 &&
+ strategy_configuration.getChannelCount() == 1) {
+ return true;
+ }
+ return false;
+}
+
+bool IsValidAudioLocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ if (strategy_configuration.getAudioLocation() ==
+ setting::AudioLocation::STEREO)
+ return IsValidStereoAudioLocation(strategy_configuration);
+ else if (strategy_configuration.getAudioLocation() ==
+ setting::AudioLocation::MONO)
+ return IsValidMonoAudioLocation(strategy_configuration);
+ return false;
+}
+
+bool IsValidAudioChannelAllocation(
+ const setting::StrategyConfiguration& strategy_configuration) {
+ // First, ensure that there's only 2 bitmask enabled
+ int audio_channel_allocation =
+ strategy_configuration.getAudioChannelAllocation();
+ int count = 0;
+ for (int bit = 0; bit < 32; ++bit)
+ if (audio_channel_allocation & (1 << bit)) ++count;
+ if (count > 2) {
+ LOG(WARNING) << "Cannot parse more than 2 audio location, input is "
+ << audio_channel_allocation;
+ return false;
+ }
+
+ if (count == 2)
+ return IsValidStereoAudioLocation(strategy_configuration);
+ else
+ return IsValidMonoAudioLocation(strategy_configuration);
+}
+
bool BluetoothLeAudioCodecsProvider::IsValidStrategyConfiguration(
const setting::StrategyConfiguration& strategy_configuration) {
if (!strategy_configuration.hasName() ||
- !strategy_configuration.hasAudioLocation() ||
!strategy_configuration.hasConnectedDevice() ||
!strategy_configuration.hasChannelCount()) {
return false;
}
- if (strategy_configuration.getAudioLocation() ==
- setting::AudioLocation::STEREO) {
- if ((strategy_configuration.getConnectedDevice() == 2 &&
- strategy_configuration.getChannelCount() == 1) ||
- (strategy_configuration.getConnectedDevice() == 1 &&
- strategy_configuration.getChannelCount() == 2)) {
- // Stereo
- // 1. two connected device, one for L one for R
- // 2. one connected device for both L and R
- return true;
- } else if (strategy_configuration.getConnectedDevice() == 0 &&
- strategy_configuration.getChannelCount() == 2) {
- // Broadcast
- return true;
- }
- } else if (strategy_configuration.getAudioLocation() ==
- setting::AudioLocation::MONO) {
- if (strategy_configuration.getConnectedDevice() == 1 &&
- strategy_configuration.getChannelCount() == 1) {
- // Mono
- return true;
- }
- }
- return false;
+
+ // Both audio location field cannot be empty
+ if (!strategy_configuration.hasAudioLocation() &&
+ !strategy_configuration.hasAudioChannelAllocation())
+ return false;
+
+ // Any audio location field that presents must be valid
+ if (strategy_configuration.hasAudioLocation() &&
+ !IsValidAudioLocation(strategy_configuration))
+ return false;
+
+ if (strategy_configuration.hasAudioChannelAllocation() &&
+ !IsValidAudioChannelAllocation(strategy_configuration))
+ return false;
+
+ return true;
}
} // namespace audio
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
index 5bf67e2..23b2bb6 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProvider.h
@@ -23,6 +23,7 @@
#include <vector>
#include "aidl/android/hardware/bluetooth/audio/CodecInfo.h"
+#include "aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.h"
#include "aidl/android/hardware/bluetooth/audio/SessionType.h"
#include "aidl_android_hardware_bluetooth_audio_setting.h"
@@ -84,12 +85,18 @@
template <class T>
static inline UnicastCapability ComposeUnicastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<
+ CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& device_cnt, const uint8_t& channel_count,
const T& capability);
template <class T>
static inline BroadcastCapability ComposeBroadcastCapability(
const CodecType& codec_type, const AudioLocation& audio_location,
+ const std::optional<
+ CodecSpecificConfigurationLtv::AudioChannelAllocation>&
+ audio_channel_allocation,
const uint8_t& channel_count, const std::vector<T>& capability);
static inline Lc3Capabilities ComposeLc3Capability(
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
index dba2749..c47f7d5 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioCodecsProviderTest.cpp
@@ -64,19 +64,101 @@
static const StrategyConfiguration kValidStrategyStereoOneCis(
std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
std::make_optional(AudioLocation::STEREO), std::make_optional(2),
- std::make_optional(1));
+ std::make_optional(1), std::nullopt);
static const StrategyConfiguration kValidStrategyStereoTwoCis(
std::make_optional("STEREO_TWO_CISES_PER_DEVICE"),
std::make_optional(AudioLocation::STEREO), std::make_optional(1),
- std::make_optional(2));
+ std::make_optional(2), std::nullopt);
static const StrategyConfiguration kValidStrategyMonoOneCis(
std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
std::make_optional(AudioLocation::MONO), std::make_optional(1),
- std::make_optional(1));
+ std::make_optional(1), std::nullopt);
static const StrategyConfiguration kValidStrategyBroadcastStereo(
std::make_optional("BROADCAST_STEREO"),
std::make_optional(AudioLocation::STEREO), std::make_optional(0),
- std::make_optional(2));
+ std::make_optional(2), std::nullopt);
+
+static const StrategyConfiguration kValidStrategyStereoOneCisInt(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(1), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyStereoTwoCisInt(
+ std::make_optional("STEREO_TWO_CISES_PER_DEVICE"), std::nullopt,
+ std::make_optional(1), std::make_optional(2), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyMonoOneCisInt(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(1), std::make_optional(1), std::make_optional(4));
+static const StrategyConfiguration kValidStrategyBroadcastStereoInt(
+ std::make_optional("BROADCAST_STEREO"), std::nullopt, std::make_optional(0),
+ std::make_optional(2), std::make_optional(3));
+
+static const StrategyConfiguration kValidStrategyStereoOneCisBoth(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyStereoTwoCisBoth(
+ std::make_optional("STEREO_TWO_CISES_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(1),
+ std::make_optional(2), std::make_optional(3));
+static const StrategyConfiguration kValidStrategyMonoOneCisBoth(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::MONO), std::make_optional(1),
+ std::make_optional(1), std::make_optional(4));
+static const StrategyConfiguration kValidStrategyBroadcastStereoBoth(
+ std::make_optional("BROADCAST_STEREO"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(0),
+ std::make_optional(2), std::make_optional(3));
+
+// List of all invalid strategy configuration
+const auto kInvalidStrategyStereoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(2), std::nullopt)});
+const auto kInvalidStrategyMonoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(2), std::nullopt)});
+const auto kInvalidStrategyNoName = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::nullopt, std::make_optional(AudioLocation::STEREO),
+ std::make_optional(2), std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoLocation = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::nullopt,
+ std::make_optional(1), std::nullopt)});
+const auto kInvalidStrategyNoChannel = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::nullopt, std::nullopt)});
+const auto kInvalidStrategyIntMoreBitmask = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(7))});
+const auto kInvalidStrategyIntStereoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(2), std::make_optional(3))});
+const auto kInvalidStrategyIntMonoTwoCisTwoDevice = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(2), std::make_optional(2), std::make_optional(4))});
+const auto kInvalidStrategyIntBroadcast = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("MONO_ONE_CIS_PER_DEVICE"), std::nullopt,
+ std::make_optional(0), std::make_optional(1), std::make_optional(3))});
+const auto kInvalidStrategyBothStereoMonoInt = StrategyConfigurationList(
+ std::vector<StrategyConfiguration>{StrategyConfiguration(
+ std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
+ std::make_optional(AudioLocation::STEREO), std::make_optional(2),
+ std::make_optional(1), std::make_optional(4))});
// Define valid test list built from above valid components
// Scenario, Configuration, CodecConfiguration, StrategyConfiguration
@@ -88,11 +170,16 @@
static const std::vector<CodecConfigurationList> kValidCodecConfigurationList =
{CodecConfigurationList(
std::vector<CodecConfiguration>{kValidCodecLC3_16k_1})};
+
static const std::vector<StrategyConfigurationList>
kValidStrategyConfigurationList = {
StrategyConfigurationList(std::vector<StrategyConfiguration>{
kValidStrategyStereoOneCis, kValidStrategyStereoTwoCis,
- kValidStrategyMonoOneCis, kValidStrategyBroadcastStereo})};
+ kValidStrategyMonoOneCis, kValidStrategyBroadcastStereo,
+ kValidStrategyStereoOneCisInt, kValidStrategyStereoTwoCisInt,
+ kValidStrategyMonoOneCisInt, kValidStrategyBroadcastStereoInt,
+ kValidStrategyStereoOneCisBoth, kValidStrategyStereoTwoCisBoth,
+ kValidStrategyMonoOneCisBoth, kValidStrategyBroadcastStereoBoth})};
class BluetoothLeAudioCodecsProviderTest
: public ::testing::TestWithParam<OffloadSetting> {
@@ -270,49 +357,19 @@
static std::vector<StrategyConfigurationList>
CreateInvalidStrategyConfigurations() {
std::vector<StrategyConfigurationList>
- invalid_strategy_configuration_test_cases;
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(2))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("MONO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(2))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::nullopt, std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"), std::nullopt,
- std::make_optional(2), std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO), std::nullopt,
- std::make_optional(1))}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(
- std::vector<StrategyConfiguration>{StrategyConfiguration(
- std::make_optional("STEREO_ONE_CIS_PER_DEVICE"),
- std::make_optional(AudioLocation::STEREO),
- std::make_optional(2), std::nullopt)}));
-
- invalid_strategy_configuration_test_cases.push_back(
- StrategyConfigurationList(std::vector<StrategyConfiguration>{}));
+ invalid_strategy_configuration_test_cases = {
+ kInvalidStrategyStereoTwoCisTwoDevice,
+ kInvalidStrategyMonoTwoCisTwoDevice,
+ kInvalidStrategyNoName,
+ kInvalidStrategyNoLocation,
+ kInvalidStrategyNoDevice,
+ kInvalidStrategyNoChannel,
+ kInvalidStrategyIntMoreBitmask,
+ kInvalidStrategyIntStereoTwoCisTwoDevice,
+ kInvalidStrategyIntMonoTwoCisTwoDevice,
+ kInvalidStrategyIntBroadcast,
+ kInvalidStrategyBothStereoMonoInt,
+ StrategyConfigurationList(std::vector<StrategyConfiguration>{})};
return invalid_strategy_configuration_test_cases;
}
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
index eaace78..b6ebbd9 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xml
@@ -69,9 +69,9 @@
<codecConfiguration name="APTX_ADAPTIVE_LEX_96k" codec="APTX_ADAPTIVE_LEX" samplingFrequency="96000" frameDurationUs="10000" octetsPerCodecFrame="816"/>
</codecConfigurationList>
<strategyConfigurationList>
- <strategyConfiguration name="STEREO_ONE_CIS_PER_DEVICE" audioLocation="STEREO" connectedDevice="2" channelCount="1"/>
- <strategyConfiguration name="STEREO_TWO_CISES_PER_DEVICE" audioLocation="STEREO" connectedDevice="1" channelCount="2"/>
- <strategyConfiguration name="MONO_ONE_CIS_PER_DEVICE" audioLocation="MONO" connectedDevice="1" channelCount="1"/>
- <strategyConfiguration name="BROADCAST_STEREO" audioLocation="STEREO" connectedDevice="0" channelCount="2"/>
+ <strategyConfiguration name="STEREO_ONE_CIS_PER_DEVICE" audioLocation="STEREO" connectedDevice="2" channelCount="1" audioChannelAllocation="3"/>
+ <strategyConfiguration name="STEREO_TWO_CISES_PER_DEVICE" audioLocation="STEREO" connectedDevice="1" channelCount="2" audioChannelAllocation="3"/>
+ <strategyConfiguration name="MONO_ONE_CIS_PER_DEVICE" audioLocation="MONO" connectedDevice="1" channelCount="1" audioChannelAllocation="4"/>
+ <strategyConfiguration name="BROADCAST_STEREO" audioLocation="STEREO" connectedDevice="0" channelCount="2" audioChannelAllocation="3"/>
</strategyConfigurationList>
</leAudioOffloadSetting>
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
index 03c8ade..d9ccab5 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/le_audio_codec_capabilities.xsd
@@ -56,9 +56,12 @@
<xs:element name="strategyConfiguration">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
+ <!-- Deprecated definition of Audio Location, please use audioLocationInt -->
<xs:attribute name="audioLocation" type="audioLocation"/>
<xs:attribute name="connectedDevice" type="xs:unsignedByte"/>
<xs:attribute name="channelCount" type="xs:unsignedByte"/>
+ <!-- Integer Audio Location to populate to audioLocation if present -->
+ <xs:attribute name="audioChannelAllocation" type="xs:int"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="audioLocation">
diff --git a/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt b/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
index a882174..b6c2f03 100644
--- a/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
+++ b/bluetooth/audio/utils/le_audio_codec_capabilities/schema/current.txt
@@ -81,10 +81,12 @@
public class StrategyConfiguration {
ctor public StrategyConfiguration();
+ method public int getAudioChannelAllocation();
method public aidl.android.hardware.bluetooth.audio.setting.AudioLocation getAudioLocation();
method public short getChannelCount();
method public short getConnectedDevice();
method public String getName();
+ method public void setAudioChannelAllocation(int);
method public void setAudioLocation(aidl.android.hardware.bluetooth.audio.setting.AudioLocation);
method public void setChannelCount(short);
method public void setConnectedDevice(short);
diff --git a/bluetooth/audio/utils/le_audio_configuration_set/audio_set_configurations.json b/bluetooth/audio/utils/le_audio_configuration_set/audio_set_configurations.json
index fbfa3f9..88e9ce4 100644
--- a/bluetooth/audio/utils/le_audio_configuration_set/audio_set_configurations.json
+++ b/bluetooth/audio/utils/le_audio_configuration_set/audio_set_configurations.json
@@ -18,6 +18,7 @@
" Example values which can be used as 'codec_configuration.compound_value'",
" Codec Coding formats:",
" LC3 = 6",
+ " OPUS = 225",
" Sampling Frequencies: ",
" 8000Hz = 1",
" 11025Hz = 2",
@@ -34,7 +35,8 @@
" 384000Hz = 13",
" Frame Durations:",
" 7500us = 0",
- " 10000us = 1"
+ " 10000us = 1",
+ " 20000us = 2"
],
"configurations": [
{
diff --git a/bluetooth/finder/aidl/vts/Android.bp b/bluetooth/finder/aidl/vts/Android.bp
index 49d2d45..29a0c0f 100644
--- a/bluetooth/finder/aidl/vts/Android.bp
+++ b/bluetooth/finder/aidl/vts/Android.bp
@@ -32,7 +32,6 @@
],
static_libs: [
"android.hardware.bluetooth.finder-V1-ndk",
- "libbluetooth-types",
],
test_config: "VtsHalBluetoothFinderTargetTest.xml",
test_suites: [
diff --git a/bluetooth/ranging/aidl/vts/Android.bp b/bluetooth/ranging/aidl/vts/Android.bp
index 9984ce8..7f6ceff 100644
--- a/bluetooth/ranging/aidl/vts/Android.bp
+++ b/bluetooth/ranging/aidl/vts/Android.bp
@@ -17,8 +17,7 @@
"libutils",
],
static_libs: [
- "android.hardware.bluetooth.ranging-V1-ndk",
- "libbluetooth-types",
+ "android.hardware.bluetooth.ranging-V2-ndk",
],
test_config: "VtsHalBluetoothRangingTargetTest.xml",
test_suites: [
diff --git a/bluetooth/ranging/aidl/vts/VtsHalBluetoothRangingTargetTest.cpp b/bluetooth/ranging/aidl/vts/VtsHalBluetoothRangingTargetTest.cpp
index 702df95..4510f24 100644
--- a/bluetooth/ranging/aidl/vts/VtsHalBluetoothRangingTargetTest.cpp
+++ b/bluetooth/ranging/aidl/vts/VtsHalBluetoothRangingTargetTest.cpp
@@ -30,12 +30,15 @@
using aidl::android::hardware::bluetooth::ranging::
BnBluetoothChannelSoundingSessionCallback;
using aidl::android::hardware::bluetooth::ranging::ChannelSoudingRawData;
+using aidl::android::hardware::bluetooth::ranging::ChannelSoundingProcedureData;
+using aidl::android::hardware::bluetooth::ranging::Config;
using aidl::android::hardware::bluetooth::ranging::CsSecurityLevel;
using aidl::android::hardware::bluetooth::ranging::IBluetoothChannelSounding;
using aidl::android::hardware::bluetooth::ranging::
IBluetoothChannelSoundingSession;
using aidl::android::hardware::bluetooth::ranging::
IBluetoothChannelSoundingSessionCallback;
+using aidl::android::hardware::bluetooth::ranging::ProcedureEnableConfig;
using aidl::android::hardware::bluetooth::ranging::RangingResult;
using aidl::android::hardware::bluetooth::ranging::Reason;
using aidl::android::hardware::bluetooth::ranging::ResultType;
@@ -43,6 +46,12 @@
using aidl::android::hardware::bluetooth::ranging::VendorSpecificData;
using ndk::ScopedAStatus;
+enum class RangingHalVersion : uint8_t {
+ V_UNAVAILABLE = 0,
+ V_1,
+ V_2,
+};
+
class BluetoothChannelSoundingSessionCallback
: public BnBluetoothChannelSoundingSessionCallback {
public:
@@ -80,6 +89,8 @@
ALOGI("SetUp Ranging Test");
bluetooth_channel_sounding_ = IBluetoothChannelSounding::fromBinder(
ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ hal_version_ = GetRangingHalVersion();
+ ASSERT_GT(hal_version_, RangingHalVersion::V_UNAVAILABLE);
ASSERT_NE(bluetooth_channel_sounding_, nullptr);
}
@@ -95,6 +106,8 @@
ScopedAStatus getSupportedSessionTypes(
std::optional<std::vector<SessionType>>* _aidl_return);
ScopedAStatus getMaxSupportedCsSecurityLevel(CsSecurityLevel* _aidl_return);
+ ScopedAStatus getSupportedCsSecurityLevels(
+ std::vector<CsSecurityLevel>* _aidl_return);
ScopedAStatus openSession(
const BluetoothChannelSoundingParameters& in_params,
const std::shared_ptr<IBluetoothChannelSoundingSessionCallback>&
@@ -111,6 +124,30 @@
return status;
}
+ RangingHalVersion GetRangingHalVersion() {
+ int32_t aidl_version = 0;
+ if (bluetooth_channel_sounding_ == nullptr) {
+ return RangingHalVersion::V_UNAVAILABLE;
+ }
+ auto aidl_ret_val =
+ bluetooth_channel_sounding_->getInterfaceVersion(&aidl_version);
+ if (!aidl_ret_val.isOk()) {
+ return RangingHalVersion::V_UNAVAILABLE;
+ }
+ switch (aidl_version) {
+ case 1:
+ return RangingHalVersion::V_1;
+ case 2:
+ return RangingHalVersion::V_2;
+ default:
+ return RangingHalVersion::V_UNAVAILABLE;
+ }
+ return RangingHalVersion::V_UNAVAILABLE;
+ }
+
+ public:
+ RangingHalVersion hal_version_ = RangingHalVersion::V_UNAVAILABLE;
+
private:
std::shared_ptr<IBluetoothChannelSounding> bluetooth_channel_sounding_;
};
@@ -130,6 +167,13 @@
return bluetooth_channel_sounding_->getMaxSupportedCsSecurityLevel(
_aidl_return);
}
+
+ScopedAStatus BluetoothRangingTest::getSupportedCsSecurityLevels(
+ std::vector<CsSecurityLevel>* _aidl_return) {
+ return bluetooth_channel_sounding_->getSupportedCsSecurityLevels(
+ _aidl_return);
+}
+
ScopedAStatus BluetoothRangingTest::openSession(
const BluetoothChannelSoundingParameters& in_params,
const std::shared_ptr<IBluetoothChannelSoundingSessionCallback>&
@@ -155,11 +199,25 @@
}
TEST_P(BluetoothRangingTest, GetMaxSupportedCsSecurityLevel) {
+ if (hal_version_ > RangingHalVersion::V_1) {
+ GTEST_SKIP();
+ }
CsSecurityLevel security_level;
ScopedAStatus status = getMaxSupportedCsSecurityLevel(&security_level);
ASSERT_TRUE(status.isOk());
}
+TEST_P(BluetoothRangingTest, GetSupportedCsSecurityLevels) {
+ if (hal_version_ < RangingHalVersion::V_2) {
+ GTEST_SKIP();
+ }
+ std::vector<CsSecurityLevel> supported_security_levels;
+ ScopedAStatus status =
+ getSupportedCsSecurityLevels(&supported_security_levels);
+ ASSERT_GT(static_cast<uint8_t>(supported_security_levels.size()), 0);
+ ASSERT_TRUE(status.isOk());
+}
+
TEST_P(BluetoothRangingTest, OpenSession) {
BluetoothChannelSoundingParameters params;
std::shared_ptr<BluetoothChannelSoundingSessionCallback> callback = nullptr;
@@ -205,6 +263,9 @@
}
TEST_P(BluetoothRangingTest, WriteRawData) {
+ if (hal_version_ > RangingHalVersion::V_1) {
+ GTEST_SKIP();
+ }
std::shared_ptr<IBluetoothChannelSoundingSession> session;
auto status = initBluetoothChannelSoundingSession(&session);
ASSERT_TRUE(status.isOk());
@@ -215,6 +276,62 @@
}
}
+TEST_P(BluetoothRangingTest, WriteProcedureData) {
+ if (hal_version_ < RangingHalVersion::V_2) {
+ GTEST_SKIP();
+ }
+ std::shared_ptr<IBluetoothChannelSoundingSession> session;
+ auto status = initBluetoothChannelSoundingSession(&session);
+ ASSERT_TRUE(status.isOk());
+ if (session != nullptr) {
+ ChannelSoundingProcedureData procedure_data;
+ status = session->writeProcedureData(procedure_data);
+ ASSERT_TRUE(status.isOk());
+ }
+}
+
+TEST_P(BluetoothRangingTest, UpdateChannelSoundingConfig) {
+ if (hal_version_ < RangingHalVersion::V_2) {
+ GTEST_SKIP();
+ }
+ std::shared_ptr<IBluetoothChannelSoundingSession> session;
+ auto status = initBluetoothChannelSoundingSession(&session);
+ ASSERT_TRUE(status.isOk());
+ if (session != nullptr) {
+ Config config;
+ status = session->updateChannelSoundingConfig(config);
+ ASSERT_TRUE(status.isOk());
+ }
+}
+
+TEST_P(BluetoothRangingTest, UpdateProcedureEnableConfig) {
+ if (hal_version_ < RangingHalVersion::V_2) {
+ GTEST_SKIP();
+ }
+ std::shared_ptr<IBluetoothChannelSoundingSession> session;
+ auto status = initBluetoothChannelSoundingSession(&session);
+ ASSERT_TRUE(status.isOk());
+ if (session != nullptr) {
+ ProcedureEnableConfig procedure_enable_config;
+ status = session->updateProcedureEnableConfig(procedure_enable_config);
+ ASSERT_TRUE(status.isOk());
+ }
+}
+
+TEST_P(BluetoothRangingTest, UpdateBleConnInterval) {
+ if (hal_version_ < RangingHalVersion::V_2) {
+ GTEST_SKIP();
+ }
+ std::shared_ptr<IBluetoothChannelSoundingSession> session;
+ auto status = initBluetoothChannelSoundingSession(&session);
+ ASSERT_TRUE(status.isOk());
+ if (session != nullptr) {
+ int ble_conn_interval = 10;
+ status = session->updateBleConnInterval(ble_conn_interval);
+ ASSERT_TRUE(status.isOk());
+ }
+}
+
TEST_P(BluetoothRangingTest, CloseSession) {
std::shared_ptr<IBluetoothChannelSoundingSession> session;
auto status = initBluetoothChannelSoundingSession(&session);
diff --git a/bluetooth/socket/OWNERS b/bluetooth/socket/OWNERS
new file mode 100644
index 0000000..e7a60e6
--- /dev/null
+++ b/bluetooth/socket/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 27441
+
+include platform/packages/modules/Bluetooth:/OWNERS
+
+jaydenk@google.com
diff --git a/bluetooth/socket/aidl/Android.bp b/bluetooth/socket/aidl/Android.bp
new file mode 100644
index 0000000..77679f8
--- /dev/null
+++ b/bluetooth/socket/aidl/Android.bp
@@ -0,0 +1,46 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+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.socket",
+ vendor_available: true,
+ host_supported: true,
+ srcs: ["android/hardware/bluetooth/socket/*.aidl"],
+ imports: [
+ "android.hardware.contexthub-V4",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ enabled: false,
+ },
+ ndk: {
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.btservices",
+ ],
+ min_sdk_version: "33",
+ },
+ },
+ frozen: false,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/ChannelInfo.aidl
similarity index 87%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/ChannelInfo.aidl
index 1e304ab..b9b9593 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/ChannelInfo.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+union ChannelInfo {
+ android.hardware.bluetooth.socket.LeCocChannelInfo leCocChannelInfo;
+ android.hardware.bluetooth.socket.RfcommChannelInfo rfcommChannelInfo;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocket.aidl
similarity index 81%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocket.aidl
index 5c26cc2..a961692 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocket.aidl
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.bluetooth.socket;
+@VintfStability
+interface IBluetoothSocket {
+ void registerCallback(in android.hardware.bluetooth.socket.IBluetoothSocketCallback callback);
+ android.hardware.bluetooth.socket.SocketCapabilities getSocketCapabilities();
+ void opened(in android.hardware.bluetooth.socket.SocketContext context);
+ void closed(long socketId);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl
index 1e304ab..35bfb5b 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+interface IBluetoothSocketCallback {
+ void openedComplete(long socketId, in android.hardware.bluetooth.socket.Status status, in String reason);
+ void close(long socketId, in String reason);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
similarity index 91%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
index 1e304ab..447daa9 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable LeCocCapabilities {
+ int numberOfSupportedSockets;
+ int mtu;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl
index 1e304ab..4d6fcb7 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl
@@ -31,7 +31,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable LeCocChannelInfo {
+ int localCid;
+ int remoteCid;
+ int psm;
+ int localMtu;
+ int remoteMtu;
+ int localMps;
+ int remoteMps;
+ int initialRxCredits;
+ int initialTxCredits;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommCapabilities.aidl
similarity index 91%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommCapabilities.aidl
index 1e304ab..06a75b4 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommCapabilities.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable RfcommCapabilities {
+ int numberOfSupportedSockets;
+ int maxFrameSize;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl
index 1e304ab..3f9a140 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl
@@ -31,7 +31,16 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable RfcommChannelInfo {
+ int localCid;
+ int remoteCid;
+ int localMtu;
+ int remoteMtu;
+ int initialRxCredits;
+ int initialTxCredits;
+ int dlci;
+ int maxFrameSize;
+ boolean muxInitiator;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketCapabilities.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketCapabilities.aidl
index 1e304ab..400f20c 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketCapabilities.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable SocketCapabilities {
+ android.hardware.bluetooth.socket.LeCocCapabilities leCocCapabilities;
+ android.hardware.bluetooth.socket.RfcommCapabilities rfcommCapabilities;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketContext.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketContext.aidl
index 1e304ab..6844d31 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/SocketContext.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@VintfStability
+parcelable SocketContext {
+ long socketId;
+ String name;
+ int aclConnectionHandle;
+ android.hardware.bluetooth.socket.ChannelInfo channelInfo;
+ android.hardware.contexthub.EndpointId endpointId;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/Status.aidl
similarity index 92%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/Status.aidl
index 1e304ab..63f57a9 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/bluetooth/socket/aidl/aidl_api/android.hardware.bluetooth.socket/current/android/hardware/bluetooth/socket/Status.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.bluetooth.socket;
+@Backing(type="int") @VintfStability
+enum Status {
+ SUCCESS,
+ FAILURE,
}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/ChannelInfo.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/ChannelInfo.aidl
new file mode 100644
index 0000000..afae1c0
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/ChannelInfo.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+import android.hardware.bluetooth.socket.LeCocChannelInfo;
+import android.hardware.bluetooth.socket.RfcommChannelInfo;
+
+/**
+ * Used to specify the channel information of different protocol.
+ */
+@VintfStability
+union ChannelInfo {
+ /**
+ * LE L2CAP COC channel information.
+ */
+ LeCocChannelInfo leCocChannelInfo;
+
+ /**
+ * RFCOMM channel information.
+ */
+ RfcommChannelInfo rfcommChannelInfo;
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocket.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocket.aidl
new file mode 100644
index 0000000..5853c10
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocket.aidl
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+import android.hardware.bluetooth.socket.IBluetoothSocketCallback;
+import android.hardware.bluetooth.socket.SocketCapabilities;
+import android.hardware.bluetooth.socket.SocketContext;
+
+/**
+ * The interface for host stack to register callback, get capabilities, and open/close socket.
+ */
+@VintfStability
+interface IBluetoothSocket {
+ /**
+ * API to register a callback for HAL implementation to send asynchronous events.
+ *
+ * @param callback An instance of the |IBluetoothSocketCallback| AIDL interface object
+ */
+ void registerCallback(in IBluetoothSocketCallback callback);
+
+ /**
+ * API to get supported offload socket capabilities.
+ *
+ * @return a socket capabilities
+ */
+ SocketCapabilities getSocketCapabilities();
+
+ /**
+ * API to notify the offload stack that the socket is opened.
+ *
+ * The HAL implementation must use IBluetoothSocketCallback.openedComplete() to indicate the
+ * result of this operation
+ *
+ * @param context Socket context including socket id, channel, hub, and endpoint info
+ */
+ void opened(in SocketContext context);
+
+ /**
+ * API to notify the offload stack that the socket is closed.
+ *
+ * When host app requests to close a socket or the HAL calls IBluetoothSocketCallback.close(),
+ * the host stack closes the socket and sends the notification.
+ *
+ * @param socketId Identifier assigned to the socket by the host stack
+ */
+ void closed(long socketId);
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl
new file mode 100644
index 0000000..7cd635d
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/IBluetoothSocketCallback.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+import android.hardware.bluetooth.socket.Status;
+
+/**
+ * The interface from the Bluetooth offload socket to the host stack.
+ */
+@VintfStability
+interface IBluetoothSocketCallback {
+ /**
+ * Invoked when IBluetoothSocket.opened() has been completed.
+ *
+ * @param socketId Identifier assigned to the socket by the host stack
+ * @param status Status indicating success or failure
+ * @param reason Reason string of the operation failure for debugging purposes
+ */
+ void openedComplete(long socketId, in Status status, in String reason);
+
+ /**
+ * Invoked when offload app or stack requests host stack to close the socket.
+ *
+ * @param socketId Identifier assigned to the socket by the host stack
+ * @param reason Reason string for closing the socket for debugging purposes
+ */
+ void close(long socketId, in String reason);
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
new file mode 100644
index 0000000..003da11
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocCapabilities.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+/**
+ * Capabilities for LE L2CAP COC that the offload stack supports.
+ */
+@VintfStability
+parcelable LeCocCapabilities {
+ /**
+ * Maximum number of LE COC sockets supported. If not supported, the value must be zero.
+ */
+ int numberOfSupportedSockets;
+
+ /**
+ * Local Maximum Transmission Unit size in octets. The MTU size must be in range 23 to 65535.
+ *
+ * The actual value of the local MTU shared in the connection configuration is set in
+ * LeCocChannelInfo.localMtu in the IBluetoothSocket.opened() context parameter.
+ */
+ int mtu;
+
+ /**
+ * The value used by the Host stack for the local Maximum Packet Size shall be the value
+ * LE_ACL_Data_Packet_Length returned by the controller in response to the command HCI LE Read
+ * Buffer Size. Then, the MPS size must be in range 1 to 255. We do not make the MPS
+ * configurable in HAL because using the maximum value does not require a large amount of
+ * memory.
+ */
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl
new file mode 100644
index 0000000..af1bd71
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/LeCocChannelInfo.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+/**
+ * LE L2CAP COC channel information
+ */
+@VintfStability
+parcelable LeCocChannelInfo {
+ /**
+ * L2cap local channel ID.
+ */
+ int localCid;
+
+ /**
+ * L2cap remote channel ID.
+ */
+ int remoteCid;
+
+ /**
+ * PSM for L2CAP LE CoC.
+ */
+ int psm;
+
+ /**
+ * Local Maximum Transmission Unit for LE COC specifying the maximum SDU size in bytes that the
+ * local L2CAP layer can receive.
+ */
+ int localMtu;
+
+ /**
+ * Remote Maximum Transmission Unit for LE COC specifying the maximum SDU size in bytes that the
+ * remote L2CAP layer can receive.
+ */
+ int remoteMtu;
+
+ /**
+ * Local Maximum PDU payload Size in bytes that the local L2CAP layer can receive.
+ */
+ int localMps;
+
+ /**
+ * Remote Maximum PDU payload Size in bytes that the remote L2CAP layer can receive.
+ */
+ int remoteMps;
+
+ /**
+ * Protocol initial credits at Rx path.
+ *
+ * The host stack will always set the initial credits to 0 when configuring the L2CAP COC
+ * channel, and this value will always be zero. It means offload stack should send initial
+ * credits to peer device through L2CAP signaling command L2CAP_FLOW_CONTROL_CREDIT_IND when
+ * IBluetoothSocket.opened() is successful.
+ */
+ int initialRxCredits;
+
+ /**
+ * Protocol initial credits at Tx path.
+ */
+ int initialTxCredits;
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommCapabilities.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommCapabilities.aidl
new file mode 100644
index 0000000..e5cffff
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommCapabilities.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+/**
+ * Capabilities for RFCOMM that the offload stack supports.
+ */
+@VintfStability
+parcelable RfcommCapabilities {
+ /**
+ * Maximum number of RFCOMM sockets supported. If not supported, the value must be zero.
+ */
+ int numberOfSupportedSockets;
+
+ /**
+ * Maximum frame size in octets negotiated during DLCI establishment. The frame size must be
+ * in range 23 to 32767.
+ */
+ int maxFrameSize;
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl
new file mode 100644
index 0000000..7c10144
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/RfcommChannelInfo.aidl
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+/**
+ * RFCOMM channel information
+ */
+@VintfStability
+parcelable RfcommChannelInfo {
+ /**
+ * L2cap local channel ID for RFCOMM.
+ */
+ int localCid;
+
+ /**
+ * L2cap remote channel ID for RFCOMM.
+ */
+ int remoteCid;
+
+ /**
+ * Local Maximum Transmission Unit Size in bytes that the local L2CAP layer can receive.
+ */
+ int localMtu;
+
+ /**
+ * Remote Maximum Transmission Unit Size in bytes that the remote L2CAP layer can receive.
+ */
+ int remoteMtu;
+
+ /**
+ * Protocol initial credits at Rx path.
+ *
+ * The host stack will always set the initial credits to 0 when configuring the RFCOMM
+ * channel, and this value will always be zero. It means offload stack should send initial
+ * credits to peer device when IBluetoothSocket.opened() is successful.
+ */
+ int initialRxCredits;
+
+ /**
+ * Protocol initial credits at Tx path.
+ */
+ int initialTxCredits;
+
+ /**
+ * Data Link Connection Identifier (DLCI).
+ */
+ int dlci;
+
+ /**
+ * Maximum frame size negotiated during DLCI establishment.
+ */
+ int maxFrameSize;
+
+ /**
+ * Flag of whether the Android stack initiated the RFCOMM multiplexer control channel.
+ *
+ * This flag determines the value of the Command/Response (C/R) bit of RFCOMM frames.
+ */
+ boolean muxInitiator;
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketCapabilities.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketCapabilities.aidl
new file mode 100644
index 0000000..05a59ee
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketCapabilities.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+import android.hardware.bluetooth.socket.LeCocCapabilities;
+import android.hardware.bluetooth.socket.RfcommCapabilities;
+
+/**
+ * Supported socket protocol capabilities.
+ */
+@VintfStability
+parcelable SocketCapabilities {
+ /**
+ * Supported LE CoC protocol capabilities.
+ */
+ LeCocCapabilities leCocCapabilities;
+
+ /**
+ * Supported RFCOMM protocol capabilities.
+ */
+ RfcommCapabilities rfcommCapabilities;
+}
diff --git a/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketContext.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketContext.aidl
new file mode 100644
index 0000000..1f9be07
--- /dev/null
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/SocketContext.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.socket;
+
+import android.hardware.bluetooth.socket.ChannelInfo;
+import android.hardware.contexthub.EndpointId;
+
+/**
+ * Socket context.
+ */
+@VintfStability
+parcelable SocketContext {
+ /**
+ * Identifier assigned to the socket by the host stack when the socket is connected to a remote
+ * device. Used to uniquely identify the socket in other callbacks and method invocations. It is
+ * valid only while the socket is connected.
+ */
+ long socketId;
+
+ /**
+ * Descriptive socket name provided by the host app when it creates this socket. This is not
+ * unique across the system, but can help the offload app understand the purpose of the socket
+ * when it receives a socket connection event.
+ */
+ String name;
+
+ /**
+ * ACL connection handle for the socket.
+ */
+ int aclConnectionHandle;
+
+ /**
+ * Channel information of the socket protocol.
+ */
+ ChannelInfo channelInfo;
+
+ /**
+ * Unique identifier for an endpoint at the hardware offload data path.
+ */
+ EndpointId endpointId;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/Status.aidl
similarity index 82%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
copy to bluetooth/socket/aidl/android/hardware/bluetooth/socket/Status.aidl
index f9f608d..d881b09 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
+++ b/bluetooth/socket/aidl/android/hardware/bluetooth/socket/Status.aidl
@@ -13,6 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package android.hardware.security.see.hwcrypto.types;
-parcelable Void {}
+package android.hardware.bluetooth.socket;
+
+@VintfStability
+@Backing(type="int")
+enum Status {
+ SUCCESS,
+ FAILURE,
+}
diff --git a/bluetooth/socket/aidl/default/Android.bp b/bluetooth/socket/aidl/default/Android.bp
new file mode 100644
index 0000000..a730057
--- /dev/null
+++ b/bluetooth/socket/aidl/default/Android.bp
@@ -0,0 +1,48 @@
+package {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_binary {
+ name: "android.hardware.bluetooth.socket-service.default",
+ relative_install_path: "hw",
+ init_rc: ["bluetooth-socket-service-default.rc"],
+ vintf_fragments: [":manifest_android.hardware.bluetooth.socket-service.default.xml"],
+ vendor: true,
+ srcs: [
+ "BluetoothSocket.cpp",
+ "service.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.bluetooth.socket-V1-ndk",
+ "libbase",
+ "libbinder_ndk",
+ "libhidlbase",
+ "libutils",
+ "liblog",
+ ],
+}
+
+cc_fuzz {
+ name: "android.hardware.bluetooth.socket-service_fuzzer",
+ team: "trendy_team_bluetooth",
+ defaults: ["service_fuzzer_defaults"],
+ srcs: [
+ "fuzzer.cpp",
+ "BluetoothSocket.cpp",
+ ],
+ static_libs: [
+ "android.hardware.bluetooth.socket-V1-ndk",
+ "android.hardware.contexthub-V4-ndk",
+ "liblog",
+ ],
+ fuzz_config: {
+ cc: [
+ "jaydenk@google.com",
+ ],
+ },
+}
+
+filegroup {
+ name: "manifest_android.hardware.bluetooth.socket-service.default.xml",
+ srcs: ["bluetooth-socket-service-default.xml"],
+}
diff --git a/bluetooth/socket/aidl/default/BluetoothSocket.cpp b/bluetooth/socket/aidl/default/BluetoothSocket.cpp
new file mode 100644
index 0000000..5993393
--- /dev/null
+++ b/bluetooth/socket/aidl/default/BluetoothSocket.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "BluetoothSocket.h"
+
+using aidl::android::hardware::bluetooth::socket::Status;
+
+namespace aidl::android::hardware::bluetooth::socket::impl {
+
+BluetoothSocket::BluetoothSocket() {}
+BluetoothSocket::~BluetoothSocket() {}
+
+::ndk::ScopedAStatus BluetoothSocket::registerCallback(
+ const std::shared_ptr<
+ ::aidl::android::hardware::bluetooth::socket::IBluetoothSocketCallback>&
+ in_callback) {
+ if (in_callback == nullptr) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(STATUS_BAD_VALUE);
+ }
+ callback_ = in_callback;
+ return ::ndk::ScopedAStatus::ok();
+}
+::ndk::ScopedAStatus BluetoothSocket::getSocketCapabilities(
+ ::aidl::android::hardware::bluetooth::socket::SocketCapabilities*
+ _aidl_return) {
+ _aidl_return->leCocCapabilities.numberOfSupportedSockets = 0;
+ _aidl_return->leCocCapabilities.mtu = 0;
+ _aidl_return->rfcommCapabilities.numberOfSupportedSockets = 0;
+ _aidl_return->rfcommCapabilities.maxFrameSize = 0;
+ return ::ndk::ScopedAStatus::ok();
+}
+::ndk::ScopedAStatus BluetoothSocket::opened(
+ const ::aidl::android::hardware::bluetooth::socket::SocketContext&
+ /* in_context */) {
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+::ndk::ScopedAStatus BluetoothSocket::closed(int64_t /*in_socketId*/) {
+ return ::ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::bluetooth::socket::impl
diff --git a/bluetooth/socket/aidl/default/BluetoothSocket.h b/bluetooth/socket/aidl/default/BluetoothSocket.h
new file mode 100644
index 0000000..9bb41ec
--- /dev/null
+++ b/bluetooth/socket/aidl/default/BluetoothSocket.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/bluetooth/socket/BnBluetoothSocket.h>
+
+namespace aidl::android::hardware::bluetooth::socket::impl {
+
+class BluetoothSocket : public BnBluetoothSocket {
+ public:
+ BluetoothSocket();
+ ~BluetoothSocket();
+
+ ::ndk::ScopedAStatus registerCallback(
+ const std::shared_ptr<::aidl::android::hardware::bluetooth::socket::
+ IBluetoothSocketCallback>& in_callback)
+ override;
+ ::ndk::ScopedAStatus getSocketCapabilities(
+ ::aidl::android::hardware::bluetooth::socket::SocketCapabilities*
+ _aidl_return) override;
+ ::ndk::ScopedAStatus opened(
+ const ::aidl::android::hardware::bluetooth::socket::SocketContext&
+ in_context) override;
+ ::ndk::ScopedAStatus closed(int64_t in_socketId) override;
+
+ private:
+ std::shared_ptr<IBluetoothSocketCallback> callback_;
+};
+
+} // namespace aidl::android::hardware::bluetooth::socket::impl
diff --git a/bluetooth/socket/aidl/default/bluetooth-socket-service-default.rc b/bluetooth/socket/aidl/default/bluetooth-socket-service-default.rc
new file mode 100644
index 0000000..f1eb7f7
--- /dev/null
+++ b/bluetooth/socket/aidl/default/bluetooth-socket-service-default.rc
@@ -0,0 +1,4 @@
+service vendor.bluetooth.socket-default /vendor/bin/hw/android.hardware.bluetooth.socket-service.default
+ class hal
+ user nobody
+ group nobody
diff --git a/bluetooth/socket/aidl/default/bluetooth-socket-service-default.xml b/bluetooth/socket/aidl/default/bluetooth-socket-service-default.xml
new file mode 100644
index 0000000..b97074d
--- /dev/null
+++ b/bluetooth/socket/aidl/default/bluetooth-socket-service-default.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.bluetooth.socket</name>
+ <version>1</version>
+ <fqname>IBluetoothSocket/default</fqname>
+ </hal>
+</manifest>
diff --git a/bluetooth/socket/aidl/default/fuzzer.cpp b/bluetooth/socket/aidl/default/fuzzer.cpp
new file mode 100644
index 0000000..062db0f
--- /dev/null
+++ b/bluetooth/socket/aidl/default/fuzzer.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <fuzzbinder/libbinder_ndk_driver.h>
+#include <fuzzer/FuzzedDataProvider.h>
+
+#include "BluetoothSocket.h"
+
+using ::aidl::android::hardware::bluetooth::socket::impl::BluetoothSocket;
+using ::android::fuzzService;
+using ::ndk::SharedRefBase;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ auto bluetoothSocketAidl = SharedRefBase::make<BluetoothSocket>();
+
+ fuzzService(bluetoothSocketAidl->asBinder().get(),
+ FuzzedDataProvider(data, size));
+
+ return 0;
+}
diff --git a/bluetooth/socket/aidl/default/service.cpp b/bluetooth/socket/aidl/default/service.cpp
new file mode 100644
index 0000000..bd15084
--- /dev/null
+++ b/bluetooth/socket/aidl/default/service.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "aidl.android.hardware.bluetooth.socket.service.default"
+
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <utils/Log.h>
+
+#include "BluetoothSocket.h"
+
+using ::aidl::android::hardware::bluetooth::socket::impl::BluetoothSocket;
+
+int main(int /* argc */, char** /* argv */) {
+ ALOGI("Bluetooth Socket HAL registering");
+ if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) {
+ ALOGE("Failed to set thread pool max thread count");
+ return 1;
+ }
+
+ std::shared_ptr<BluetoothSocket> service =
+ ndk::SharedRefBase::make<BluetoothSocket>();
+ std::string instance =
+ std::string() + BluetoothSocket::descriptor + "/default";
+ auto result =
+ AServiceManager_addService(service->asBinder().get(), instance.c_str());
+ if (result == STATUS_OK) {
+ ABinderProcess_joinThreadPool();
+ } else {
+ ALOGE("Could not register as a service!");
+ }
+ return EXIT_FAILURE;
+}
diff --git a/bluetooth/socket/aidl/vts/Android.bp b/bluetooth/socket/aidl/vts/Android.bp
new file mode 100644
index 0000000..c1ba562
--- /dev/null
+++ b/bluetooth/socket/aidl/vts/Android.bp
@@ -0,0 +1,28 @@
+package {
+ default_team: "trendy_team_bluetooth",
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalBluetoothSocketTargetTest",
+ defaults: [
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalBluetoothSocketTargetTest.cpp"],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "liblog",
+ "libutils",
+ ],
+ static_libs: [
+ "android.hardware.bluetooth.socket-V1-ndk",
+ "android.hardware.contexthub-V4-ndk",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+ require_root: true,
+}
diff --git a/bluetooth/socket/aidl/vts/VtsHalBluetoothSocketTargetTest.cpp b/bluetooth/socket/aidl/vts/VtsHalBluetoothSocketTargetTest.cpp
new file mode 100644
index 0000000..1069207
--- /dev/null
+++ b/bluetooth/socket/aidl/vts/VtsHalBluetoothSocketTargetTest.cpp
@@ -0,0 +1,182 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/bluetooth/socket/BnBluetoothSocketCallback.h>
+#include <aidl/android/hardware/bluetooth/socket/IBluetoothSocket.h>
+#include <aidl/android/hardware/bluetooth/socket/IBluetoothSocketCallback.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <binder/IServiceManager.h>
+#include <utils/Log.h>
+
+#include <future>
+
+using ::aidl::android::hardware::bluetooth::socket::BnBluetoothSocketCallback;
+using ::aidl::android::hardware::bluetooth::socket::IBluetoothSocket;
+using ::aidl::android::hardware::bluetooth::socket::SocketCapabilities;
+using ::aidl::android::hardware::bluetooth::socket::SocketContext;
+using ::ndk::ScopedAStatus;
+
+namespace {
+constexpr static int kCallbackTimeoutMs = 250;
+constexpr static int kOpenedCallbackTimeoutMs = 5000;
+} // namespace
+
+class BluetoothSocketCallback : public BnBluetoothSocketCallback {
+ public:
+ BluetoothSocketCallback(
+ const std::function<
+ void(int64_t in_socketId,
+ ::aidl::android::hardware::bluetooth::socket::Status in_status,
+ const std::string& in_reason)>& on_hal_opened_complete_cb)
+ : on_hal_opened_complete_cb_(on_hal_opened_complete_cb) {}
+
+ ScopedAStatus openedComplete(
+ int64_t in_socketId,
+ ::aidl::android::hardware::bluetooth::socket::Status in_status,
+ const std::string& in_reason) override {
+ on_hal_opened_complete_cb_(in_socketId, in_status, in_reason);
+ return ::ndk::ScopedAStatus::ok();
+ }
+
+ ScopedAStatus close(int64_t /* in_socketId */,
+ const std::string& /* in_reason */) override {
+ return ::ndk::ScopedAStatus::ok();
+ }
+
+ private:
+ std::function<void(
+ int64_t in_socketId,
+ ::aidl::android::hardware::bluetooth::socket::Status in_status,
+ const std::string& in_reason)>
+ on_hal_opened_complete_cb_;
+};
+
+class BluetoothSocketTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ ALOGI("SetUp Socket Test");
+ bluetooth_socket_ = IBluetoothSocket::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(bluetooth_socket_, nullptr);
+ }
+
+ virtual void TearDown() override {
+ ALOGI("TearDown Socket Test");
+ bluetooth_socket_ = nullptr;
+ ASSERT_EQ(bluetooth_socket_, nullptr);
+ }
+
+ std::shared_ptr<IBluetoothSocket> bluetooth_socket_;
+};
+
+TEST_P(BluetoothSocketTest, registerCallback) {
+ std::promise<void> open_cb_promise;
+ std::future<void> open_cb_future{open_cb_promise.get_future()};
+ std::shared_ptr<BluetoothSocketCallback> callback =
+ ndk::SharedRefBase::make<BluetoothSocketCallback>(
+ [&open_cb_promise](auto /* socket_id */, auto /* status */,
+ auto /* reason */) {
+ open_cb_promise.set_value();
+ });
+ ScopedAStatus status = bluetooth_socket_->registerCallback(callback);
+ ASSERT_TRUE(status.isOk());
+}
+
+TEST_P(BluetoothSocketTest, GetSocketCapabilities) {
+ SocketCapabilities socket_capabilities;
+ ScopedAStatus status =
+ bluetooth_socket_->getSocketCapabilities(&socket_capabilities);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_TRUE(socket_capabilities.leCocCapabilities.numberOfSupportedSockets >=
+ 0);
+ if (socket_capabilities.leCocCapabilities.numberOfSupportedSockets) {
+ // When LE COC is supported, the local MTU must be configured within the
+ // valid range defined in the L2CAP specification.
+ ASSERT_TRUE(socket_capabilities.leCocCapabilities.mtu >= 23 &&
+ socket_capabilities.leCocCapabilities.mtu <= 65535);
+ }
+ ASSERT_TRUE(socket_capabilities.rfcommCapabilities.numberOfSupportedSockets >=
+ 0);
+ if (socket_capabilities.rfcommCapabilities.numberOfSupportedSockets) {
+ // When RFCOMM is supported, the maximum frame size must be configured
+ // within the valid range defined in the RFCOMM specification.
+ ASSERT_TRUE(socket_capabilities.rfcommCapabilities.maxFrameSize >= 23 &&
+ socket_capabilities.rfcommCapabilities.maxFrameSize <= 32767);
+ }
+}
+
+TEST_P(BluetoothSocketTest, Opened) {
+ std::promise<void> open_cb_promise;
+ std::future<void> open_cb_future{open_cb_promise.get_future()};
+ std::shared_ptr<BluetoothSocketCallback> callback =
+ ndk::SharedRefBase::make<BluetoothSocketCallback>(
+ [&open_cb_promise](auto /* socket_id */, auto /* status */,
+ auto /* reason */) {
+ open_cb_promise.set_value();
+ });
+ bluetooth_socket_->registerCallback(callback);
+ SocketCapabilities socket_capabilities;
+ bluetooth_socket_->getSocketCapabilities(&socket_capabilities);
+
+ SocketContext socket_context;
+ ScopedAStatus status = bluetooth_socket_->opened(socket_context);
+ std::chrono::milliseconds timeout{kOpenedCallbackTimeoutMs};
+ if (status.isOk()) {
+ // If IBluetoothSocket.opened() returns success, the callback
+ // BluetoothSocketCallback.openedComplete() must be called within the
+ // timeout.
+ EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready);
+ } else {
+ // If IBluetoothSocket.opened() returns failure, the callback
+ // BluetoothSocketCallback.openedComplete() must not be called.
+ EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::timeout);
+ }
+}
+
+TEST_P(BluetoothSocketTest, Closed) {
+ std::promise<void> open_cb_promise;
+ std::future<void> open_cb_future{open_cb_promise.get_future()};
+ std::shared_ptr<BluetoothSocketCallback> callback =
+ ndk::SharedRefBase::make<BluetoothSocketCallback>(
+ [&open_cb_promise](auto /* socket_id */, auto /* status */,
+ auto /* reason */) {
+ open_cb_promise.set_value();
+ });
+ bluetooth_socket_->registerCallback(callback);
+ SocketCapabilities socket_capabilities;
+ bluetooth_socket_->getSocketCapabilities(&socket_capabilities);
+
+ long socket_id = 1;
+ bluetooth_socket_->closed(socket_id);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothSocketTest);
+INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothSocketTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(
+ IBluetoothSocket::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_startThreadPool();
+ int status = RUN_ALL_TESTS();
+ ALOGI("Test result = %d", status);
+ return status;
+}
diff --git a/broadcastradio/aidl/default/fuzzer.cpp b/broadcastradio/aidl/default/fuzzer.cpp
index d535432..2492d47 100644
--- a/broadcastradio/aidl/default/fuzzer.cpp
+++ b/broadcastradio/aidl/default/fuzzer.cpp
@@ -24,6 +24,8 @@
using ::android::fuzzService;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // TODO(b/183141167): need to rewrite 'dump' to avoid SIGPIPE.
+ signal(SIGPIPE, SIG_IGN);
const VirtualRadio& amFmRadioMock = VirtualRadio::getAmFmRadio();
std::shared_ptr<BroadcastRadio> amFmRadio =
::ndk::SharedRefBase::make<BroadcastRadio>(amFmRadioMock);
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
index 31c2dbe..9285eef 100644
--- a/camera/device/aidl/Android.bp
+++ b/camera/device/aidl/Android.bp
@@ -40,7 +40,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V1",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
@@ -50,7 +50,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
@@ -60,7 +60,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V3",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/common/aidl/Android.bp b/common/aidl/Android.bp
index 904a3d9..0ce52e7 100644
--- a/common/aidl/Android.bp
+++ b/common/aidl/Android.bp
@@ -26,7 +26,7 @@
],
},
cpp: {
- enabled: false,
+ enabled: true,
},
ndk: {
apex_available: [
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 4a3658e..7fb6368 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -28,9 +28,8 @@
sdk_version: "module_current",
},
cpp: {
- // FMQ will not be supported in the cpp backend because the parcelables
- // are not stable enough for use in shared memory
- enabled: false,
+ // FMQ is only supported for PODs with the cpp backend
+ enabled: true,
},
ndk: {
apex_available: [
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index e019902..935382e 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -139,6 +139,14 @@
</interface>
</hal>
<hal format="aidl">
+ <name>android.hardware.bluetooth.socket</name>
+ <version>1</version>
+ <interface>
+ <name>IBluetoothSocket</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
<name>android.hardware.bluetooth.finder</name>
<version>1</version>
<interface>
@@ -304,7 +312,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.security.secretkeeper</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>ISecretkeeper</name>
<instance>default</instance>
@@ -507,6 +515,14 @@
<instance>nonsecure</instance>
</interface>
</hal>
+ <hal format="aidl">
+ <name>android.hardware.security.see.hwcrypto</name>
+ <version>1</version>
+ <interface>
+ <name>IHwCryptoKey</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.security.secureclock</name>
<version>1</version>
@@ -637,6 +653,15 @@
</interface>
</hal>
<hal format="aidl">
+ <name>android.hardware.virtualization.capabilities</name>
+ <version>1</version>
+ <interface>
+ <name>IVmCapabilitiesService</name>
+ <instance>default</instance>
+ <instance>noop</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
<name>android.hardware.weaver</name>
<version>2</version>
<interface>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index b86f399..61fb2b3 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -156,6 +156,8 @@
// 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.
"android.hardware.fastboot@",
+ "android.hardware.security.see.hwcrypto.types",
+ "android.hardware.security.see.storage",
};
static std::vector<std::string> excluded_exact{
@@ -165,6 +167,8 @@
"android.hardware.audio.core.sounddose@1",
"android.hardware.audio.core.sounddose@2",
"android.hardware.audio.core.sounddose@3",
+ // This is only used by a trusty VM
+ "android.hardware.security.see.authmgr@1",
// Deprecated HALs.
"android.hardware.audio.sounddose@3",
diff --git a/configstore/1.1/default/Android.bp b/configstore/1.1/default/Android.bp
new file mode 100644
index 0000000..34470ad
--- /dev/null
+++ b/configstore/1.1/default/Android.bp
@@ -0,0 +1,142 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//###############################################################################
+package {
+ // See: http://go/android-license-faq
+ default_applicable_licenses: [
+ "hardware_interfaces_license",
+ ],
+}
+
+soong_config_module_type {
+ name: "surfaceflinger_cc_defaults_type",
+ module_type: "cc_defaults",
+ config_namespace: "surfaceflinger",
+ value_variables: [
+ "vsync_event_phase_offset_ns",
+ "sf_vsync_event_phase_offset_ns",
+ "present_time_offset_from_vsync_ns",
+ "max_virtual_displat_dimension",
+ "num_framebuffer_surface_buffers",
+ "sf_primary_display_orientation",
+ ],
+ bool_variables: [
+ "use_context_priority",
+ "has_wide_color_display",
+ "has_hdr_display",
+ "force_hwc_copy_for_virtual_displays",
+ "running_without_sync_framework",
+ "use_vr_flinger",
+ "sf_start_graphics_allocator_service",
+ ],
+ properties: [
+ "cflags",
+ ],
+}
+
+surfaceflinger_cc_defaults_type {
+ name: "surfaceflinger_cc_defaults",
+ srcs: [
+ "SurfaceFlingerConfigs.cpp",
+ ],
+ soong_config_variables: {
+ vsync_event_phase_offset_ns: {
+ cflags: ["-DVSYNC_EVENT_PHASE_OFFSET_NS=%s"],
+ },
+ sf_vsync_event_phase_offset_ns: {
+ cflags: ["-DSF_VSYNC_EVENT_PHASE_OFFSET_NS=%s"],
+ },
+ present_time_offset_from_vsync_ns: {
+ cflags: ["-DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=%s"],
+ },
+ max_virtual_displat_dimension: {
+ cflags: ["-DMAX_VIRTUAL_DISPLAY_DIMENSION=%s"],
+ },
+ num_framebuffer_surface_buffers: {
+ cflags: ["-DNUM_FRAMEBUFFER_SURFACE_BUFFERS=%s"],
+ },
+ sf_primary_display_orientation: {
+ cflags: ["-DPRIMARY_DISPLAY_ORIENTATION=%s"],
+ },
+ use_context_priority: {
+ cflags: ["-DUSE_CONTEXT_PRIORITY=1"],
+ },
+ has_wide_color_display: {
+ cflags: ["-DHAS_WIDE_COLOR_DISPLAY"],
+ },
+ has_hdr_display: {
+ cflags: ["-DHAS_HDR_DISPLAY"],
+ },
+ force_hwc_copy_for_virtual_displays: {
+ cflags: ["-DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS"],
+ },
+ running_without_sync_framework: {
+ cflags: ["-DRUNNING_WITHOUT_SYNC_FRAMEWORK"],
+ },
+ use_vr_flinger: {
+ cflags: ["-DUSE_VR_FLINGER"],
+ },
+ sf_start_graphics_allocator_service: {
+ cflags: ["-DSTART_GRAPHICS_ALLOCATOR_SERVICE"],
+ },
+ },
+}
+
+cc_binary {
+ name: "android.hardware.configstore@1.1-service",
+ srcs: ["service.cpp"],
+ vendor: true,
+ relative_install_path: "hw",
+ init_rc: ["android.hardware.configstore@1.1-service.rc"],
+ shared_libs: [
+ "libhidlbase",
+ "libbase",
+ "libhwminijail",
+ "liblog",
+ "libutils",
+ "android.hardware.configstore@1.0",
+ "android.hardware.configstore@1.1",
+ ],
+ defaults: [
+ "surfaceflinger_cc_defaults",
+ ],
+ required: select((arch(), soong_config_variable("ANDROID", "GCOV_COVERAGE")), {
+ ("arm64", false): ["configstore@1.1.policy"],
+ (default, default): [],
+ }),
+}
+
+// Only build for arm64
+prebuilt_etc {
+ name: "configstore@1.1.policy",
+ relative_install_path: "seccomp_policy",
+ proprietary: true,
+ enabled: false,
+ arch: {
+ arm64: {
+ src: "seccomp_policy/configstore@1.1-arm64.policy",
+ enabled: true,
+ },
+ },
+}
+
+// disable configstore
+cc_binary {
+ name: "disable_configstore",
+ installable: false,
+ srcs: ["disable_configstore.cpp"],
+ overrides: ["android.hardware.configstore@1.1-service"],
+ vendor: true,
+}
diff --git a/configstore/1.1/default/Android.mk b/configstore/1.1/default/Android.mk
deleted file mode 100644
index 9a6f0fc..0000000
--- a/configstore/1.1/default/Android.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-################################################################################
-include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.1-service
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../NOTICE
-# seccomp is not required for coverage build.
-ifneq ($(NATIVE_COVERAGE),true)
-LOCAL_REQUIRED_MODULES_arm64 := configstore@1.1.policy
-endif
-LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_INIT_RC := android.hardware.configstore@1.1-service.rc
-LOCAL_SRC_FILES:= service.cpp
-
-include $(LOCAL_PATH)/surfaceflinger.mk
-
-LOCAL_SHARED_LIBRARIES := \
- libhidlbase \
- libbase \
- libhwminijail \
- liblog \
- libutils \
- android.hardware.configstore@1.0 \
- android.hardware.configstore@1.1
-
-include $(BUILD_EXECUTABLE)
-
-# seccomp filter for configstore
-ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm64))
-include $(CLEAR_VARS)
-LOCAL_MODULE := configstore@1.1.policy
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../NOTICE
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc/seccomp_policy
-LOCAL_SRC_FILES := seccomp_policy/configstore@1.1-$(TARGET_ARCH).policy
-include $(BUILD_PREBUILT)
-endif
-
-# disable configstore
-include $(CLEAR_VARS)
-LOCAL_MODULE := disable_configstore
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../../NOTICE
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_SRC_FILES:= disable_configstore.cpp
-LOCAL_OVERRIDES_MODULES := android.hardware.configstore@1.1-service
-LOCAL_VENDOR_MODULE := true
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_EXECUTABLE)
diff --git a/configstore/1.1/default/surfaceflinger.mk b/configstore/1.1/default/surfaceflinger.mk
index 35922eb..462fe85 100644
--- a/configstore/1.1/default/surfaceflinger.mk
+++ b/configstore/1.1/default/surfaceflinger.mk
@@ -2,55 +2,69 @@
LOCAL_SRC_FILES += SurfaceFlingerConfigs.cpp
ifneq ($(VSYNC_EVENT_PHASE_OFFSET_NS),)
+ $(call soong_config_set,surfaceflinger,vsync_event_phase_offset_ns,$(VSYNC_EVENT_PHASE_OFFSET_NS))
LOCAL_CFLAGS += -DVSYNC_EVENT_PHASE_OFFSET_NS=$(VSYNC_EVENT_PHASE_OFFSET_NS)
endif
ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
+ $(call soong_config_set,surfaceflinger,sf_vsync_event_phase_offset_ns,$(SF_VSYNC_EVENT_PHASE_OFFSET_NS))
LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
endif
ifeq ($(TARGET_USE_CONTEXT_PRIORITY),true)
+ $(call soong_config_set_bool,surfaceflinger,use_context_priority,true)
LOCAL_CFLAGS += -DUSE_CONTEXT_PRIORITY=1
endif
ifeq ($(TARGET_HAS_WIDE_COLOR_DISPLAY),true)
+ $(call soong_config_set_bool,surfaceflinger,has_wide_color_display,true)
LOCAL_CFLAGS += -DHAS_WIDE_COLOR_DISPLAY
endif
ifeq ($(TARGET_HAS_HDR_DISPLAY),true)
+ $(call soong_config_set_bool,surfaceflinger,has_hdr_display,true)
LOCAL_CFLAGS += -DHAS_HDR_DISPLAY
endif
ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
+ $(call soong_config_set,surfaceflinger,present_time_offset_from_vsync_ns,$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS))
LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=$(PRESENT_TIME_OFFSET_FROM_VSYNC_NS)
else
+ $(call soong_config_set,surfaceflinger,present_time_offset_from_vsync_ns,0)
LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
endif
ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
+ $(call soong_config_set_bool,surfaceflinger,force_hwc_copy_for_virtual_displays,true)
LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
endif
ifneq ($(MAX_VIRTUAL_DISPLAY_DIMENSION),)
+ $(call soong_config_set,surfaceflinger,max_virtual_displat_dimension,$(MAX_VIRTUAL_DISPLAY_DIMENSION))
LOCAL_CFLAGS += -DMAX_VIRTUAL_DISPLAY_DIMENSION=$(MAX_VIRTUAL_DISPLAY_DIMENSION)
endif
ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
+ $(call soong_config_set_bool,surfaceflinger,running_without_sync_framework,true)
LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
endif
ifneq ($(USE_VR_FLINGER),)
+ $(call soong_config_set_bool,surfaceflinger,use_vr_flinger,true)
LOCAL_CFLAGS += -DUSE_VR_FLINGER
endif
ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
+ $(call soong_config_set,surfaceflinger,num_framebuffer_surface_buffers,$(NUM_FRAMEBUFFER_SURFACE_BUFFERS))
LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
endif
ifneq ($(SF_START_GRAPHICS_ALLOCATOR_SERVICE),)
+ $(call soong_config_set_bool,surfaceflinger,sf_start_graphics_allocator_service,true)
LOCAL_CFLAGS += -DSTART_GRAPHICS_ALLOCATOR_SERVICE
endif
ifneq ($(SF_PRIMARY_DISPLAY_ORIENTATION),)
+ $(call soong_config_set,surfaceflinger,sf_primary_display_orientation,$(SF_PRIMARY_DISPLAY_ORIENTATION))
LOCAL_CFLAGS += -DPRIMARY_DISPLAY_ORIENTATION=$(SF_PRIMARY_DISPLAY_ORIENTATION)
endif
diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp
index eaa47c6..674f8af 100644
--- a/contexthub/aidl/Android.bp
+++ b/contexthub/aidl/Android.bp
@@ -33,7 +33,12 @@
sdk_version: "module_current",
},
ndk: {
- apps_enabled: false,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.btservices",
+ ],
+ min_sdk_version: "33",
+ apps_enabled: true,
},
rust: {
enabled: true,
diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp
index f0445a5..3636250 100644
--- a/drm/aidl/vts/drm_hal_common.cpp
+++ b/drm/aidl/vts/drm_hal_common.cpp
@@ -27,6 +27,7 @@
#include <android/binder_process.h>
#include <android/sharedmem.h>
#include <cutils/native_handle.h>
+#include <cutils/properties.h>
#include "drm_hal_clearkey_module.h"
#include "drm_hal_common.h"
@@ -193,6 +194,13 @@
GTEST_SKIP() << "No vendor module installed";
}
+ char bootloader_state[PROPERTY_VALUE_MAX] = {};
+ if (property_get("ro.boot.vbmeta.device_state", bootloader_state, "") != 0) {
+ if (!strcmp(bootloader_state, "unlocked")) {
+ GTEST_SKIP() << "Skip test because bootloader is unlocked";
+ }
+ }
+
if (drmInstance.find("IDrmFactory") != std::string::npos) {
drmFactory = IDrmFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str())));
diff --git a/graphics/Android.bp b/graphics/Android.bp
index ac5c17f..8c6b3e5 100644
--- a/graphics/Android.bp
+++ b/graphics/Android.bp
@@ -56,28 +56,28 @@
aidl_interface_defaults {
name: "android.hardware.graphics.common-latest",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
}
rust_defaults {
name: "android.hardware.graphics.common-latest-rust",
rustlibs: [
- "android.hardware.graphics.common-V5-rust",
+ "android.hardware.graphics.common-V6-rust",
],
}
cc_defaults {
name: "android.hardware.graphics.common-ndk_static",
static_libs: [
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
],
}
cc_defaults {
name: "android.hardware.graphics.common-ndk_shared",
shared_libs: [
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
],
}
diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp
index 30b341c..3f74b23 100644
--- a/graphics/allocator/aidl/Android.bp
+++ b/graphics/allocator/aidl/Android.bp
@@ -45,7 +45,7 @@
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index ace940a..d24897d 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -58,21 +58,21 @@
{
version: "1",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
{
version: "2",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
{
version: "3",
imports: [
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
"android.hardware.common-V2",
],
},
diff --git a/graphics/composer/aidl/vts/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h
index bbe508f..6553720 100644
--- a/graphics/composer/aidl/vts/RenderEngineVts.h
+++ b/graphics/composer/aidl/vts/RenderEngineVts.h
@@ -51,9 +51,10 @@
private:
common::PixelFormat mFormat;
- std::vector<::android::renderengine::LayerSettings> mCompositionLayers;
std::unique_ptr<::android::renderengine::RenderEngine> mRenderEngine;
- std::vector<::android::renderengine::LayerSettings> mRenderLayers;
+ // Delete RenderEngine layers before RenderEngine -- ExternalTexture holds a reference to
+ // RenderEngine.
+ std::vector<::android::renderengine::LayerSettings> mCompositionLayers;
::android::sp<::android::GraphicBuffer> mGraphicBuffer;
DisplaySettings mDisplaySettings;
diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp
index c5f124c..1be460e 100644
--- a/graphics/mapper/4.0/utils/vts/Android.bp
+++ b/graphics/mapper/4.0/utils/vts/Android.bp
@@ -48,7 +48,7 @@
],
export_static_lib_headers: [
"android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.common-V5-ndk",
+ "android.hardware.graphics.common-V6-ndk",
"android.hardware.graphics.mapper@4.0",
],
export_include_dirs: ["include"],
diff --git a/light/2.0/vts/functional/Android.bp b/light/2.0/vts/functional/Android.bp
index 91fb847..53e5446 100644
--- a/light/2.0/vts/functional/Android.bp
+++ b/light/2.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/light/aidl/vts/functional/Android.bp b/light/aidl/vts/functional/Android.bp
index 16804ea..ba05e2b 100644
--- a/light/aidl/vts/functional/Android.bp
+++ b/light/aidl/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/neuralnetworks/1.0/vts/functional/Android.bp b/neuralnetworks/1.0/vts/functional/Android.bp
index 8048e62..ed0e72b 100644
--- a/neuralnetworks/1.0/vts/functional/Android.bp
+++ b/neuralnetworks/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/neuralnetworks/1.1/vts/functional/Android.bp b/neuralnetworks/1.1/vts/functional/Android.bp
index 7c1c118..e65735f 100644
--- a/neuralnetworks/1.1/vts/functional/Android.bp
+++ b/neuralnetworks/1.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/neuralnetworks/1.2/utils/test/DeviceTest.cpp b/neuralnetworks/1.2/utils/test/DeviceTest.cpp
index 0e855c4..0d8c141 100644
--- a/neuralnetworks/1.2/utils/test/DeviceTest.cpp
+++ b/neuralnetworks/1.2/utils/test/DeviceTest.cpp
@@ -54,10 +54,6 @@
.execTime = std::numeric_limits<float>::max(),
.powerUsage = std::numeric_limits<float>::max()};
-// FIXME: This function causes Clang to hang indefinitely when building with
-// -O1. Turn off optimization as a temporary workaround.
-// http://b/296850773
-#pragma clang optimize off
template <typename... Args>
auto makeCallbackReturn(Args&&... args) {
return [argPack = std::make_tuple(std::forward<Args>(args)...)](const auto& cb) {
@@ -65,7 +61,6 @@
return Void();
};
}
-#pragma clang optimize on
sp<MockDevice> createMockDevice() {
const auto mockDevice = MockDevice::create();
diff --git a/neuralnetworks/1.2/vts/functional/Android.bp b/neuralnetworks/1.2/vts/functional/Android.bp
index 7e4b5bb..0a3c577 100644
--- a/neuralnetworks/1.2/vts/functional/Android.bp
+++ b/neuralnetworks/1.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp
index 9589750..45b34e6 100644
--- a/neuralnetworks/aidl/Android.bp
+++ b/neuralnetworks/aidl/Android.bp
@@ -43,28 +43,28 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "3",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
{
version: "4",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V5",
+ "android.hardware.graphics.common-V6",
],
},
diff --git a/neuralnetworks/aidl/vts/functional/Android.bp b/neuralnetworks/aidl/vts/functional/Android.bp
index 04b4a45..20686c1 100644
--- a/neuralnetworks/aidl/vts/functional/Android.bp
+++ b/neuralnetworks/aidl/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_kernel",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/nfc/aidl/Android.bp b/nfc/aidl/Android.bp
index b34e4f2..1ffd274 100644
--- a/nfc/aidl/Android.bp
+++ b/nfc/aidl/Android.bp
@@ -33,8 +33,9 @@
enabled: false,
},
java: {
- sdk_version: "module_current",
enabled: false,
+ sdk_version: "module_current",
+ min_sdk_version: "35",
},
ndk: {
enabled: true,
@@ -42,6 +43,7 @@
"//apex_available:platform",
"com.android.nfcservices",
],
+ min_sdk_version: "35",
},
rust: {
enabled: true,
diff --git a/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/NfcConfig.aidl b/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/NfcConfig.aidl
index 0261a0a..4fdfae8 100644
--- a/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/NfcConfig.aidl
+++ b/nfc/aidl/aidl_api/android.hardware.nfc/current/android/hardware/nfc/NfcConfig.aidl
@@ -50,4 +50,5 @@
byte[] offHostRouteEse;
byte defaultIsoDepRoute;
byte[] offHostSimPipeIds = {};
+ boolean t4tNfceeEnable;
}
diff --git a/nfc/aidl/android/hardware/nfc/NfcConfig.aidl b/nfc/aidl/android/hardware/nfc/NfcConfig.aidl
index 870cdbd..86eee8b 100644
--- a/nfc/aidl/android/hardware/nfc/NfcConfig.aidl
+++ b/nfc/aidl/android/hardware/nfc/NfcConfig.aidl
@@ -90,4 +90,8 @@
* Pipe IDs for UICC. Empty if not available
*/
byte[] offHostSimPipeIds = {};
+ /**
+ * T4T NFCEE feature configuration
+ */
+ boolean t4tNfceeEnable;
}
diff --git a/oemlock/1.0/vts/functional/Android.bp b/oemlock/1.0/vts/functional/Android.bp
index f1b8d2f..80b4fdb 100644
--- a/oemlock/1.0/vts/functional/Android.bp
+++ b/oemlock/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_pixel_watch_system_software",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/oemlock/aidl/vts/Android.bp b/oemlock/aidl/vts/Android.bp
index eb999a9..e19bc6a 100644
--- a/oemlock/aidl/vts/Android.bp
+++ b/oemlock/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_pixel_watch_system_software",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/power/OWNERS b/power/OWNERS
index 95778a4..13895bd 100644
--- a/power/OWNERS
+++ b/power/OWNERS
@@ -1,6 +1,3 @@
# Bug component: 826709
-
-# ADPF virtual team
-lpy@google.com
-wvw@google.com
file:platform/frameworks/base:/ADPF_OWNERS
+wvw@google.com
diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp
index eca9a27..01c09d8 100644
--- a/radio/aidl/Android.bp
+++ b/radio/aidl/Android.bp
@@ -14,6 +14,7 @@
host_supported: true,
srcs: ["android/hardware/radio/*.aidl"],
stability: "vintf",
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -48,6 +49,7 @@
srcs: ["android/hardware/radio/config/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -82,6 +84,7 @@
srcs: ["android/hardware/radio/data/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -115,6 +118,7 @@
srcs: ["android/hardware/radio/messaging/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -148,6 +152,7 @@
srcs: ["android/hardware/radio/modem/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -181,6 +186,7 @@
srcs: ["android/hardware/radio/network/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -213,6 +219,7 @@
host_supported: true,
srcs: ["android/hardware/radio/sap/*.aidl"],
stability: "vintf",
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -241,6 +248,7 @@
host_supported: true,
srcs: ["android/hardware/radio/sim/*.aidl"],
stability: "vintf",
+ flags: ["-Werror"],
imports: [
"android.hardware.radio-V4",
"android.hardware.radio.config-V4",
@@ -287,6 +295,7 @@
srcs: ["android/hardware/radio/voice/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: true,
@@ -322,6 +331,7 @@
"android.hardware.radio-V4",
"android.hardware.radio.data-V4",
],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: false,
@@ -356,6 +366,7 @@
srcs: ["android/hardware/radio/ims/*.aidl"],
stability: "vintf",
imports: ["android.hardware.radio-V4"],
+ flags: ["-Werror"],
backend: {
cpp: {
enabled: false,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index bc1c292..bba6bdd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -17,9 +17,10 @@
* 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.
+ * serial: which corresponds to the serial number of the 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. //
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 009b428..a0ca4bf 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
@@ -33,7 +33,7 @@
package android.hardware.radio.data;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum DataCallFailCause {
NONE = 0,
OPERATOR_BARRED = 0x08,
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 7f3fdc7..d68a9d7 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
@@ -37,9 +37,9 @@
parcelable DataProfileInfo {
int profileId;
String apn;
- android.hardware.radio.data.PdpProtocolType protocol;
- android.hardware.radio.data.PdpProtocolType roamingProtocol;
- android.hardware.radio.data.ApnAuthType authType;
+ android.hardware.radio.data.PdpProtocolType protocol = android.hardware.radio.data.PdpProtocolType.IP;
+ android.hardware.radio.data.PdpProtocolType roamingProtocol = android.hardware.radio.data.PdpProtocolType.IP;
+ android.hardware.radio.data.ApnAuthType authType = android.hardware.radio.data.ApnAuthType.NO_PAP_NO_CHAP;
String user;
String password;
int type;
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 e1fedb8..f5fae50 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
@@ -33,7 +33,7 @@
package android.hardware.radio.data;
/* @hide */
-@Backing(type="byte") @JavaDerive(toString=true) @VintfStability
+@Backing(type="byte") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum DataThrottlingAction {
NO_DATA_THROTTLING,
THROTTLE_SECONDARY_CARRIER,
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 bef4c73..67d679f 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
@@ -33,7 +33,7 @@
package android.hardware.radio.data;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable LinkAddress {
String address;
int addressProperties;
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 45e2dc9..e428f1a 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
@@ -33,7 +33,7 @@
package android.hardware.radio.data;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable PortRange {
int start;
int end;
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 8864c24..80c055e 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
@@ -36,7 +36,7 @@
@JavaDerive(toString=true) @VintfStability
parcelable RouteSelectionDescriptor {
byte precedence;
- android.hardware.radio.data.PdpProtocolType sessionType;
+ android.hardware.radio.data.PdpProtocolType sessionType = android.hardware.radio.data.PdpProtocolType.IP;
byte sscMode;
android.hardware.radio.data.SliceInfo[] sliceInfo;
String[] dnn;
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 6ae626e..699cc4d 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
@@ -33,13 +33,13 @@
package android.hardware.radio.data;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable SetupDataCallResult {
- android.hardware.radio.data.DataCallFailCause cause;
+ android.hardware.radio.data.DataCallFailCause cause = android.hardware.radio.data.DataCallFailCause.NONE;
long suggestedRetryTime;
int cid;
int active;
- android.hardware.radio.data.PdpProtocolType type;
+ android.hardware.radio.data.PdpProtocolType type = android.hardware.radio.data.PdpProtocolType.IP;
String ifname;
android.hardware.radio.data.LinkAddress[] addresses;
String[] dnses;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
index 36a538c..3b38e19 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
@@ -33,8 +33,9 @@
package android.hardware.radio.ims.media;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum AmrMode {
+ INVALID = 0,
AMR_MODE_0 = (1 << 0) /* 1 */,
AMR_MODE_1 = (1 << 1) /* 2 */,
AMR_MODE_2 = (1 << 2) /* 4 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
index dcf0dd1..eb65eb1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable AmrParams {
- android.hardware.radio.ims.media.AmrMode amrMode;
+ android.hardware.radio.ims.media.AmrMode amrMode = android.hardware.radio.ims.media.AmrMode.INVALID;
boolean octetAligned;
int maxRedundancyMillis;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
index 6eefb34..1c80f7a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CodecParams {
- android.hardware.radio.ims.media.CodecType codecType;
+ android.hardware.radio.ims.media.CodecType codecType = android.hardware.radio.ims.media.CodecType.INVALID;
byte rxPayloadTypeNumber;
byte txPayloadTypeNumber;
byte samplingRateKHz;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
index 98463b1..e97a647 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
@@ -35,6 +35,7 @@
/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CodecType {
+ INVALID = 0,
AMR = (1 << 0) /* 1 */,
AMR_WB = (1 << 1) /* 2 */,
EVS = (1 << 2) /* 4 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
index 1a59389..ae0e1f7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
@@ -33,8 +33,9 @@
package android.hardware.radio.ims.media;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum EvsMode {
+ INVALID = 0,
EVS_MODE_0 = (1 << 0) /* 1 */,
EVS_MODE_1 = (1 << 1) /* 2 */,
EVS_MODE_2 = (1 << 2) /* 4 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
index deb53af..90d2204 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
@@ -35,8 +35,8 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EvsParams {
- android.hardware.radio.ims.media.EvsBandwidth bandwidth;
- android.hardware.radio.ims.media.EvsMode evsMode;
+ android.hardware.radio.ims.media.EvsBandwidth bandwidth = android.hardware.radio.ims.media.EvsBandwidth.NONE;
+ android.hardware.radio.ims.media.EvsMode evsMode = android.hardware.radio.ims.media.EvsMode.INVALID;
byte channelAwareMode;
boolean useHeaderFullOnly;
boolean useEvsModeSwitch;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 714442c..b9cc15c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -33,7 +33,7 @@
package android.hardware.radio.ims.media;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum RtcpXrReportBlockType {
RTCPXR_NONE = 0,
RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
index 472ec35..6af5523 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -36,7 +36,7 @@
@JavaDerive(toString=true) @VintfStability
parcelable RtpConfig {
int direction;
- android.hardware.radio.AccessNetwork accessNetwork;
+ android.hardware.radio.AccessNetwork accessNetwork = android.hardware.radio.AccessNetwork.UNKNOWN;
android.hardware.radio.ims.media.RtpAddress remoteAddress;
android.hardware.radio.ims.media.RtpSessionParams sessionParams;
android.hardware.radio.ims.media.RtcpConfig rtcpConfig;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
index 421f752..ae3bbac 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
@@ -35,11 +35,12 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ConnectionFailureInfo {
- android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason;
+ android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason = android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason.INVALID;
int causeCode;
int waitTimeMillis;
- @Backing(type="int") @VintfStability
+ @Backing(type="int") @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum ConnectionFailureReason {
+ INVALID = 0,
REASON_ACCESS_DENIED = 1,
REASON_NAS_FAILURE = 2,
REASON_RACH_FAILURE = 3,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
index 3895d75..73d987a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
@@ -36,10 +36,10 @@
@JavaDerive(toString=true) @VintfStability
parcelable ImsCall {
int index;
- android.hardware.radio.ims.ImsCall.CallType callType;
- android.hardware.radio.AccessNetwork accessNetwork;
- android.hardware.radio.ims.ImsCall.CallState callState;
- android.hardware.radio.ims.ImsCall.Direction direction;
+ android.hardware.radio.ims.ImsCall.CallType callType = android.hardware.radio.ims.ImsCall.CallType.NORMAL;
+ android.hardware.radio.AccessNetwork accessNetwork = android.hardware.radio.AccessNetwork.UNKNOWN;
+ android.hardware.radio.ims.ImsCall.CallState callState = android.hardware.radio.ims.ImsCall.CallState.ACTIVE;
+ android.hardware.radio.ims.ImsCall.Direction direction = android.hardware.radio.ims.ImsCall.Direction.INCOMING;
boolean isHeldByRemote;
@Backing(type="int")
enum CallType {
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
index 5b5bd40..62dc69b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
@@ -33,7 +33,7 @@
package android.hardware.radio.ims;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum ImsDeregistrationReason {
REASON_SIM_REMOVED = 1,
REASON_SIM_REFRESH = 2,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
index 66d8165..73cfd07 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
@@ -33,11 +33,11 @@
package android.hardware.radio.ims;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable ImsRegistration {
- android.hardware.radio.ims.ImsRegistrationState regState;
- android.hardware.radio.AccessNetwork accessNetworkType;
- android.hardware.radio.ims.SuggestedAction suggestedAction;
+ android.hardware.radio.ims.ImsRegistrationState regState = android.hardware.radio.ims.ImsRegistrationState.NOT_REGISTERED;
+ android.hardware.radio.AccessNetwork accessNetworkType = android.hardware.radio.AccessNetwork.UNKNOWN;
+ android.hardware.radio.ims.SuggestedAction suggestedAction = android.hardware.radio.ims.SuggestedAction.NONE;
int capabilities;
const int IMS_MMTEL_CAPABILITY_NONE = 0;
const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0) /* 1 */;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
index 21645da..a2e2ae5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
@@ -36,10 +36,10 @@
@JavaDerive(toString=true) @VintfStability
parcelable SrvccCall {
int index;
- android.hardware.radio.ims.SrvccCall.CallType callType;
+ android.hardware.radio.ims.SrvccCall.CallType callType = android.hardware.radio.ims.SrvccCall.CallType.NORMAL;
int callState;
- android.hardware.radio.ims.SrvccCall.CallSubState callSubstate;
- android.hardware.radio.ims.SrvccCall.ToneType ringbackToneType;
+ android.hardware.radio.ims.SrvccCall.CallSubState callSubstate = android.hardware.radio.ims.SrvccCall.CallSubState.NONE;
+ android.hardware.radio.ims.SrvccCall.ToneType ringbackToneType = android.hardware.radio.ims.SrvccCall.ToneType.NONE;
boolean isMpty;
boolean isMT;
String number;
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 a0e3991..9982395 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
@@ -33,7 +33,7 @@
package android.hardware.radio.messaging;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable CdmaSmsSubaddress {
int subaddressType;
boolean odd;
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 40b9ddb..ff4a111 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
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImsSmsMessage {
- android.hardware.radio.RadioTechnologyFamily tech;
+ android.hardware.radio.RadioTechnologyFamily tech = android.hardware.radio.RadioTechnologyFamily.THREE_GPP;
boolean retry;
int messageRef;
android.hardware.radio.messaging.CdmaSmsMessage[] cdmaMessage;
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 67c9349..3c812c0 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
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable BarringInfo {
int serviceType;
int barringType;
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 6bb31b0..53d485a 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
@@ -36,6 +36,6 @@
@JavaDerive(toString=true) @VintfStability
parcelable CellInfo {
boolean registered;
- android.hardware.radio.network.CellConnectionStatus connectionStatus;
+ android.hardware.radio.network.CellConnectionStatus connectionStatus = android.hardware.radio.network.CellConnectionStatus.NONE;
android.hardware.radio.network.CellInfoRatSpecificInfo ratSpecificInfo;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
index cb542e8..540dc1e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
@@ -36,7 +36,7 @@
@JavaDerive(toString=true) @VintfStability
parcelable CellularIdentifierDisclosure {
String plmn;
- android.hardware.radio.network.CellularIdentifier identifier;
- android.hardware.radio.network.NasProtocolMessage protocolMessage;
+ android.hardware.radio.network.CellularIdentifier identifier = android.hardware.radio.network.CellularIdentifier.UNKNOWN;
+ android.hardware.radio.network.NasProtocolMessage protocolMessage = android.hardware.radio.network.NasProtocolMessage.UNKNOWN;
boolean isEmergency;
}
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 0de7e20..81c286a 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
@@ -35,6 +35,7 @@
/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum Domain {
+ INVALID = 0,
CS = (1 << 0) /* 1 */,
PS = (1 << 1) /* 2 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
index c5b067e..93c32fb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum EmergencyMode {
EMERGENCY_WWAN = 1,
EMERGENCY_WLAN = 2,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
index 471c7a0..7273a94 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
@@ -36,5 +36,5 @@
@JavaDerive(toString=true) @VintfStability
parcelable EmergencyNetworkScanTrigger {
android.hardware.radio.AccessNetwork[] accessNetwork;
- android.hardware.radio.network.EmergencyScanType scanType;
+ android.hardware.radio.network.EmergencyScanType scanType = android.hardware.radio.network.EmergencyScanType.NO_PREFERENCE;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
index 3b8083d..47940f3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
@@ -35,9 +35,9 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EmergencyRegResult {
- android.hardware.radio.AccessNetwork accessNetwork;
- android.hardware.radio.network.RegState regState;
- android.hardware.radio.network.Domain emcDomain;
+ android.hardware.radio.AccessNetwork accessNetwork = android.hardware.radio.AccessNetwork.UNKNOWN;
+ android.hardware.radio.network.RegState regState = android.hardware.radio.network.RegState.NOT_REG_MT_NOT_SEARCHING_OP;
+ android.hardware.radio.network.Domain emcDomain = android.hardware.radio.network.Domain.INVALID;
boolean isVopsSupported;
boolean isEmcBearerSupported;
byte nwProvidedEmc;
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 bb34fe1..2ff454c 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
@@ -37,7 +37,7 @@
parcelable EutranRegistrationInfo {
android.hardware.radio.network.LteVopsInfo lteVopsInfo;
android.hardware.radio.network.NrIndicators nrIndicators;
- android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType;
+ android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType = android.hardware.radio.network.EutranRegistrationInfo.AttachResultType.NONE;
int extraInfo;
const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0) /* 1 */;
const int EXTRA_SMS_ONLY = (1 << 1) /* 2 */;
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 60eaf77..cdac0be 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
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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 695a194..518a378 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
@@ -33,10 +33,10 @@
package android.hardware.radio.network;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable NetworkScanResult {
int status;
- android.hardware.radio.RadioError error;
+ android.hardware.radio.RadioError error = android.hardware.radio.RadioError.NONE;
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/current/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl
index 61146aa..1b5b669 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
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable NrVopsInfo {
byte vopsSupported;
byte emcSupported;
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 7d64f7e..f58e5ed 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
@@ -35,8 +35,8 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PhysicalChannelConfig {
- android.hardware.radio.network.CellConnectionStatus status;
- android.hardware.radio.RadioTechnology rat;
+ android.hardware.radio.network.CellConnectionStatus status = android.hardware.radio.network.CellConnectionStatus.NONE;
+ android.hardware.radio.RadioTechnology rat = android.hardware.radio.RadioTechnology.UNKNOWN;
int downlinkChannelNumber;
int uplinkChannelNumber;
int cellBandwidthDownlinkKhz;
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 8229207..9a018f7 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
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioAccessSpecifier {
- android.hardware.radio.AccessNetwork accessNetwork;
+ android.hardware.radio.AccessNetwork accessNetwork = android.hardware.radio.AccessNetwork.UNKNOWN;
android.hardware.radio.network.RadioAccessSpecifierBands bands;
int[] channels;
}
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 6058e30..cbf37b2 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
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum RadioBandMode {
BAND_MODE_UNSPECIFIED,
BAND_MODE_EURO,
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 f11b911..5e40813 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
@@ -33,7 +33,7 @@
package android.hardware.radio.network;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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 625d970..814cde8 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
@@ -35,9 +35,9 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RegStateResult {
- android.hardware.radio.network.RegState regState;
- android.hardware.radio.RadioTechnology rat;
- android.hardware.radio.network.RegistrationFailCause reasonForDenial;
+ android.hardware.radio.network.RegState regState = android.hardware.radio.network.RegState.NOT_REG_MT_NOT_SEARCHING_OP;
+ android.hardware.radio.RadioTechnology rat = android.hardware.radio.RadioTechnology.UNKNOWN;
+ android.hardware.radio.network.RegistrationFailCause reasonForDenial = android.hardware.radio.network.RegistrationFailCause.NONE;
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/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
index 73ad180..8613f19 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -35,8 +35,8 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SecurityAlgorithmUpdate {
- android.hardware.radio.network.ConnectionEvent connectionEvent;
- android.hardware.radio.network.SecurityAlgorithm encryption;
- android.hardware.radio.network.SecurityAlgorithm integrity;
+ android.hardware.radio.network.ConnectionEvent connectionEvent = android.hardware.radio.network.ConnectionEvent.CS_SIGNALLING_GSM;
+ android.hardware.radio.network.SecurityAlgorithm encryption = android.hardware.radio.network.SecurityAlgorithm.A50;
+ android.hardware.radio.network.SecurityAlgorithm integrity = android.hardware.radio.network.SecurityAlgorithm.A50;
boolean isUnprotectedEmergency;
}
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 77b4831..2041bad 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
@@ -33,14 +33,14 @@
package android.hardware.radio.network;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable SignalThresholdInfo {
int signalMeasurement;
int hysteresisMs;
int hysteresisDb;
int[] thresholds;
boolean isEnabled;
- android.hardware.radio.AccessNetwork ran;
+ android.hardware.radio.AccessNetwork ran = android.hardware.radio.AccessNetwork.UNKNOWN;
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/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 898b616..a3e6d3a 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
@@ -33,16 +33,16 @@
package android.hardware.radio.sim;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable AppStatus {
int appType;
int appState;
- android.hardware.radio.sim.PersoSubstate persoSubstate;
+ android.hardware.radio.sim.PersoSubstate persoSubstate = android.hardware.radio.sim.PersoSubstate.UNKNOWN;
String aidPtr;
String appLabelPtr;
boolean pin1Replaced;
- android.hardware.radio.sim.PinState pin1;
- android.hardware.radio.sim.PinState pin2;
+ android.hardware.radio.sim.PinState pin1 = android.hardware.radio.sim.PinState.UNKNOWN;
+ android.hardware.radio.sim.PinState pin2 = android.hardware.radio.sim.PinState.UNKNOWN;
const int APP_STATE_UNKNOWN = 0;
const int APP_STATE_DETECTED = 1;
const int APP_STATE_PIN = 2;
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 066777a..6a908c4 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
@@ -33,7 +33,7 @@
package android.hardware.radio.sim;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum CardPowerState {
POWER_DOWN,
POWER_UP,
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 1a9d621..0d7e48a 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
@@ -36,7 +36,7 @@
@JavaDerive(toString=true) @VintfStability
parcelable CardStatus {
int cardState;
- android.hardware.radio.sim.PinState universalPinState;
+ android.hardware.radio.sim.PinState universalPinState = android.hardware.radio.sim.PinState.UNKNOWN;
int gsmUmtsSubscriptionAppIndex;
int cdmaSubscriptionAppIndex;
int imsSubscriptionAppIndex;
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 a5b8dc9..8f5672f 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
@@ -44,7 +44,7 @@
*/
android.hardware.radio.sim.Carrier[] excludedCarriers;
boolean allowedCarriersPrioritized;
- android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status;
+ android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status = android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus.UNKNOWN;
android.hardware.radio.sim.CarrierInfo[] allowedCarrierInfoList = {};
android.hardware.radio.sim.CarrierInfo[] excludedCarrierInfoList = {};
@Backing(type="int") @VintfStability
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 aaf9f3e..5070ff2 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
@@ -33,7 +33,7 @@
package android.hardware.radio.sim;
/* @hide */
-@Backing(type="byte") @JavaDerive(toString=true) @VintfStability
+@Backing(type="byte") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 8cfe417..75b8f6b 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
@@ -33,7 +33,7 @@
package android.hardware.radio.sim;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum SimLockMultiSimPolicy {
NO_MULTISIM_POLICY,
ONE_VALID_SIM_MUST_BE_PRESENT,
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 81ba510..c546565 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
@@ -33,7 +33,7 @@
package android.hardware.radio.sim;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable SimRefreshResult {
int type;
int efId;
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 b45a45b..27130b4 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
@@ -48,7 +48,7 @@
String name;
int namePresentation;
android.hardware.radio.voice.UusInfo[] uusInfo;
- android.hardware.radio.voice.AudioQuality audioQuality;
+ android.hardware.radio.voice.AudioQuality audioQuality = android.hardware.radio.voice.AudioQuality.UNSPECIFIED;
String forwardedNumber;
const int PRESENTATION_ALLOWED = 0;
const int PRESENTATION_RESTRICTED = 1;
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 300b03f..0142792 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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 2f7f5f0..c71a8be 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
index c3b0d5a..974e795 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable CdmaNumberInfoRecord {
String number;
byte numberType;
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 93c7c6b..818d107 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
index c38c801..3153e0a 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum ClipStatus {
CLIP_PROVISIONED,
CLIP_UNPROVISIONED,
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 3099a20..a45f388 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum EmergencyCallRouting {
UNKNOWN,
EMERGENCY,
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 0cac135..17a039f 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
@@ -33,8 +33,9 @@
package android.hardware.radio.voice;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum LastCallFailCause {
+ INVALID = 0,
UNOBTAINABLE_NUMBER = 1,
NO_ROUTE_TO_DESTINATION = 3,
CHANNEL_UNACCEPTABLE = 6,
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 151adf2..c36a934 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
@@ -35,6 +35,6 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LastCallFailCauseInfo {
- android.hardware.radio.voice.LastCallFailCause causeCode;
+ android.hardware.radio.voice.LastCallFailCause causeCode = android.hardware.radio.voice.LastCallFailCause.INVALID;
String vendorCause;
}
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 24365dc..2af38fe 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @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 999f47c..d265374 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
@@ -39,7 +39,7 @@
int requestType;
int teleserviceType;
int serviceClass;
- android.hardware.radio.RadioError result;
+ android.hardware.radio.RadioError result = android.hardware.radio.RadioError.NONE;
android.hardware.radio.voice.SsInfoData[] ssInfo;
android.hardware.radio.voice.CfData[] cfData;
const int REQUEST_TYPE_ACTIVATION = 0;
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 3c84c8d..79c77ee 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
@@ -33,7 +33,7 @@
package android.hardware.radio.voice;
/* @hide */
-@JavaDerive(toString=true) @VintfStability
+@JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
parcelable UusInfo {
int uusType;
int uusDcs;
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 02c5370..e782e73 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
@@ -33,7 +33,7 @@
package android.hardware.radio;
/* @hide */
-@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+@Backing(type="int") @JavaDerive(toString=true) @SuppressWarnings(value={"redundant-name"}) @VintfStability
enum RadioError {
NONE = 0,
RADIO_NOT_AVAILABLE = 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 f03a73b..bfab0c5 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
@@ -35,7 +35,7 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioResponseInfo {
- android.hardware.radio.RadioResponseType type;
+ android.hardware.radio.RadioResponseType type = android.hardware.radio.RadioResponseType.SOLICITED;
int serial;
- android.hardware.radio.RadioError error;
+ android.hardware.radio.RadioError error = android.hardware.radio.RadioError.NONE;
}
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 2e0c315..c445fec 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
@@ -35,8 +35,8 @@
/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioResponseInfoModem {
- android.hardware.radio.RadioResponseType type;
+ android.hardware.radio.RadioResponseType type = android.hardware.radio.RadioResponseType.SOLICITED;
int serial;
- android.hardware.radio.RadioError error;
+ android.hardware.radio.RadioError error = android.hardware.radio.RadioError.NONE;
boolean isEnabled;
}
diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl
index 9c39bc4..6ce8f67 100644
--- a/radio/aidl/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/android/hardware/radio/RadioError.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum RadioError {
/**
* Success
diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
index 25195aa..926ccf6 100644
--- a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
+++ b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
@@ -26,7 +26,7 @@
/**
* Response type
*/
- RadioResponseType type;
+ RadioResponseType type = RadioResponseType.SOLICITED;
/**
* Serial number of the request
*/
@@ -34,5 +34,5 @@
/**
* Response error
*/
- RadioError error;
+ RadioError error = RadioError.NONE;
}
diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
index 286f397..3e76a93 100644
--- a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
+++ b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
@@ -26,7 +26,7 @@
/**
* Response type
*/
- RadioResponseType type;
+ RadioResponseType type = RadioResponseType.SOLICITED;
/**
* Serial number of the request
*/
@@ -34,7 +34,7 @@
/**
* Response error
*/
- RadioError error;
+ RadioError error = RadioError.NONE;
/**
* Whether the modem is enabled or not
*/
diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
index e015e8e..6f043d9 100644
--- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 d01f8ff..f067fb4 100644
--- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
@@ -66,15 +66,15 @@
/**
* PDP_type values.
*/
- PdpProtocolType protocol;
+ PdpProtocolType protocol = PdpProtocolType.IP;
/**
* PDP_type values used on roaming network.
*/
- PdpProtocolType roamingProtocol;
+ PdpProtocolType roamingProtocol = PdpProtocolType.IP;
/**
* APN authentication type.
*/
- ApnAuthType authType;
+ ApnAuthType authType = ApnAuthType.NO_PAP_NO_CHAP;
/**
* The username for APN, or empty string.
*/
diff --git a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
index a762e34..03c3481 100644
--- a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="byte")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum DataThrottlingAction {
/*
* Clear all existing data throttling.
diff --git a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
index 7ac560f..f5d6553 100644
--- a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
+++ b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
@@ -22,6 +22,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable LinkAddress {
const int ADDRESS_PROPERTY_NONE = 0;
/**
diff --git a/radio/aidl/android/hardware/radio/data/PortRange.aidl b/radio/aidl/android/hardware/radio/data/PortRange.aidl
index 7326966..1d436fa 100644
--- a/radio/aidl/android/hardware/radio/data/PortRange.aidl
+++ b/radio/aidl/android/hardware/radio/data/PortRange.aidl
@@ -24,6 +24,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable PortRange {
const int PORT_RANGE_MIN = 20;
const int PORT_RANGE_MAX = 65535;
diff --git a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
index 4e9e954..4d4b6d5 100644
--- a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
+++ b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
@@ -38,7 +38,7 @@
/**
* Valid values are IP, IPV6, IPV4V6, and UNKNOWN.
*/
- PdpProtocolType sessionType;
+ PdpProtocolType sessionType = PdpProtocolType.IP;
/**
* Session and service continuity mode as defined in 3GPP TS 23.501.
* Valid values are SSC_MODE_
diff --git a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
index 31fb14c..687982a 100644
--- a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
+++ b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
@@ -27,6 +27,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable SetupDataCallResult {
/**
* Indicates the data connection is inactive.
@@ -64,7 +65,7 @@
/**
* Data call fail cause. DataCallFailCause.NONE if no error.
*/
- DataCallFailCause cause;
+ DataCallFailCause cause = DataCallFailCause.NONE;
/**
* 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
@@ -87,7 +88,7 @@
* PDP protocol type. If cause is DataCallFailCause.ONLY_SINGLE_BEARER_ALLOWED, this is the
* protocol type supported, such as "IP" or "IPV6".
*/
- PdpProtocolType type;
+ PdpProtocolType type = PdpProtocolType.IP;
/**
* The network interface name.
*/
diff --git a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
index c96f59f..92024ac 100644
--- a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
@@ -22,7 +22,10 @@
parcelable ConnectionFailureInfo {
@VintfStability
@Backing(type="int")
+ @SuppressWarnings(value={"redundant-name"})
enum ConnectionFailureReason {
+ /** Do not use. */
+ INVALID = 0,
/** Access class check failed */
REASON_ACCESS_DENIED = 1,
/** 3GPP Non-access stratum failure */
@@ -47,7 +50,7 @@
/**
* Values are REASON_* constants
*/
- ConnectionFailureReason failureReason;
+ ConnectionFailureReason failureReason = ConnectionFailureReason.INVALID;
/**
* Failure cause code from network or modem specific to the failure
diff --git a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
index 427c1f5..49fd62c 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
@@ -50,16 +50,16 @@
int index;
/** The type of the call */
- CallType callType;
+ CallType callType = CallType.NORMAL;
/** The access network where the call is in progress */
- AccessNetwork accessNetwork;
+ AccessNetwork accessNetwork = AccessNetwork.UNKNOWN;
/** The state of the call */
- CallState callState;
+ CallState callState = CallState.ACTIVE;
/** The direction of the call */
- Direction direction;
+ Direction direction = Direction.INCOMING;
/** True if the call is put on HOLD by the other party */
boolean isHeldByRemote;
diff --git a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
index acfe51c..bee8276 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
@@ -20,6 +20,7 @@
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
+@SuppressWarnings(value={"redundant-name"})
enum ImsDeregistrationReason {
/**
* Radio shall send this reason to IMS stack to perform graceful de-registration
diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
index 5158386..9018273 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
@@ -23,6 +23,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable ImsRegistration {
/** Default value */
const int IMS_MMTEL_CAPABILITY_NONE = 0;
@@ -36,15 +37,15 @@
const int IMS_RCS_CAPABILITIES = 1 << 3;
/** Indicates the current IMS registration state. */
- ImsRegistrationState regState;
+ ImsRegistrationState regState = ImsRegistrationState.NOT_REGISTERED;
/**
* Indicates the type of the radio access network where IMS is registered.
*/
- AccessNetwork accessNetworkType;
+ AccessNetwork accessNetworkType = AccessNetwork.UNKNOWN;
/** Indicates the expected action for the radio to do. */
- SuggestedAction suggestedAction;
+ SuggestedAction suggestedAction = SuggestedAction.NONE;
/**
* Values are bitwise ORs of IMS_MMTEL_CAPABILITY_* constants and IMS_RCS_CAPABILITIES.
diff --git a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
index 16858f9..4fdfed0 100644
--- a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
@@ -47,16 +47,16 @@
int index;
/** The type of the call */
- CallType callType;
+ CallType callType = CallType.NORMAL;
/** Values are android.hardware.radio.voice.Call.STATE_* constants */
int callState;
/** The substate of the call */
- CallSubState callSubstate;
+ CallSubState callSubstate = CallSubState.NONE;
/** The type of the ringback tone */
- ToneType ringbackToneType;
+ ToneType ringbackToneType = ToneType.NONE;
/** true if is mpty call */
boolean isMpty;
diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
index dc2a162..94070db 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
@@ -23,7 +23,10 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum AmrMode {
+ /** Do not use. */
+ INVALID = 0,
/** 4.75 kbps for AMR / 6.6 kbps for AMR-WB */
AMR_MODE_0 = 1 << 0,
/** 5.15 kbps for AMR / 8.855 kbps for AMR-WB */
diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
index 9d7ab05..dbf38c2 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
@@ -23,7 +23,7 @@
@JavaDerive(toString=true)
parcelable AmrParams {
/** mode-set: AMR codec mode to represent the bit rate */
- AmrMode amrMode;
+ AmrMode amrMode = AmrMode.INVALID;
/**
* octet-align: If it's set to true then all fields in the AMR/AMR-WB header
* shall be aligned to octet boundaries by adding padding bits.
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
index 74de6ec..6da8087 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
@@ -24,7 +24,7 @@
@JavaDerive(toString=true)
parcelable CodecParams {
/** Negotiated codec type */
- CodecType codecType;
+ CodecType codecType = CodecType.INVALID;
/**
* Static or dynamic payload type number negotiated through the SDP for
* the incoming RTP packets. This value shall be matched with the PT value
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
index 99fbac4..cf9dba4 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
@@ -21,6 +21,8 @@
@Backing(type="int")
@JavaDerive(toString=true)
enum CodecType {
+ /** Do not use. */
+ INVALID = 0,
/** Adaptive Multi-Rate */
AMR = 1 << 0,
/** Adaptive Multi-Rate Wide Band */
diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
index 12d981b..899f05a 100644
--- a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
@@ -23,7 +23,10 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum EvsMode {
+ /** Do not use. */
+ INVALID = 0,
/** 6.6 kbps for EVS AMR-WB IO */
EVS_MODE_0 = 1 << 0,
/** 8.855 kbps for AMR-WB IO */
diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
index 52c3bf9..37c7d4b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
@@ -24,10 +24,10 @@
@JavaDerive(toString=true)
parcelable EvsParams {
/** EVS codec bandwidth */
- EvsBandwidth bandwidth;
+ EvsBandwidth bandwidth = EvsBandwidth.NONE;
/** mode-set: EVS codec mode to represent the bit rate */
- EvsMode evsMode;
+ EvsMode evsMode = EvsMode.INVALID;
/**
* ch-aw-recv: Channel aware mode for the receive direction. Permissible values
* are -1, 0, 2, 3, 5, and 7. If -1, channel-aware mode is disabled in the
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 88180d7..c7ee147 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -23,6 +23,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum RtcpXrReportBlockType {
/** Disable RTCP XR */
RTCPXR_NONE = 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
index 3c5c4dd..9aca292 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -29,7 +29,7 @@
/** Media flow direction. The bitfield of MediaDirection(s) */
int direction;
/** Radio Access Network */
- AccessNetwork accessNetwork;
+ AccessNetwork accessNetwork = AccessNetwork.UNKNOWN;
/** IP address and port number of the other party for RTP media */
RtpAddress remoteAddress;
/** Negotiated session parameters */
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
index 19d84ff..8c494bb 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
@@ -19,6 +19,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable CdmaSmsSubaddress {
/**
* CCITT X.213 or ISO 8348 AD2
diff --git a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
index 5f9f82b..bbcd1cb 100644
--- a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
@@ -24,7 +24,7 @@
@VintfStability
@JavaDerive(toString=true)
parcelable ImsSmsMessage {
- RadioTechnologyFamily tech;
+ RadioTechnologyFamily tech = RadioTechnologyFamily.THREE_GPP;
/**
* Retry if true
*/
diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
index 4818c9e..0389170 100644
--- a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
@@ -32,9 +32,12 @@
*/
int rilModel;
/**
- * Bitset value, based on RadioTechnology.
+ * All supported radio technologies.
+ *
+ * Despite the stated type, this is an int bitset: a mask where each bit position represents a
+ * radio technology.
*/
- RadioTechnology rat = RadioTechnology.UNKNOWN;
+ RadioTechnology rat = RadioTechnology.UNKNOWN; // it's really an empty bitmask
/**
* Maximum number of concurrent active voice calls.
*/
diff --git a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
index f12e35c..7be3987 100644
--- a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
@@ -21,6 +21,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable BarringInfo {
/**
* Device is not barred for the given service
diff --git a/radio/aidl/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfo.aidl
index 4895326..808a407 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfo.aidl
@@ -30,6 +30,6 @@
/**
* Connection status for the cell.
*/
- CellConnectionStatus connectionStatus;
+ CellConnectionStatus connectionStatus = CellConnectionStatus.NONE;
CellInfoRatSpecificInfo ratSpecificInfo;
}
diff --git a/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl b/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
index 52b4116..c851b43 100644
--- a/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
@@ -31,9 +31,9 @@
// The PLMN-ID to which the UE transmitted the cellular identifier
String plmn;
// The type of cellular identifier that was disclosed
- CellularIdentifier identifier;
+ CellularIdentifier identifier = CellularIdentifier.UNKNOWN;
// The NAS protocol message within which the cellular identifier was transmitted.
- NasProtocolMessage protocolMessage;
+ NasProtocolMessage protocolMessage = NasProtocolMessage.UNKNOWN;
// Whether or not this cellular identifier disclosure is in service of an emergency call.
boolean isEmergency;
}
diff --git a/radio/aidl/android/hardware/radio/network/Domain.aidl b/radio/aidl/android/hardware/radio/network/Domain.aidl
index bb169bd..e420e7b 100644
--- a/radio/aidl/android/hardware/radio/network/Domain.aidl
+++ b/radio/aidl/android/hardware/radio/network/Domain.aidl
@@ -21,6 +21,8 @@
@Backing(type="int")
@JavaDerive(toString=true)
enum Domain {
+ /** Do not use. */
+ INVALID = 0,
/**
* Circuit-switched
*/
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
index 7a2ed9c..bd36494 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum EmergencyMode {
/**
* Mode Type Emergency WWAN, indicates that the current domain selected for the Emergency call
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
index ea4bfeb..572d1e2 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
@@ -32,5 +32,5 @@
* Scan type indicates the type of scans to be performed i.e. limited scan, full service scan or
* any scan.
*/
- EmergencyScanType scanType;
+ EmergencyScanType scanType = EmergencyScanType.NO_PREFERENCE;
}
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
index af2750e..7fc4d26 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
@@ -26,17 +26,17 @@
/**
* Indicates the cellular access network of the current emergency capable system.
*/
- AccessNetwork accessNetwork;
+ AccessNetwork accessNetwork = AccessNetwork.UNKNOWN;
/**
* Registration state of the current emergency capable system.
*/
- RegState regState;
+ RegState regState = RegState.NOT_REG_MT_NOT_SEARCHING_OP;
/**
* EMC domain indicates the current domain of the acquired system.
*/
- Domain emcDomain;
+ Domain emcDomain = Domain.INVALID;
/**
* This indicates whether the network supports voice over PS network.
diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
index fb319c1..15fabf3 100644
--- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -54,7 +54,7 @@
* The type of network attachment. This info is valid only on LTE network and must be present
* when device has attached to the network.
*/
- AttachResultType lteAttachResultType;
+ AttachResultType lteAttachResultType = AttachResultType.NONE;
/** Values are bitwise ORs of EXTRA_* constants */
int extraInfo;
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index a4f97e3..81d21e1 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -503,7 +503,7 @@
*
* This is available when android.hardware.telephony is defined.
*/
- oneway void setUsageSetting(in int serial, in UsageSetting usageSetting);
+ void setUsageSetting(in int serial, in UsageSetting usageSetting);
/**
* Get the UE usage setting for data/voice centric usage.
@@ -514,7 +514,7 @@
*
* This is available when android.hardware.telephony is defined.
*/
- oneway void getUsageSetting(in int serial);
+ void getUsageSetting(in int serial);
/**
* Set the Emergency Mode
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 34948fb..7b6fc6e 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -306,7 +306,7 @@
* operation, it becomes complicated when integrity is used to determine whether an
* emergency call is protected or not, hence its exclusion to simplify implementation.
* - 4G and 5G with multiple DRBs : emergency calls are protected under that RAT only if all
- * DRBs are protected (including IMS DRB).
+ * SRBs and DRBs are protected (including IMS DRB).
* - 4G and 5G DRB integrity: Since DRB integrity is not enabled in most networks, if both
* ciphering and integrity are taken into account to determine the value of
* isUnprotectedEmergency, the value will mostly be false, hence why it is excluded.
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index b67e8e0..5dcdb69 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -603,7 +603,7 @@
* RadioError:INTERNAL_ERR
* RadioError:SIM_ABSENT
*/
- oneway void setUsageSettingResponse(in RadioResponseInfo info);
+ void setUsageSettingResponse(in RadioResponseInfo info);
/**
* @param info Response info struct containing response type, serial no. and error.
@@ -617,7 +617,7 @@
* RadioError:INTERNAL_ERR
* RadioError:SIM_ABSENT
*/
- oneway void getUsageSettingResponse(in RadioResponseInfo info, in UsageSetting usageSetting);
+ void getUsageSettingResponse(in RadioResponseInfo info, in UsageSetting usageSetting);
/**
* Response of setEmergencyMode.
diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
index 37f2cf1..30977f8 100644
--- a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
+++ b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
@@ -21,6 +21,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 4465046..700c5e2 100644
--- a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl
@@ -22,6 +22,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable NetworkScanResult {
/**
* The result contains a part of the scan results.
@@ -40,7 +41,7 @@
/**
* The error code of the incremental result.
*/
- RadioError error;
+ RadioError error = RadioError.NONE;
/**
* List of network information as CellInfo.
*/
diff --git a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
index 71961a3..6fe1d27 100644
--- a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
@@ -23,6 +23,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable NrVopsInfo {
/**
* Emergency services not supported
diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
index ecb9463..b648ef8 100644
--- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
+++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
@@ -27,11 +27,11 @@
/**
* Connection status for cell. Valid values are PRIMARY_SERVING and SECONDARY_SERVING
*/
- CellConnectionStatus status;
+ CellConnectionStatus status = CellConnectionStatus.NONE;
/**
* The radio technology for this physical channel
*/
- RadioTechnology rat;
+ RadioTechnology rat = RadioTechnology.UNKNOWN;
/**
* Downlink Absolute Radio Frequency Channel Number
*/
diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
index b3cee47..8bb4fe0 100644
--- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
+++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
@@ -26,7 +26,7 @@
/**
* The type of network to scan.
*/
- AccessNetwork accessNetwork;
+ AccessNetwork accessNetwork = AccessNetwork.UNKNOWN;
/**
* The frequency bands to scan. Maximum length of the vector is 8.
*/
diff --git a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
index 364a562..bd83b7d 100644
--- a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
+++ b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 de2d5f6..15e7160 100644
--- a/radio/aidl/android/hardware/radio/network/RegState.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegState.aidl
@@ -25,6 +25,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 57a73c0..a7857ef 100644
--- a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl
@@ -32,7 +32,7 @@
* EUTRAN, NGRAN, or another technology that does not support circuit-switched services, this
* value reports registration in the Packet-switched domain.
*/
- RegState regState;
+ RegState regState = RegState.NOT_REG_MT_NOT_SEARCHING_OP;
/**
* Indicates the radio technology, which must not be UNKNOWN if regState is REG_HOME,
* REG_ROAMING, NOT_REG_MT_NOT_SEARCHING_OP_EM, NOT_REG_MT_SEARCHING_OP_EM, REG_DENIED_EM,
@@ -40,12 +40,12 @@
* When the device is on carrier aggregation, vendor RIL service must properly report multiple
* PhysicalChannelConfig elements through IRadioNetwork::currentPhysicalChannelConfigs.
*/
- RadioTechnology rat;
+ RadioTechnology rat = RadioTechnology.UNKNOWN;
/**
* 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;
+ RegistrationFailCause reasonForDenial = RegistrationFailCause.NONE;
/**
* CellIdentity
*/
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
index e945d3b..ab48148 100644
--- a/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -31,15 +31,15 @@
/**
* Type of connection event which is being reported on
*/
- ConnectionEvent connectionEvent;
+ ConnectionEvent connectionEvent = ConnectionEvent.CS_SIGNALLING_GSM;
/**
* Encryption algorithm which was used
*/
- SecurityAlgorithm encryption;
+ SecurityAlgorithm encryption = SecurityAlgorithm.A50;
/**
* Integrity algorithm which was used
*/
- SecurityAlgorithm integrity;
+ SecurityAlgorithm integrity = SecurityAlgorithm.A50;
/**
* Whether or not this connection event is associated with an
* unauthenticated / unencrypted emergency session
diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
index e440a64..3933889 100644
--- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
@@ -24,6 +24,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable SignalThresholdInfo {
/**
* Received Signal Strength Indication.
@@ -121,5 +122,5 @@
/**
* The Radio Access Network for current threshold info.
*/
- AccessNetwork ran;
+ AccessNetwork ran = AccessNetwork.UNKNOWN;
}
diff --git a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
index 7fe8e40..602c8c5 100644
--- a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
@@ -22,6 +22,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable AppStatus {
const int APP_STATE_UNKNOWN = 0;
const int APP_STATE_DETECTED = 1;
@@ -57,7 +58,7 @@
/**
* Applicable only if appState == SUBSCRIPTION_PERSO
*/
- PersoSubstate persoSubstate;
+ PersoSubstate persoSubstate = PersoSubstate.UNKNOWN;
/**
* e.g., from 0xA0, 0x00 -> 0x41, 0x30, 0x30, 0x30
*/
@@ -67,6 +68,6 @@
* Applicable to USIM, CSIM and ISIM
*/
boolean pin1Replaced;
- PinState pin1;
- PinState pin2;
+ PinState pin1 = PinState.UNKNOWN;
+ PinState pin2 = PinState.UNKNOWN;
}
diff --git a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
index 2598dcb..0d5db2a 100644
--- a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 043bfa4..90aa8e0 100644
--- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
@@ -48,7 +48,7 @@
/**
* Applicable to USIM and CSIM
*/
- PinState universalPinState;
+ PinState universalPinState = PinState.UNKNOWN;
/**
* Value < RadioConst:CARD_MAX_APPS, -1 if none
*/
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
index 0002d5a..69c618f 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -61,7 +61,7 @@
*/
boolean allowedCarriersPrioritized;
/** Current restriction status as defined in CarrierRestrictionStatus enum */
- CarrierRestrictionStatus status;
+ CarrierRestrictionStatus status = CarrierRestrictionStatus.UNKNOWN;
/** Allowed carriers. */
CarrierInfo[] allowedCarrierInfoList = {};
@@ -71,5 +71,5 @@
* excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1
* is ABCD, all carriers with the same mcc/mnc are allowed.
*/
- CarrierInfo[] excludedCarrierInfoList = {};
-}
\ No newline at end of file
+ CarrierInfo[] excludedCarrierInfoList = {};
+}
diff --git a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
index f9414a8..c75a4ef 100644
--- a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
@@ -23,6 +23,7 @@
@VintfStability
@Backing(type="byte")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum PbReceivedStatus {
/**
* Indicates that retrieval is fine.
diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 89d85a9..7ec5141 100644
--- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum SimLockMultiSimPolicy {
/**
diff --git a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
index 943f1d2..618ac32 100644
--- a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
@@ -19,6 +19,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable SimRefreshResult {
/**
* A file on SIM has been updated.
diff --git a/radio/aidl/android/hardware/radio/voice/Call.aidl b/radio/aidl/android/hardware/radio/voice/Call.aidl
index ee0b025..9990f28 100644
--- a/radio/aidl/android/hardware/radio/voice/Call.aidl
+++ b/radio/aidl/android/hardware/radio/voice/Call.aidl
@@ -99,7 +99,7 @@
* Vector of User-User Signaling Information
*/
UusInfo[] uusInfo;
- AudioQuality audioQuality;
+ AudioQuality audioQuality = AudioQuality.UNSPECIFIED;
/**
* 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
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
index 7e5a68d..90b2715 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
@@ -26,6 +26,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 f5c656b..19903c6 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl
@@ -30,6 +30,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable CdmaInformationRecord {
const int CDMA_MAX_NUMBER_OF_INFO_RECS = 10;
/**
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
index b04e273..3a00cae 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
@@ -24,6 +24,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable CdmaNumberInfoRecord {
const int CDMA_NUMBER_INFO_BUFFER_LENGTH = 81;
/**
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
index 691712e..cb30da8 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
@@ -21,6 +21,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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/ClipStatus.aidl b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
index 0a2ea2c..070aff7 100644
--- a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
+++ b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
@@ -20,6 +20,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum ClipStatus {
/**
* CLIP provisioned
diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
index 9f8993d..36e0bc0 100644
--- a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
+++ b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
@@ -23,6 +23,7 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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/LastCallFailCause.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
index 9a38197..7737e94 100644
--- a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
@@ -20,7 +20,10 @@
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
enum LastCallFailCause {
+ /** Do not use. */
+ INVALID = 0,
UNOBTAINABLE_NUMBER = 1,
NO_ROUTE_TO_DESTINATION = 3,
CHANNEL_UNACCEPTABLE = 6,
diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
index 4ed17d2..6af38bb 100644
--- a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
+++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
@@ -22,6 +22,6 @@
@VintfStability
@JavaDerive(toString=true)
parcelable LastCallFailCauseInfo {
- LastCallFailCause causeCode;
+ LastCallFailCause causeCode = LastCallFailCause.INVALID;
String vendorCause;
}
diff --git a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
index c965a7d..9c9dcff 100644
--- a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
+++ b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
@@ -19,6 +19,7 @@
/** @hide */
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
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 9fe4024..641994e 100644
--- a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
+++ b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
@@ -84,7 +84,7 @@
* Values are a bitfield of SUPP_SERVICE_CLASS_
*/
int serviceClass;
- RadioError result;
+ RadioError result = RadioError.NONE;
/**
* Valid only for all serviceType except SERVICE_TYPE_CF_* else empty.
* Only one of ssInfo and cfData may contain values and the other must be empty.
diff --git a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
index 5d499ca..3760ac6 100644
--- a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
+++ b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
@@ -22,6 +22,7 @@
*/
@VintfStability
@JavaDerive(toString=true)
+@SuppressWarnings(value={"redundant-name"})
parcelable UusInfo {
/**
* User specified protocol
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index e8eed71..b57dd8a 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -548,10 +548,8 @@
void deleteKey(in byte[] keyBlob);
/**
- * Deletes all keys in the hardware keystore. Used when keystore is reset completely. After
- * this function is called all keys with Tag::ROLLBACK_RESISTANCE in their hardware-enforced
- * authorization lists must be rendered permanently unusable. Keys without
- * Tag::ROLLBACK_RESISTANCE may or may not be rendered unusable.
+ * Deletes all keys in the hardware keystore. Used when keystore is reset completely. After
+ * this function is called all keys created previously must be rendered permanently unusable.
*/
void deleteAllKeys();
diff --git a/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl b/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
index da8b513..2d2f307 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
@@ -125,14 +125,25 @@
* straightforward translation of the KeyMint tag/value parameter lists to ASN.1.
*
* KeyDescription ::= SEQUENCE {
- * attestationVersion INTEGER, # Value 300
- * attestationSecurityLevel SecurityLevel, # See below
- * keyMintVersion INTEGER, # Value 300
- * keymintSecurityLevel SecurityLevel, # See below
- * attestationChallenge OCTET_STRING, # Tag::ATTESTATION_CHALLENGE from attestParams
- * uniqueId OCTET_STRING, # Empty unless key has Tag::INCLUDE_UNIQUE_ID
- * softwareEnforced AuthorizationList, # See below
- * hardwareEnforced AuthorizationList, # See below
+ * -- attestationVersion must be 400.
+ * attestationVersion INTEGER,
+ * -- attestationSecurityLevel is the SecurityLevel of the location where the attested
+ * -- key is stored. Must match keymintSecurityLevel.
+ * attestationSecurityLevel SecurityLevel,
+ * -- keyMintVersion must be 400.
+ * keyMintVersion INTEGER,
+ * -- keyMintSecurityLevel is the SecurityLevel of the IKeyMintDevice. Must match
+ * -- attestationSecurityLevel.
+ * keyMintSecurityLevel SecurityLevel,
+ * -- attestationChallenge contains Tag::ATTESTATION_CHALLENGE from attestParams.
+ * attestationChallenge OCTET_STRING,
+ * -- uniqueId is empty unless the key has Tag::INCLUDE_UNIQUE_ID.
+ * uniqueId OCTET_STRING,
+ * -- softwareEnforced contains the authorization tags enforced by the Android system.
+ * softwareEnforced AuthorizationList,
+ * -- hardwareEnforced contains the authorization tags enforced by a secure environment
+ * -- (TEE or StrongBox).
+ * hardwareEnforced AuthorizationList,
* }
*
* SecurityLevel ::= ENUMERATED {
@@ -142,12 +153,15 @@
* }
*
* RootOfTrust ::= SEQUENCE {
+ * -- verifiedBootKey must contain a SHA-256 digest of the public key embedded in the
+ * -- "vbmeta" partition if the device's bootloader is locked, or 32 bytes of zeroes if the
+ * -- device's bootloader is unlocked.
* verifiedBootKey OCTET_STRING,
* deviceLocked BOOLEAN,
* verifiedBootState VerifiedBootState,
- * # verifiedBootHash must contain a SHA-256 digest of all binaries and components validated
- * # by Verified Boot. Updating any verified binary or component must cause this value to
- * # change.
+ * -- verifiedBootHash must contain a SHA-256 digest of all binaries and components
+ * -- validated by Verified Boot. Updating any verified binary or component must cause this
+ * -- value to change.
* verifiedBootHash OCTET_STRING,
* }
*
@@ -158,6 +172,17 @@
* Failed (3),
* }
*
+ * -- Modules contains version information for APEX modules.
+ * -- Note that the Modules information is DER-encoded before being hashed, which requires a
+ * -- specific ordering (lexicographic by encoded value) for the constituent Module entries.
+ * -- This ensures that the ordering of Module entries is predictable and that the resulting
+ * -- SHA-256 hash value is identical for the same set of modules.
+ * Modules ::= SET OF Module
+ * Module ::= SEQUENCE {
+ * packageName OCTET_STRING,
+ * version INTEGER, -- As determined at boot time
+ * }
+ *
* -- Note that the AuthorizationList SEQUENCE is also used in IKeyMintDevice::importWrappedKey
* -- as a way of describing the authorizations associated with a key that is being securely
* -- imported. As such, it includes the ability to describe tags that are only relevant for
@@ -170,11 +195,11 @@
* purpose [1] EXPLICIT SET OF INTEGER OPTIONAL,
* algorithm [2] EXPLICIT INTEGER OPTIONAL,
* keySize [3] EXPLICIT INTEGER OPTIONAL,
- * blockMode [4] EXPLICIT SET OF INTEGER OPTIONAL, -- symmetric only
+ * blockMode [4] EXPLICIT SET OF INTEGER OPTIONAL, -- Symmetric keys only
* digest [5] EXPLICIT SET OF INTEGER OPTIONAL,
* padding [6] EXPLICIT SET OF INTEGER OPTIONAL,
- * callerNonce [7] EXPLICIT NULL OPTIONAL, -- symmetric only
- * minMacLength [8] EXPLICIT INTEGER OPTIONAL, -- symmetric only
+ * callerNonce [7] EXPLICIT NULL OPTIONAL, -- Symmetric keys only
+ * minMacLength [8] EXPLICIT INTEGER OPTIONAL, -- Symmetric keys only
* ecCurve [10] EXPLICIT INTEGER OPTIONAL,
* rsaPublicExponent [200] EXPLICIT INTEGER OPTIONAL,
* mgfDigest [203] EXPLICIT SET OF INTEGER OPTIONAL,
@@ -184,7 +209,7 @@
* originationExpireDateTime [401] EXPLICIT INTEGER OPTIONAL,
* usageExpireDateTime [402] EXPLICIT INTEGER OPTIONAL,
* usageCountLimit [405] EXPLICIT INTEGER OPTIONAL,
- * userSecureId [502] EXPLICIT INTEGER OPTIONAL, -- only used on import
+ * userSecureId [502] EXPLICIT INTEGER OPTIONAL, -- Only used on key import
* noAuthRequired [503] EXPLICIT NULL OPTIONAL,
* userAuthType [504] EXPLICIT INTEGER OPTIONAL,
* authTimeout [505] EXPLICIT INTEGER OPTIONAL,
@@ -210,6 +235,8 @@
* bootPatchLevel [719] EXPLICIT INTEGER OPTIONAL,
* deviceUniqueAttestation [720] EXPLICIT NULL OPTIONAL,
* attestationIdSecondImei [723] EXPLICIT OCTET_STRING OPTIONAL,
+ * -- moduleHash contains a SHA-256 hash of DER-encoded `Modules`
+ * moduleHash [724] EXPLICIT OCTET_STRING OPTIONAL,
* }
*/
Certificate[] certificateChain;
diff --git a/security/keymint/aidl/default/Android.bp b/security/keymint/aidl/default/Android.bp
index ff2393c..0197141 100644
--- a/security/keymint/aidl/default/Android.bp
+++ b/security/keymint/aidl/default/Android.bp
@@ -104,6 +104,7 @@
],
}
+// The following target declares the latest version of KeyMint.
prebuilt_etc {
name: "android.hardware.hardware_keystore.xml",
sub_dir: "permissions",
@@ -111,6 +112,24 @@
src: "android.hardware.hardware_keystore.xml",
}
+// The following targets (and underlying XML files) declare specific
+// versions of KeyMint. Vendors should use the version that matches the
+// version of the KeyMint HAL that the device implements.
+
+prebuilt_etc {
+ name: "android.hardware.hardware_keystore_V1.xml",
+ sub_dir: "permissions",
+ vendor: true,
+ src: "android.hardware.hardware_keystore_V1.xml",
+}
+
+prebuilt_etc {
+ name: "android.hardware.hardware_keystore_V2.xml",
+ sub_dir: "permissions",
+ vendor: true,
+ src: "android.hardware.hardware_keystore_V2.xml",
+}
+
prebuilt_etc {
name: "android.hardware.hardware_keystore_V3.xml",
sub_dir: "permissions",
@@ -118,6 +137,13 @@
src: "android.hardware.hardware_keystore_V3.xml",
}
+prebuilt_etc {
+ name: "android.hardware.hardware_keystore_V4.xml",
+ sub_dir: "permissions",
+ vendor: true,
+ src: "android.hardware.hardware_keystore_V4.xml",
+}
+
rust_library {
name: "libkmr_hal_nonsecure",
crate_name: "kmr_hal_nonsecure",
diff --git a/security/keymint/aidl/default/android.hardware.hardware_keystore_V1.xml b/security/keymint/aidl/default/android.hardware.hardware_keystore_V1.xml
new file mode 100644
index 0000000..e5a9345
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.hardware_keystore_V1.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<permissions>
+ <feature name="android.hardware.hardware_keystore" version="100" />
+</permissions>
diff --git a/security/keymint/aidl/default/android.hardware.hardware_keystore_V2.xml b/security/keymint/aidl/default/android.hardware.hardware_keystore_V2.xml
new file mode 100644
index 0000000..2ebf1fe
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.hardware_keystore_V2.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<permissions>
+ <feature name="android.hardware.hardware_keystore" version="200" />
+</permissions>
diff --git a/security/keymint/aidl/default/android.hardware.hardware_keystore_V4.xml b/security/keymint/aidl/default/android.hardware.hardware_keystore_V4.xml
new file mode 100644
index 0000000..1ab2133
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.hardware_keystore_V4.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<permissions>
+ <feature name="android.hardware.hardware_keystore" version="400" />
+</permissions>
diff --git a/security/keymint/aidl/default/hal/lib.rs b/security/keymint/aidl/default/hal/lib.rs
index 621f077..fad807f 100644
--- a/security/keymint/aidl/default/hal/lib.rs
+++ b/security/keymint/aidl/default/hal/lib.rs
@@ -47,11 +47,9 @@
/// Get boot information based on system properties.
pub fn get_boot_info() -> kmr_wire::SetBootInfoRequest {
- // No access to a verified boot key.
- let verified_boot_key = vec![0; 32];
let vbmeta_digest = get_property("ro.boot.vbmeta.digest").unwrap_or_else(|_| "00".repeat(32));
let verified_boot_hash = hex::decode(&vbmeta_digest).unwrap_or_else(|_e| {
- error!("failed to parse hex data in '{}'", vbmeta_digest);
+ error!("failed to parse VBMeta digest hex data in '{vbmeta_digest}': {_e:?}");
vec![0; 32]
});
let device_boot_locked = match get_property("ro.boot.vbmeta.device_state")
@@ -65,6 +63,18 @@
false
}
};
+ let verified_boot_key_digest =
+ get_property("ro.boot.vbmeta.public_key_digest").unwrap_or_else(|_| "00".repeat(32));
+ let verified_boot_key = match device_boot_locked {
+ true => hex::decode(&verified_boot_key_digest).unwrap_or_else(|_e| {
+ error!("Failed to parse Verified Boot key hex data in '{verified_boot_key_digest}': {_e:?}");
+ vec![0; 32]
+ }),
+ // VTS-16+ requires the attested Verified Boot key to be 32 bytes of zeroes when the
+ // bootloader is unlocked, so we ignore the property's value in that case. Behaviour
+ // prior to VTS-16 is unspecified, so it's fine to return the same.
+ false => vec![0; 32],
+ };
let verified_boot_state = match get_property("ro.boot.verifiedbootstate")
.unwrap_or_else(|_| "no-prop".to_string())
.as_str()
diff --git a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
index 083a9aa..b41da3f 100644
--- a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
+++ b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
@@ -95,6 +95,18 @@
<< "Verified boot state must be \"UNVERIFIED\" aka \"orange\".";
}
+// Check that the attested Verified Boot key is 32 bytes of zeroes since the bootloader is unlocked.
+TEST_P(BootloaderStateTest, VerifiedBootKeyAllZeroes) {
+ // Gate this test to avoid waiver issues.
+ if (get_vsr_api_level() <= __ANDROID_API_V__) {
+ return;
+ }
+
+ std::vector<uint8_t> expectedVbKey(32, 0);
+ ASSERT_EQ(attestedVbKey_, expectedVbKey) << "Verified Boot key digest must be 32 bytes of "
+ "zeroes since the bootloader is unlocked.";
+}
+
// Following error codes from avb_slot_data() mean that slot data was loaded
// (even if verification failed).
static inline bool avb_slot_data_loaded(AvbSlotVerifyResult result) {
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 51afa12..09446ce 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -83,6 +83,16 @@
// additional overhead, for the digest algorithmIdentifier required by PKCS#1.
const size_t kPkcs1UndigestedSignaturePaddingOverhead = 11;
+// Determine whether the key description is for an asymmetric key.
+bool is_asymmetric(const AuthorizationSet& key_desc) {
+ auto algorithm = key_desc.GetTagValue(TAG_ALGORITHM);
+ if (algorithm && (algorithm.value() == Algorithm::RSA || algorithm.value() == Algorithm::EC)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
size_t count_tag_invalid_entries(const std::vector<KeyParameter>& authorizations) {
return std::count_if(authorizations.begin(), authorizations.end(),
[](const KeyParameter& e) -> bool { return e.tag == Tag::INVALID; });
@@ -418,11 +428,14 @@
vector<Certificate> attest_cert_chain;
// If an attestation is requested, but the system is RKP-only, we need to supply an explicit
// attestation key. Else the result is a key without an attestation.
- // If the RKP-only value is undeterminable (i.e., when running on GSI), generate and use the
- // attest key anyways. In the case that using an attest key is not supported
- // (shouldSkipAttestKeyTest), assume the device has factory keys (so not RKP-only).
+ // - If the RKP-only value is undeterminable (i.e., when running on GSI), generate and use the
+ // `ATTEST_KEY` anyways.
+ // - In the case that using an `ATTEST_KEY` is not supported
+ // (shouldSkipAttestKeyTest), assume the device has factory keys (so not RKP-only).
+ // - If the key being generated is a symmetric key (from test cases that check that the
+ // attestation parameters are correctly ignored), don't try to use an `ATTEST_KEY`.
if (isRkpOnly().value_or(true) && key_desc.Contains(TAG_ATTESTATION_CHALLENGE) &&
- !shouldSkipAttestKeyTest()) {
+ !shouldSkipAttestKeyTest() && is_asymmetric(key_desc)) {
AuthorizationSet attest_key_desc =
AuthorizationSetBuilder().EcdsaKey(EcCurve::P_256).AttestKey().SetDefaultValidity();
attest_key.emplace();
@@ -462,10 +475,7 @@
*key_characteristics = std::move(creationResult.keyCharacteristics);
*cert_chain = std::move(creationResult.certificateChain);
- auto algorithm = key_desc.GetTagValue(TAG_ALGORITHM);
- EXPECT_TRUE(algorithm);
- if (algorithm &&
- (algorithm.value() == Algorithm::RSA || algorithm.value() == Algorithm::EC)) {
+ if (is_asymmetric(key_desc)) {
EXPECT_GE(cert_chain->size(), 1);
if (key_desc.Contains(TAG_ATTESTATION_CHALLENGE)) {
if (attest_key) {
@@ -506,10 +516,7 @@
*key_characteristics = std::move(creationResult.keyCharacteristics);
cert_chain_ = std::move(creationResult.certificateChain);
- auto algorithm = key_desc.GetTagValue(TAG_ALGORITHM);
- EXPECT_TRUE(algorithm);
- if (algorithm &&
- (algorithm.value() == Algorithm::RSA || algorithm.value() == Algorithm::EC)) {
+ if (is_asymmetric(key_desc)) {
EXPECT_GE(cert_chain_.size(), 1);
if (key_desc.Contains(TAG_ATTESTATION_CHALLENGE)) EXPECT_GT(cert_chain_.size(), 1);
} else {
@@ -554,10 +561,7 @@
for (auto& entry : key_characteristics_) {
allAuths.push_back(AuthorizationSet(entry.authorizations));
}
- auto algorithm = allAuths.GetTagValue(TAG_ALGORITHM);
- EXPECT_TRUE(algorithm);
- if (algorithm &&
- (algorithm.value() == Algorithm::RSA || algorithm.value() == Algorithm::EC)) {
+ if (is_asymmetric(allAuths)) {
EXPECT_GE(cert_chain_.size(), 1);
} else {
// For symmetric keys there should be no certificates.
@@ -1904,16 +1908,29 @@
}
}
+ if (get_vsr_api_level() > __ANDROID_API_V__) {
+ // The Verified Boot key field should be exactly 32 bytes since it
+ // contains the SHA-256 hash of the key on locked devices or 32 bytes
+ // of zeroes on unlocked devices. This wasn't checked for earlier
+ // versions of the KeyMint HAL, so only only be strict for VSR-16+.
+ EXPECT_EQ(verified_boot_key.size(), 32);
+ } else if (get_vsr_api_level() == __ANDROID_API_V__) {
+ // The Verified Boot key field should be:
+ // - Exactly 32 bytes on locked devices since it should contain
+ // the SHA-256 hash of the key, or
+ // - Up to 32 bytes of zeroes on unlocked devices (behaviour on
+ // unlocked devices isn't specified in the HAL interface
+ // specification).
+ // Thus, we can't check for strict equality in case unlocked devices
+ // report values with less than 32 bytes. This wasn't checked for
+ // earlier versions of the KeyMint HAL, so only check on VSR-15.
+ EXPECT_LE(verified_boot_key.size(), 32);
+ }
+
// Verified Boot key should be all zeroes if the boot state is "orange".
std::string empty_boot_key(32, '\0');
std::string verified_boot_key_str((const char*)verified_boot_key.data(),
verified_boot_key.size());
- if (get_vsr_api_level() >= __ANDROID_API_V__) {
- // The attestation should contain the SHA-256 hash of the verified boot
- // key. However, this was not checked for earlier versions of the KeyMint
- // HAL so only be strict for VSR-V and above.
- EXPECT_LE(verified_boot_key.size(), 32);
- }
EXPECT_NE(property_get("ro.boot.verifiedbootstate", property_value, ""), 0);
if (!strcmp(property_value, "green")) {
EXPECT_EQ(verified_boot_state, VerifiedBoot::VERIFIED);
@@ -2228,6 +2245,33 @@
namespace {
+std::optional<std::string> validateP256Point(const std::vector<uint8_t>& x_buffer,
+ const std::vector<uint8_t>& y_buffer) {
+ auto group = EC_GROUP_Ptr(EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1));
+ if (group.get() == nullptr) {
+ return "Error creating EC group by curve name for prime256v1";
+ }
+
+ auto point = EC_POINT_Ptr(EC_POINT_new(group.get()));
+ BIGNUM_Ptr x(BN_bin2bn(x_buffer.data(), x_buffer.size(), nullptr));
+ BIGNUM_Ptr y(BN_bin2bn(y_buffer.data(), y_buffer.size(), nullptr));
+ if (!EC_POINT_set_affine_coordinates_GFp(group.get(), point.get(), x.get(), y.get(), nullptr)) {
+ return "Failed to set affine coordinates.";
+ }
+ if (!EC_POINT_is_on_curve(group.get(), point.get(), nullptr)) {
+ return "Point is not on curve.";
+ }
+ if (EC_POINT_is_at_infinity(group.get(), point.get())) {
+ return "Point is at infinity.";
+ }
+ const auto* generator = EC_GROUP_get0_generator(group.get());
+ if (!EC_POINT_cmp(group.get(), generator, point.get(), nullptr)) {
+ return "Point is equal to generator.";
+ }
+
+ return std::nullopt;
+}
+
void check_cose_key(const vector<uint8_t>& data, bool testMode) {
auto [parsedPayload, __, payloadParseErr] = cppbor::parse(data);
ASSERT_TRUE(parsedPayload) << "Key parse failed: " << payloadParseErr;
@@ -2261,6 +2305,24 @@
" -3 : \\{(0x[0-9a-f]{2}, ){31}0x[0-9a-f]{2}\\},\n" // pub_y: data
"\\}"));
}
+
+ ASSERT_TRUE(parsedPayload->asMap()) << "CBOR item was not a map";
+
+ ASSERT_TRUE(parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_X))
+ << "CBOR map did not contain x coordinate of public key";
+ ASSERT_TRUE(parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_X)->asBstr())
+ << "x coordinate of public key was not a bstr";
+ const auto& x = parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_X)->asBstr()->value();
+
+ ASSERT_TRUE(parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_Y))
+ << "CBOR map did not contain y coordinate of public key";
+ ASSERT_TRUE(parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_Y)->asBstr())
+ << "y coordinate of public key was not a bstr";
+ const auto& y = parsedPayload->asMap()->get(CoseKey::Label::PUBKEY_Y)->asBstr()->value();
+
+ auto errorMessage = validateP256Point(x, y);
+ EXPECT_EQ(errorMessage, std::nullopt)
+ << *errorMessage << " x: " << bin2hex(x) << " y: " << bin2hex(y);
}
} // namespace
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index 067db78..416e6c0 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -8305,21 +8305,15 @@
GTEST_SKIP() << "Option --arm_deleteAllKeys not set";
return;
}
+ // This test was introduced in API level 36, but is not version guarded because it requires a
+ // manual opt-in anyway. This makes it easier to run on older devices.
auto error = GenerateKey(AuthorizationSetBuilder()
.RsaSigningKey(2048, 65537)
.Digest(Digest::NONE)
.Padding(PaddingMode::NONE)
.Authorization(TAG_NO_AUTH_REQUIRED)
- .Authorization(TAG_ROLLBACK_RESISTANCE)
.SetDefaultValidity());
- if (error == ErrorCode::ROLLBACK_RESISTANCE_UNAVAILABLE) {
- GTEST_SKIP() << "Rollback resistance not supported";
- }
-
- // Delete must work if rollback protection is implemented
ASSERT_EQ(ErrorCode::OK, error);
- AuthorizationSet hardwareEnforced(SecLevelAuthorizations());
- ASSERT_TRUE(hardwareEnforced.Contains(TAG_ROLLBACK_RESISTANCE));
ASSERT_EQ(ErrorCode::OK, DeleteAllKeys());
diff --git a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
index 9f7322a..f7639bf 100644
--- a/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
+++ b/security/keymint/aidl/vts/functional/SecureElementProvisioningTest.cpp
@@ -114,10 +114,22 @@
const auto& vbKey = rot->asArray()->get(pos++);
ASSERT_TRUE(vbKey);
ASSERT_TRUE(vbKey->asBstr());
- if (get_vsr_api_level() >= __ANDROID_API_V__) {
- // The attestation should contain the SHA-256 hash of the verified boot
- // key. However, this not was checked for earlier versions of the KeyMint
- // HAL so only be strict for VSR-V and above.
+ if (get_vsr_api_level() > __ANDROID_API_V__) {
+ // The Verified Boot key field should be exactly 32 bytes since it
+ // contains the SHA-256 hash of the key on locked devices or 32 bytes
+ // of zeroes on unlocked devices. This wasn't checked for earlier
+ // versions of the KeyMint HAL, so only only be strict for VSR-16+.
+ ASSERT_EQ(vbKey->asBstr()->value().size(), 32);
+ } else if (get_vsr_api_level() == __ANDROID_API_V__) {
+ // The Verified Boot key field should be:
+ // - Exactly 32 bytes on locked devices since it should contain
+ // the SHA-256 hash of the key, or
+ // - Up to 32 bytes of zeroes on unlocked devices (behaviour on
+ // unlocked devices isn't specified in the HAL interface
+ // specification).
+ // Thus, we can't check for strict equality in case unlocked devices
+ // report values with less than 32 bytes. This wasn't checked for
+ // earlier versions of the KeyMint HAL, so only check on VSR-15.
ASSERT_LE(vbKey->asBstr()->value().size(), 32);
}
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index 6cb00f2..4e0ce29 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -29,6 +29,11 @@
using bytevec = std::vector<uint8_t>;
using namespace cppcose;
+constexpr std::string_view kErrorChallengeMismatch = "challenges do not match";
+constexpr std::string_view kErrorUdsCertsAreRequired = "UdsCerts are required";
+constexpr std::string_view kErrorKeysToSignMismatch = "KeysToSign do not match";
+constexpr std::string_view kErrorDiceChainIsDegenerate = "DICE chain is degenerate";
+
extern bytevec kTestMacKey;
// The Google root key for the Endpoint Encryption Key chain, encoded as COSE_Sign1
@@ -209,6 +214,23 @@
ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr,
const std::string& instanceName);
+/** Checks whether the CSRs contain DICE certificate chains that have root certificates
+ * with the same public key.
+ */
+ErrMsgOr<bool> compareRootPublicKeysInDiceChains(const std::vector<uint8_t>& csr1,
+ std::string_view instanceName1,
+ const std::vector<uint8_t>& csr2,
+ std::string_view instanceName2);
+
+/** Checks whether the component name in the configuration descriptor in the leaf certificate
+ * of the primary KeyMint instance's DICE certificate chain contains "keymint"
+ */
+ErrMsgOr<bool> verifyComponentNameInKeyMintDiceChain(const std::vector<uint8_t>& csr);
+
+/** Checks whether the DICE chain in the CSR has a certificate with a non-normal mode. */
+ErrMsgOr<bool> hasNonNormalModeInDiceChain(const std::vector<uint8_t>& csr,
+ std::string_view instanceName);
+
/** Verify the DICE chain. */
ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc,
hwtrust::DiceChain::Kind kind, bool allowAnyMode,
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index e11f021..eaeec32 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -45,6 +45,7 @@
constexpr int32_t kBccPayloadKeyUsage = -4670553;
constexpr int kP256AffinePointSize = 32;
constexpr uint32_t kNumTeeDeviceInfoEntries = 14;
+constexpr std::string_view kKeyMintComponentName = "keymint";
using EC_KEY_Ptr = bssl::UniquePtr<EC_KEY>;
using EVP_PKEY_Ptr = bssl::UniquePtr<EVP_PKEY>;
@@ -123,37 +124,6 @@
return std::make_tuple(std::move(pubX), std::move(pubY));
}
-ErrMsgOr<bytevec> getRawPublicKey(const EVP_PKEY_Ptr& pubKey) {
- if (pubKey.get() == nullptr) {
- return "pkey is null.";
- }
- int keyType = EVP_PKEY_base_id(pubKey.get());
- switch (keyType) {
- case EVP_PKEY_EC: {
- int nid = EVP_PKEY_bits(pubKey.get()) == 384 ? NID_secp384r1 : NID_X9_62_prime256v1;
- auto ecKey = EC_KEY_Ptr(EVP_PKEY_get1_EC_KEY(pubKey.get()));
- if (ecKey.get() == nullptr) {
- return "Failed to get ec key";
- }
- return ecKeyGetPublicKey(ecKey.get(), nid);
- }
- case EVP_PKEY_ED25519: {
- bytevec rawPubKey;
- size_t rawKeySize = 0;
- if (!EVP_PKEY_get_raw_public_key(pubKey.get(), NULL, &rawKeySize)) {
- return "Failed to get raw public key.";
- }
- rawPubKey.resize(rawKeySize);
- if (!EVP_PKEY_get_raw_public_key(pubKey.get(), rawPubKey.data(), &rawKeySize)) {
- return "Failed to get raw public key.";
- }
- return rawPubKey;
- }
- default:
- return "Unknown key type.";
- }
-}
-
ErrMsgOr<std::tuple<bytevec, bytevec>> generateEc256KeyPair() {
auto ec_key = EC_KEY_Ptr(EC_KEY_new());
if (ec_key.get() == nullptr) {
@@ -166,7 +136,7 @@
}
if (EC_KEY_set_group(ec_key.get(), group.get()) != 1 ||
- EC_KEY_generate_key(ec_key.get()) != 1 || EC_KEY_check_key(ec_key.get()) < 0) {
+ EC_KEY_generate_key(ec_key.get()) != 1 || EC_KEY_check_key(ec_key.get()) != 1) {
return "Error generating key";
}
@@ -331,17 +301,22 @@
return chain.encode();
}
+bool maybeOverrideAllowAnyMode(bool allowAnyMode) {
+ // Use ro.build.type instead of ro.debuggable because ro.debuggable=1 for VTS testing
+ std::string build_type = ::android::base::GetProperty("ro.build.type", "");
+ if (!build_type.empty() && build_type != "user") {
+ return true;
+ }
+ return allowAnyMode;
+}
+
ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc,
hwtrust::DiceChain::Kind kind, bool allowAnyMode,
bool allowDegenerate,
const std::string& instanceName) {
auto encodedBcc = bcc->encode();
- // Use ro.build.type instead of ro.debuggable because ro.debuggable=1 for VTS testing
- std::string build_type = ::android::base::GetProperty("ro.build.type", "");
- if (!build_type.empty() && build_type != "user") {
- allowAnyMode = true;
- }
+ allowAnyMode = maybeOverrideAllowAnyMode(allowAnyMode);
auto chain =
hwtrust::DiceChain::Verify(encodedBcc, kind, allowAnyMode, deviceSuffix(instanceName));
@@ -779,233 +754,9 @@
/*isFactory=*/false, allowAnyMode);
}
-ErrMsgOr<X509_Ptr> parseX509Cert(const std::vector<uint8_t>& cert) {
- CRYPTO_BUFFER_Ptr certBuf(CRYPTO_BUFFER_new(cert.data(), cert.size(), nullptr));
- if (!certBuf.get()) {
- return "Failed to create crypto buffer.";
- }
- X509_Ptr result(X509_parse_from_buffer(certBuf.get()));
- if (!result.get()) {
- return "Failed to parse certificate.";
- }
- return result;
-}
-
-std::string getX509IssuerName(const X509_Ptr& cert) {
- char* name = X509_NAME_oneline(X509_get_issuer_name(cert.get()), nullptr, 0);
- std::string result(name);
- OPENSSL_free(name);
- return result;
-}
-
-std::string getX509SubjectName(const X509_Ptr& cert) {
- char* name = X509_NAME_oneline(X509_get_subject_name(cert.get()), nullptr, 0);
- std::string result(name);
- OPENSSL_free(name);
- return result;
-}
-
-// Validates the certificate chain and returns the leaf public key.
-ErrMsgOr<bytevec> validateCertChain(const cppbor::Array& chain) {
- bytevec rawPubKey;
- for (size_t i = 0; i < chain.size(); ++i) {
- // Root must be self-signed.
- size_t signingCertIndex = (i > 0) ? i - 1 : i;
- auto& keyCertItem = chain[i];
- auto& signingCertItem = chain[signingCertIndex];
- if (!keyCertItem || !keyCertItem->asBstr()) {
- return "Key certificate must be a Bstr.";
- }
- if (!signingCertItem || !signingCertItem->asBstr()) {
- return "Signing certificate must be a Bstr.";
- }
-
- auto keyCert = parseX509Cert(keyCertItem->asBstr()->value());
- if (!keyCert) {
- return keyCert.message();
- }
- auto signingCert = parseX509Cert(signingCertItem->asBstr()->value());
- if (!signingCert) {
- return signingCert.message();
- }
-
- EVP_PKEY_Ptr pubKey(X509_get_pubkey(keyCert->get()));
- if (!pubKey.get()) {
- return "Failed to get public key.";
- }
- EVP_PKEY_Ptr signingPubKey(X509_get_pubkey(signingCert->get()));
- if (!signingPubKey.get()) {
- return "Failed to get signing public key.";
- }
-
- if (!X509_verify(keyCert->get(), signingPubKey.get())) {
- return "Verification of certificate " + std::to_string(i) +
- " faile. OpenSSL error string: " + ERR_error_string(ERR_get_error(), NULL);
- }
-
- auto certIssuer = getX509IssuerName(*keyCert);
- auto signerSubj = getX509SubjectName(*signingCert);
- if (certIssuer != signerSubj) {
- return "Certificate " + std::to_string(i) + " has wrong issuer. Signer subject is " +
- signerSubj + " Issuer subject is " + certIssuer;
- }
- if (i == chain.size() - 1) {
- auto key = getRawPublicKey(pubKey);
- if (!key) return key.moveMessage();
- rawPubKey = key.moveValue();
- }
- }
- return rawPubKey;
-}
-
-std::optional<std::string> validateUdsCerts(const cppbor::Map& udsCerts,
- const bytevec& udsCoseKeyBytes) {
- for (const auto& [signerName, udsCertChain] : udsCerts) {
- if (!signerName || !signerName->asTstr()) {
- return "Signer Name must be a Tstr.";
- }
- if (!udsCertChain || !udsCertChain->asArray()) {
- return "UDS certificate chain must be an Array.";
- }
- if (udsCertChain->asArray()->size() < 2) {
- return "UDS certificate chain must have at least two entries: root and leaf.";
- }
-
- auto leafPubKey = validateCertChain(*udsCertChain->asArray());
- if (!leafPubKey) {
- return leafPubKey.message();
- }
- auto coseKey = CoseKey::parse(udsCoseKeyBytes);
- if (!coseKey) {
- return coseKey.moveMessage();
- }
- auto curve = coseKey->getIntValue(CoseKey::CURVE);
- if (!curve) {
- return "CoseKey must contain curve.";
- }
- bytevec udsPub;
- if (curve == CoseKeyCurve::P256 || curve == CoseKeyCurve::P384) {
- auto pubKey = coseKey->getEcPublicKey();
- if (!pubKey) {
- return pubKey.moveMessage();
- }
- // convert public key to uncompressed form by prepending 0x04 at begin.
- pubKey->insert(pubKey->begin(), 0x04);
- udsPub = pubKey.moveValue();
- } else if (curve == CoseKeyCurve::ED25519) {
- auto& pubkey = coseKey->getMap().get(cppcose::CoseKey::PUBKEY_X);
- if (!pubkey || !pubkey->asBstr()) {
- return "Invalid public key.";
- }
- udsPub = pubkey->asBstr()->value();
- } else {
- return "Unknown curve.";
- }
- if (*leafPubKey != udsPub) {
- return "Leaf public key in UDS certificate chain doesn't match UDS public key.";
- }
- }
- return std::nullopt;
-}
-
-ErrMsgOr<std::unique_ptr<cppbor::Array>> parseAndValidateCsrPayload(
- const cppbor::Array& keysToSign, const std::vector<uint8_t>& csrPayload,
- const RpcHardwareInfo& rpcHardwareInfo, bool isFactory) {
- auto [parsedCsrPayload, _, errMsg] = cppbor::parse(csrPayload);
- if (!parsedCsrPayload) {
- return errMsg;
- }
-
- std::unique_ptr<cppbor::Array> parsed(parsedCsrPayload.release()->asArray());
- if (!parsed) {
- return "CSR payload is not a CBOR array.";
- }
-
- if (parsed->size() != 4U) {
- return "CSR payload must contain version, certificate type, device info, keys. "
- "However, the parsed CSR payload has " +
- std::to_string(parsed->size()) + " entries.";
- }
-
- auto signedVersion = parsed->get(0)->asUint();
- auto signedCertificateType = parsed->get(1)->asTstr();
- auto signedDeviceInfo = parsed->get(2)->asMap();
- auto signedKeys = parsed->get(3)->asArray();
-
- if (!signedVersion || signedVersion->value() != 3U) {
- return "CSR payload version must be an unsigned integer and must be equal to 3.";
- }
- if (!signedCertificateType) {
- // Certificate type is allowed to be extendend by vendor, i.e. we can't
- // enforce its value.
- return "Certificate type must be a Tstr.";
- }
- if (!signedDeviceInfo) {
- return "Device info must be an Map.";
- }
- if (!signedKeys) {
- return "Keys must be an Array.";
- }
-
- auto result =
- parseAndValidateDeviceInfo(signedDeviceInfo->encode(), rpcHardwareInfo, isFactory);
- if (!result) {
- return result.message();
- }
-
- if (signedKeys->encode() != keysToSign.encode()) {
- return "Signed keys do not match.";
- }
-
- return std::move(parsed);
-}
-
-ErrMsgOr<bytevec> parseAndValidateAuthenticatedRequestSignedPayload(
- const std::vector<uint8_t>& signedPayload, const std::vector<uint8_t>& challenge) {
- auto [parsedSignedPayload, _, errMsg] = cppbor::parse(signedPayload);
- if (!parsedSignedPayload) {
- return errMsg;
- }
- if (!parsedSignedPayload->asArray()) {
- return "SignedData payload is not a CBOR array.";
- }
- if (parsedSignedPayload->asArray()->size() != 2U) {
- return "SignedData payload must contain the challenge and request. However, the parsed "
- "SignedData payload has " +
- std::to_string(parsedSignedPayload->asArray()->size()) + " entries.";
- }
-
- auto signedChallenge = parsedSignedPayload->asArray()->get(0)->asBstr();
- auto signedRequest = parsedSignedPayload->asArray()->get(1)->asBstr();
-
- if (!signedChallenge) {
- return "Challenge must be a Bstr.";
- }
-
- if (challenge.size() > 64) {
- return "Challenge size must be between 0 and 64 bytes inclusive. "
- "However, challenge is " +
- std::to_string(challenge.size()) + " bytes long.";
- }
-
- auto challengeBstr = cppbor::Bstr(challenge);
- if (*signedChallenge != challengeBstr) {
- return "Signed challenge does not match."
- "\n Actual: " +
- cppbor::prettyPrint(signedChallenge->asBstr(), 64 /* maxBStrSize */) +
- "\nExpected: " + cppbor::prettyPrint(&challengeBstr, 64 /* maxBStrSize */);
- }
-
- if (!signedRequest) {
- return "Request must be a Bstr.";
- }
-
- return signedRequest->value();
-}
-
ErrMsgOr<hwtrust::DiceChain::Kind> getDiceChainKind() {
int vendor_api_level = ::android::base::GetIntProperty("ro.vendor.api_level", -1);
- if (vendor_api_level == __ANDROID_API_T__) {
+ if (vendor_api_level <= __ANDROID_API_T__) {
return hwtrust::DiceChain::Kind::kVsr13;
} else if (vendor_api_level == __ANDROID_API_U__) {
return hwtrust::DiceChain::Kind::kVsr14;
@@ -1018,87 +769,8 @@
}
}
-ErrMsgOr<bytevec> parseAndValidateAuthenticatedRequest(const std::vector<uint8_t>& request,
- const std::vector<uint8_t>& challenge,
- const std::string& instanceName,
- bool allowAnyMode = false,
- bool allowDegenerate = true,
- bool requireUdsCerts = false) {
- auto [parsedRequest, _, csrErrMsg] = cppbor::parse(request);
- if (!parsedRequest) {
- return csrErrMsg;
- }
- if (!parsedRequest->asArray()) {
- return "AuthenticatedRequest is not a CBOR array.";
- }
- if (parsedRequest->asArray()->size() != 4U) {
- return "AuthenticatedRequest must contain version, UDS certificates, DICE chain, and "
- "signed data. However, the parsed AuthenticatedRequest has " +
- std::to_string(parsedRequest->asArray()->size()) + " entries.";
- }
-
- auto version = parsedRequest->asArray()->get(0)->asUint();
- auto udsCerts = parsedRequest->asArray()->get(1)->asMap();
- auto diceCertChain = parsedRequest->asArray()->get(2)->asArray();
- auto signedData = parsedRequest->asArray()->get(3)->asArray();
-
- if (!version || version->value() != 1U) {
- return "AuthenticatedRequest version must be an unsigned integer and must be equal to 1.";
- }
-
- if (!udsCerts) {
- return "AuthenticatedRequest UdsCerts must be a Map.";
- }
- if (requireUdsCerts && udsCerts->size() == 0) {
- return "AuthenticatedRequest UdsCerts must not be empty.";
- }
- if (!diceCertChain) {
- return "AuthenticatedRequest DiceCertChain must be an Array.";
- }
- if (!signedData) {
- return "AuthenticatedRequest SignedData must be an Array.";
- }
-
- // DICE chain is [ pubkey, + DiceChainEntry ].
- auto diceChainKind = getDiceChainKind();
- if (!diceChainKind) {
- return diceChainKind.message();
- }
-
- auto diceContents =
- validateBcc(diceCertChain, *diceChainKind, allowAnyMode, allowDegenerate, instanceName);
- if (!diceContents) {
- return diceContents.message() + "\n" + prettyPrint(diceCertChain);
- }
-
- if (!diceCertChain->get(0)->asMap()) {
- return "AuthenticatedRequest The first entry in DiceCertChain must be a Map.";
- }
- auto udsPub = diceCertChain->get(0)->asMap()->encode();
- auto error = validateUdsCerts(*udsCerts, udsPub);
- if (error) {
- return *error;
- }
-
- if (diceContents->empty()) {
- return "AuthenticatedRequest DiceContents must not be empty.";
- }
- auto& kmDiceKey = diceContents->back().pubKey;
- auto signedPayload = verifyAndParseCoseSign1(signedData, kmDiceKey, /*aad=*/{});
- if (!signedPayload) {
- return signedPayload.message();
- }
-
- auto payload = parseAndValidateAuthenticatedRequestSignedPayload(*signedPayload, challenge);
- if (!payload) {
- return payload.message();
- }
-
- return payload;
-}
-
ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyCsr(
- const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
+ const cppbor::Array& keysToSign, const std::vector<uint8_t>& encodedCsr,
const RpcHardwareInfo& rpcHardwareInfo, const std::string& instanceName,
const std::vector<uint8_t>& challenge, bool isFactory, bool allowAnyMode = false,
bool allowDegenerate = true, bool requireUdsCerts = false) {
@@ -1108,14 +780,68 @@
") does not match expected version (3).";
}
- auto csrPayload = parseAndValidateAuthenticatedRequest(
- csr, challenge, instanceName, allowAnyMode, allowDegenerate, requireUdsCerts);
-
- if (!csrPayload) {
- return csrPayload.message();
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
}
- return parseAndValidateCsrPayload(keysToSign, *csrPayload, rpcHardwareInfo, isFactory);
+ allowAnyMode = maybeOverrideAllowAnyMode(allowAnyMode);
+
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, isFactory, allowAnyMode,
+ deviceSuffix(instanceName));
+
+ if (!csr.ok()) {
+ return csr.error().message();
+ }
+
+ if (!allowDegenerate) {
+ auto diceChain = csr->getDiceChain();
+ if (!diceChain.ok()) {
+ return diceChain.error().message();
+ }
+
+ if (!diceChain->IsProper()) {
+ return kErrorDiceChainIsDegenerate;
+ }
+ }
+
+ if (requireUdsCerts && !csr->hasUdsCerts()) {
+ return kErrorUdsCertsAreRequired;
+ }
+
+ auto equalChallenges = csr->compareChallenge(challenge);
+ if (!equalChallenges.ok()) {
+ return equalChallenges.error().message();
+ }
+
+ if (!*equalChallenges) {
+ return kErrorChallengeMismatch;
+ }
+
+ auto equalKeysToSign = csr->compareKeysToSign(keysToSign.encode());
+ if (!equalKeysToSign.ok()) {
+ return equalKeysToSign.error().message();
+ }
+
+ if (!*equalKeysToSign) {
+ return kErrorKeysToSignMismatch;
+ }
+
+ auto csrPayload = csr->getCsrPayload();
+ if (!csrPayload) {
+ return csrPayload.error().message();
+ }
+
+ auto [csrPayloadDecoded, _, errMsg] = cppbor::parse(*csrPayload);
+ if (!csrPayloadDecoded) {
+ return errMsg;
+ }
+
+ if (!csrPayloadDecoded->asArray()) {
+ return "CSR payload is not an array.";
+ }
+
+ return std::unique_ptr<cppbor::Array>(csrPayloadDecoded.release()->asArray());
}
ErrMsgOr<std::unique_ptr<cppbor::Array>> verifyFactoryCsr(
@@ -1143,8 +869,8 @@
return diceChainKind.message();
}
- auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*allowAnyMode*/,
- deviceSuffix(instanceName));
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*isFactory*/,
+ false /*allowAnyMode*/, deviceSuffix(instanceName));
if (!csr.ok()) {
return csr.error().message();
}
@@ -1157,4 +883,117 @@
return diceChain->IsProper();
}
+std::string hexlify(const std::vector<uint8_t>& bytes) {
+ std::stringstream ss;
+ ss << std::hex << std::setfill('0');
+
+ for (const auto& byte : bytes) {
+ ss << std::setw(2) << static_cast<int>(byte);
+ }
+
+ return ss.str();
+}
+
+ErrMsgOr<bool> compareRootPublicKeysInDiceChains(const std::vector<uint8_t>& encodedCsr1,
+ std::string_view instanceName1,
+ const std::vector<uint8_t>& encodedCsr2,
+ std::string_view instanceName2) {
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto csr1 = hwtrust::Csr::validate(encodedCsr1, *diceChainKind, false /*isFactory*/,
+ false /*allowAnyMode*/, deviceSuffix(instanceName1));
+ if (!csr1.ok()) {
+ return csr1.error().message();
+ }
+
+ auto diceChain1 = csr1->getDiceChain();
+ if (!diceChain1.ok()) {
+ return diceChain1.error().message();
+ }
+
+ auto proper1 = diceChain1->IsProper();
+ if (!proper1) {
+ return std::string(instanceName1) + " has a degenerate DICE chain:\n" +
+ hexlify(encodedCsr1);
+ }
+
+ auto csr2 = hwtrust::Csr::validate(encodedCsr2, *diceChainKind, false /*isFactory*/,
+ false /*allowAnyMode*/, deviceSuffix(instanceName2));
+ if (!csr2.ok()) {
+ return csr2.error().message();
+ }
+
+ auto diceChain2 = csr2->getDiceChain();
+ if (!diceChain2.ok()) {
+ return diceChain2.error().message();
+ }
+
+ auto proper2 = diceChain2->IsProper();
+ if (!proper2) {
+ return std::string(instanceName2) + " has a degenerate DICE chain:\n" +
+ hexlify(encodedCsr2);
+ }
+
+ auto result = diceChain1->compareRootPublicKey(*diceChain2);
+ if (!result.ok()) {
+ return result.error().message();
+ }
+
+ return *result;
+}
+
+ErrMsgOr<bool> verifyComponentNameInKeyMintDiceChain(const std::vector<uint8_t>& encodedCsr) {
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*isFactory*/,
+ false /*allowAnyMode*/, deviceSuffix(DEFAULT_INSTANCE_NAME));
+ if (!csr.ok()) {
+ return csr.error().message();
+ }
+
+ auto diceChain = csr->getDiceChain();
+ if (!diceChain.ok()) {
+ return diceChain.error().message();
+ }
+
+ auto satisfied = diceChain->componentNameContains(kKeyMintComponentName);
+ if (!satisfied.ok()) {
+ return satisfied.error().message();
+ }
+
+ return *satisfied;
+}
+
+ErrMsgOr<bool> hasNonNormalModeInDiceChain(const std::vector<uint8_t>& encodedCsr,
+ std::string_view instanceName) {
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto csr = hwtrust::Csr::validate(encodedCsr, *diceChainKind, false /*isFactory*/,
+ true /*allowAnyMode*/, deviceSuffix(instanceName));
+ if (!csr.ok()) {
+ return csr.error().message();
+ }
+
+ auto diceChain = csr->getDiceChain();
+ if (!diceChain.ok()) {
+ return diceChain.error().message();
+ }
+
+ auto hasNonNormalModeInDiceChain = diceChain->hasNonNormalMode();
+ if (!hasNonNormalModeInDiceChain.ok()) {
+ return hasNonNormalModeInDiceChain.error().message();
+ }
+
+ return *hasNonNormalModeInDiceChain;
+}
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp
index 6f6a2d6..d86a678 100644
--- a/security/keymint/support/remote_prov_utils_test.cpp
+++ b/security/keymint/support/remote_prov_utils_test.cpp
@@ -81,30 +81,438 @@
0x50, 0x12, 0x82, 0x37, 0xfe, 0xa4, 0x07, 0xc3, 0xd5, 0xc3, 0x78, 0xcc, 0xf9, 0xef, 0xe1,
0x95, 0x38, 0x9f, 0xb0, 0x79, 0x16, 0x4c, 0x4a, 0x23, 0xc4, 0xdc, 0x35, 0x4e, 0x0f};
+inline const std::vector<uint8_t> kKeysToSignForCsrWithDegenerateDiceChain{
+ 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x1d, 0x94, 0xf2, 0x27,
+ 0xc3, 0x70, 0x01, 0xde, 0x3c, 0xaf, 0x6f, 0xfd, 0x78, 0x08, 0x37, 0x39, 0x21, 0xdd, 0x46,
+ 0x6f, 0x08, 0x4f, 0x77, 0xf7, 0x80, 0x34, 0x30, 0x74, 0x78, 0x69, 0xeb, 0xb1, 0x22, 0x58,
+ 0x20, 0x6b, 0x71, 0xd7, 0x7f, 0x0e, 0x51, 0xb2, 0xc9, 0x3d, 0x1a, 0xa0, 0xe8, 0x7a, 0x0d,
+ 0x57, 0xfc, 0x91, 0xd0, 0x68, 0xf9, 0x33, 0x5f, 0x80, 0x29, 0x00, 0x80, 0x98, 0x78, 0x63,
+ 0x5b, 0x30, 0x24, 0x23, 0x58, 0x20, 0x09, 0x83, 0xa6, 0x5a, 0xbb, 0x3a, 0xf8, 0x90, 0x88,
+ 0x87, 0x16, 0x37, 0xb4, 0xe7, 0x11, 0x9b, 0xcc, 0xbb, 0x15, 0x82, 0xa9, 0x97, 0xa5, 0xad,
+ 0xa9, 0x85, 0x39, 0x30, 0x55, 0x46, 0x99, 0xc6, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01,
+ 0x21, 0x58, 0x20, 0xa8, 0xaa, 0x4b, 0x63, 0x86, 0xf6, 0x5c, 0xe4, 0x28, 0xda, 0x26, 0x3f,
+ 0x9a, 0x42, 0x6e, 0xb9, 0x2b, 0x4d, 0x5a, 0x49, 0x4c, 0x5f, 0x1a, 0xa2, 0x5f, 0xd4, 0x8f,
+ 0x84, 0xd7, 0x25, 0xe4, 0x6c, 0x22, 0x58, 0x20, 0x6b, 0xef, 0xde, 0xd6, 0x04, 0x58, 0x12,
+ 0xdb, 0xf8, 0x90, 0x2c, 0x9c, 0xe0, 0x5e, 0x43, 0xbc, 0xcf, 0x22, 0x01, 0x4d, 0x5c, 0x0c,
+ 0x86, 0x7b, 0x66, 0xd2, 0xa1, 0xfc, 0x69, 0x8a, 0x91, 0xfc, 0x23, 0x58, 0x20, 0x31, 0xaf,
+ 0x30, 0x85, 0x1f, 0x2a, 0x82, 0xe1, 0x9c, 0xda, 0xe5, 0x68, 0xed, 0x79, 0xc1, 0x35, 0x1a,
+ 0x02, 0xb4, 0x8a, 0xd2, 0x4c, 0xc4, 0x70, 0x6b, 0x88, 0x98, 0x23, 0x9e, 0xb3, 0x52, 0xb1};
+
inline const std::vector<uint8_t> kCsrWithDegenerateDiceChain{
- 0x85, 0x01, 0xa0, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x65,
- 0xe0, 0x51, 0x62, 0x45, 0x17, 0xcc, 0xa8, 0x40, 0x41, 0x6d, 0xc0, 0x86, 0x7a, 0x15, 0x6e,
- 0xee, 0x04, 0xae, 0xbd, 0x05, 0x13, 0x36, 0xcb, 0xd2, 0x8d, 0xd8, 0x80, 0x16, 0xc1, 0x69,
- 0x0d, 0x22, 0x58, 0x20, 0xea, 0xa1, 0x37, 0xd5, 0x01, 0xbd, 0xe0, 0x25, 0x6a, 0x3d, 0x4c,
- 0xcd, 0x31, 0xa1, 0x4d, 0xa6, 0x80, 0x82, 0x03, 0x40, 0xe2, 0x88, 0x81, 0x53, 0xc3, 0xb3,
- 0x6d, 0xf7, 0xf4, 0x10, 0xde, 0x96, 0x23, 0x58, 0x20, 0x24, 0x69, 0x44, 0x6e, 0xf5, 0xcc,
- 0x18, 0xfe, 0x63, 0xac, 0x5e, 0x85, 0x9c, 0xfc, 0x9d, 0xfa, 0x90, 0xee, 0x6c, 0xc2, 0x22,
- 0x49, 0x02, 0xc7, 0x93, 0xf4, 0x30, 0xf1, 0x51, 0x11, 0x20, 0x33, 0x84, 0x43, 0xa1, 0x01,
- 0x26, 0xa0, 0x58, 0x97, 0xa5, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67,
- 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a,
- 0x00, 0x47, 0x44, 0x57, 0x58, 0x70, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58,
- 0x20, 0x65, 0xe0, 0x51, 0x62, 0x45, 0x17, 0xcc, 0xa8, 0x40, 0x41, 0x6d, 0xc0, 0x86, 0x7a,
- 0x15, 0x6e, 0xee, 0x04, 0xae, 0xbd, 0x05, 0x13, 0x36, 0xcb, 0xd2, 0x8d, 0xd8, 0x80, 0x16,
- 0xc1, 0x69, 0x0d, 0x22, 0x58, 0x20, 0xea, 0xa1, 0x37, 0xd5, 0x01, 0xbd, 0xe0, 0x25, 0x6a,
- 0x3d, 0x4c, 0xcd, 0x31, 0xa1, 0x4d, 0xa6, 0x80, 0x82, 0x03, 0x40, 0xe2, 0x88, 0x81, 0x53,
- 0xc3, 0xb3, 0x6d, 0xf7, 0xf4, 0x10, 0xde, 0x96, 0x23, 0x58, 0x20, 0x24, 0x69, 0x44, 0x6e,
- 0xf5, 0xcc, 0x18, 0xfe, 0x63, 0xac, 0x5e, 0x85, 0x9c, 0xfc, 0x9d, 0xfa, 0x90, 0xee, 0x6c,
- 0xc2, 0x22, 0x49, 0x02, 0xc7, 0x93, 0xf4, 0x30, 0xf1, 0x51, 0x11, 0x20, 0x33, 0x3a, 0x00,
- 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0x16, 0xb9, 0x51, 0xdf, 0x31, 0xad, 0xa0, 0x3d,
- 0x98, 0x40, 0x85, 0xdf, 0xd9, 0xbe, 0xf6, 0x79, 0x62, 0x36, 0x8b, 0x60, 0xaa, 0x79, 0x8e,
- 0x52, 0x04, 0xdd, 0xba, 0x39, 0xa2, 0x58, 0x9c, 0x60, 0xd5, 0x96, 0x51, 0x42, 0xe2, 0xa5,
- 0x57, 0x58, 0xb4, 0x89, 0x2c, 0x94, 0xb9, 0xda, 0xe7, 0x93, 0x85, 0xda, 0x64, 0xa0, 0x52,
- 0xfc, 0x6b, 0xb1, 0x0a, 0xa8, 0x13, 0xd9, 0x84, 0xfb, 0x34, 0x77, 0x84, 0x43, 0xa1, 0x01,
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xf2,
+ 0xc6, 0x50, 0xd2, 0x42, 0x59, 0xe0, 0x4e, 0x7b, 0xc0, 0x75, 0x41, 0xa2, 0xe9, 0xd0, 0xe8,
+ 0x18, 0xd7, 0xd7, 0x63, 0x7e, 0x41, 0x04, 0x7e, 0x52, 0x1a, 0xb1, 0xb7, 0xdc, 0x13, 0xb3,
+ 0x0f, 0x22, 0x58, 0x20, 0x1a, 0xf3, 0x8b, 0x0f, 0x7a, 0xc6, 0xf2, 0xb8, 0x31, 0x0b, 0x40,
+ 0x9b, 0x7e, 0xb6, 0xd6, 0xec, 0x9c, 0x21, 0xad, 0xde, 0xd1, 0x6c, 0x52, 0xfc, 0x06, 0xf1,
+ 0x39, 0x31, 0xa0, 0x22, 0x65, 0x86, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x58, 0x74, 0xa5,
+ 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58,
+ 0x4d, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xf2, 0xc6, 0x50, 0xd2,
+ 0x42, 0x59, 0xe0, 0x4e, 0x7b, 0xc0, 0x75, 0x41, 0xa2, 0xe9, 0xd0, 0xe8, 0x18, 0xd7, 0xd7,
+ 0x63, 0x7e, 0x41, 0x04, 0x7e, 0x52, 0x1a, 0xb1, 0xb7, 0xdc, 0x13, 0xb3, 0x0f, 0x22, 0x58,
+ 0x20, 0x1a, 0xf3, 0x8b, 0x0f, 0x7a, 0xc6, 0xf2, 0xb8, 0x31, 0x0b, 0x40, 0x9b, 0x7e, 0xb6,
+ 0xd6, 0xec, 0x9c, 0x21, 0xad, 0xde, 0xd1, 0x6c, 0x52, 0xfc, 0x06, 0xf1, 0x39, 0x31, 0xa0,
+ 0x22, 0x65, 0x86, 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0x1e, 0xdf, 0xe0,
+ 0x1c, 0xca, 0xbb, 0xb2, 0x13, 0xae, 0xe2, 0x49, 0x32, 0x3c, 0x6e, 0x9c, 0x6e, 0xf4, 0x23,
+ 0x87, 0x41, 0x60, 0x04, 0x34, 0xe6, 0x32, 0xe2, 0xf1, 0x22, 0x55, 0xcc, 0x89, 0x4b, 0x4f,
+ 0xdb, 0x05, 0x89, 0x8a, 0x3c, 0x2f, 0x8a, 0x52, 0x84, 0x43, 0xdc, 0x43, 0x62, 0x7e, 0x85,
+ 0xb3, 0xea, 0x49, 0x3b, 0x0b, 0x4a, 0xf0, 0x64, 0xfe, 0x8f, 0x41, 0xb6, 0xd1, 0xcc, 0xe3,
+ 0xf6, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02, 0x0e, 0x82, 0x58, 0x20, 0x01, 0x02,
+ 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
+ 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
+ 0x59, 0x01, 0xe8, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65,
+ 0x62, 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75,
+ 0x73, 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
+ 0x67, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68,
+ 0x76, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a,
+ 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d,
+ 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65,
+ 0x73, 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc,
+ 0xdd, 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65,
+ 0x76, 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61,
+ 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70,
+ 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74,
+ 0x65, 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
+ 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34,
+ 0x8c, 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68,
+ 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02,
+ 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x1d, 0x94, 0xf2, 0x27, 0xc3, 0x70, 0x01, 0xde,
+ 0x3c, 0xaf, 0x6f, 0xfd, 0x78, 0x08, 0x37, 0x39, 0x21, 0xdd, 0x46, 0x6f, 0x08, 0x4f, 0x77,
+ 0xf7, 0x80, 0x34, 0x30, 0x74, 0x78, 0x69, 0xeb, 0xb1, 0x22, 0x58, 0x20, 0x6b, 0x71, 0xd7,
+ 0x7f, 0x0e, 0x51, 0xb2, 0xc9, 0x3d, 0x1a, 0xa0, 0xe8, 0x7a, 0x0d, 0x57, 0xfc, 0x91, 0xd0,
+ 0x68, 0xf9, 0x33, 0x5f, 0x80, 0x29, 0x00, 0x80, 0x98, 0x78, 0x63, 0x5b, 0x30, 0x24, 0x23,
+ 0x58, 0x20, 0x09, 0x83, 0xa6, 0x5a, 0xbb, 0x3a, 0xf8, 0x90, 0x88, 0x87, 0x16, 0x37, 0xb4,
+ 0xe7, 0x11, 0x9b, 0xcc, 0xbb, 0x15, 0x82, 0xa9, 0x97, 0xa5, 0xad, 0xa9, 0x85, 0x39, 0x30,
+ 0x55, 0x46, 0x99, 0xc6, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xa8,
+ 0xaa, 0x4b, 0x63, 0x86, 0xf6, 0x5c, 0xe4, 0x28, 0xda, 0x26, 0x3f, 0x9a, 0x42, 0x6e, 0xb9,
+ 0x2b, 0x4d, 0x5a, 0x49, 0x4c, 0x5f, 0x1a, 0xa2, 0x5f, 0xd4, 0x8f, 0x84, 0xd7, 0x25, 0xe4,
+ 0x6c, 0x22, 0x58, 0x20, 0x6b, 0xef, 0xde, 0xd6, 0x04, 0x58, 0x12, 0xdb, 0xf8, 0x90, 0x2c,
+ 0x9c, 0xe0, 0x5e, 0x43, 0xbc, 0xcf, 0x22, 0x01, 0x4d, 0x5c, 0x0c, 0x86, 0x7b, 0x66, 0xd2,
+ 0xa1, 0xfc, 0x69, 0x8a, 0x91, 0xfc, 0x23, 0x58, 0x20, 0x31, 0xaf, 0x30, 0x85, 0x1f, 0x2a,
+ 0x82, 0xe1, 0x9c, 0xda, 0xe5, 0x68, 0xed, 0x79, 0xc1, 0x35, 0x1a, 0x02, 0xb4, 0x8a, 0xd2,
+ 0x4c, 0xc4, 0x70, 0x6b, 0x88, 0x98, 0x23, 0x9e, 0xb3, 0x52, 0xb1, 0x58, 0x40, 0x8e, 0x7e,
+ 0xdf, 0x77, 0x13, 0xdb, 0x51, 0xf6, 0xc1, 0x67, 0x52, 0x48, 0x48, 0x79, 0xe6, 0xbc, 0x89,
+ 0xe2, 0xfe, 0x7c, 0x0d, 0x2c, 0x88, 0x3b, 0x23, 0x66, 0x93, 0x7b, 0x94, 0x59, 0xc4, 0x87,
+ 0x16, 0xc4, 0x3a, 0x85, 0x60, 0xe3, 0x62, 0x45, 0x53, 0xa8, 0x1d, 0x4e, 0xa4, 0x2b, 0x61,
+ 0x33, 0x17, 0x71, 0xb6, 0x40, 0x11, 0x7d, 0x23, 0x64, 0xe6, 0x49, 0xbe, 0xa6, 0x85, 0x32,
+ 0x1a, 0x89, 0xa1, 0x6b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74,
+ 0x78, 0x3b, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
+ 0x74, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69,
+ 0x64, 0x2f, 0x32, 0x30, 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75,
+ 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79,
+ 0x73};
+
+// The challenge that is in kKeysToSignForCsrWithUdsCerts and kCsrWithUdsCerts
+inline const std::vector<uint8_t> kChallenge{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+ 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
+ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
+ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20};
+
+inline const std::vector<uint8_t> kKeysToSignForCsrWithUdsCerts{
+ 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xd5, 0x0b, 0x27, 0x39,
+ 0xa3, 0xd5, 0xfd, 0xd9, 0x4f, 0x87, 0x4a, 0x97, 0x17, 0x60, 0x6c, 0x63, 0x55, 0x13, 0xa0,
+ 0xf5, 0x1c, 0x2b, 0xe7, 0x0e, 0x8e, 0xdb, 0x76, 0x82, 0x69, 0x5a, 0x46, 0xec, 0x22, 0x58,
+ 0x20, 0xa6, 0x08, 0xb3, 0x57, 0xaa, 0x5f, 0x72, 0x2b, 0xb1, 0xf0, 0x43, 0x52, 0xf4, 0xcb,
+ 0x97, 0x39, 0xfd, 0x54, 0x79, 0xa3, 0xaf, 0x07, 0xb7, 0xbe, 0xbc, 0x93, 0xc1, 0xb6, 0x9b,
+ 0x2f, 0x75, 0x1b, 0x23, 0x58, 0x21, 0x00, 0xb4, 0x59, 0xe3, 0x78, 0x6f, 0x3f, 0xbd, 0xdc,
+ 0x38, 0x8a, 0xa5, 0x7d, 0xbe, 0xe0, 0xce, 0xf9, 0x2e, 0x9a, 0x5b, 0xfc, 0xbd, 0x4d, 0x27,
+ 0x7b, 0xa7, 0xc8, 0xda, 0xaa, 0xe4, 0xcd, 0xf3, 0xd2, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20,
+ 0x01, 0x21, 0x58, 0x20, 0x10, 0x6c, 0xe8, 0x71, 0xa8, 0x78, 0x9d, 0x29, 0xbe, 0xf8, 0x84,
+ 0x39, 0xd4, 0xa2, 0xf5, 0x3e, 0x09, 0xf1, 0xd4, 0x81, 0x59, 0x24, 0x63, 0x07, 0xae, 0x25,
+ 0xad, 0x24, 0x72, 0x0f, 0x8b, 0xd0, 0x22, 0x58, 0x20, 0xe8, 0xba, 0x76, 0x49, 0x7b, 0x97,
+ 0x98, 0xcf, 0xbb, 0x90, 0xfa, 0x30, 0x3a, 0x2d, 0x88, 0xfe, 0x3f, 0xc6, 0x75, 0x05, 0x7b,
+ 0x59, 0xdf, 0x14, 0xd8, 0xde, 0x4d, 0x51, 0x8b, 0x2f, 0x5a, 0xc7, 0x23, 0x58, 0x20, 0x76,
+ 0x11, 0x2f, 0x31, 0xe5, 0xc2, 0xbb, 0xa7, 0x2c, 0x2b, 0x2f, 0x73, 0x16, 0x29, 0xf8, 0x67,
+ 0x66, 0x44, 0x7f, 0x3f, 0x22, 0xa2, 0x40, 0x45, 0x12, 0xac, 0x97, 0x06, 0xc8, 0x66, 0x08,
+ 0xc9, 0x0a};
+
+inline const std::vector<uint8_t> kCsrWithUdsCerts{
+ 0x85, 0x01, 0xa1, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72,
+ 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0x59, 0x01, 0x6c, 0x30, 0x82, 0x01, 0x68, 0x30, 0x82,
+ 0x01, 0x1a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x7b, 0x30, 0x05, 0x06, 0x03, 0x2b,
+ 0x65, 0x70, 0x30, 0x2b, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c,
+ 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x12, 0x30,
+ 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x52, 0x6f,
+ 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x31, 0x31, 0x31, 0x34, 0x30, 0x39, 0x35,
+ 0x32, 0x30, 0x37, 0x5a, 0x17, 0x0d, 0x34, 0x39, 0x31, 0x31, 0x30, 0x38, 0x30, 0x39, 0x35,
+ 0x32, 0x30, 0x37, 0x5a, 0x30, 0x2b, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a,
+ 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31,
+ 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20,
+ 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21,
+ 0x00, 0x54, 0x40, 0x8c, 0x1b, 0x60, 0x39, 0x81, 0xe7, 0x38, 0x87, 0xb9, 0x75, 0x10, 0x30,
+ 0x6a, 0x1b, 0x9b, 0x38, 0x61, 0xa0, 0x94, 0x49, 0xb0, 0xf3, 0xae, 0x39, 0x53, 0x2d, 0x61,
+ 0x8d, 0x6e, 0x59, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04,
+ 0x16, 0x04, 0x14, 0x6d, 0xd5, 0xea, 0x8c, 0xe0, 0x5a, 0x50, 0xd9, 0x36, 0xf3, 0x28, 0xc2,
+ 0x54, 0x1d, 0xfa, 0x9d, 0x94, 0x19, 0x98, 0x76, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23,
+ 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x6d, 0xd5, 0xea, 0x8c, 0xe0, 0x5a, 0x50, 0xd9, 0x36,
+ 0xf3, 0x28, 0xc2, 0x54, 0x1d, 0xfa, 0x9d, 0x94, 0x19, 0x98, 0x76, 0x30, 0x0f, 0x06, 0x03,
+ 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e,
+ 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30,
+ 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x1e, 0x27, 0x99, 0xd3, 0x05, 0xa7,
+ 0xd2, 0xc6, 0xad, 0x1f, 0x2c, 0xbd, 0xef, 0x34, 0x18, 0xbd, 0x37, 0xb9, 0x96, 0x57, 0x63,
+ 0x72, 0x7e, 0xf8, 0xe5, 0xa2, 0xb5, 0x9a, 0x20, 0x42, 0x1d, 0x9c, 0x8e, 0xdc, 0x97, 0xd4,
+ 0x3b, 0x65, 0xe0, 0x52, 0xb4, 0x0d, 0x95, 0x59, 0x94, 0x94, 0x7a, 0x31, 0x9e, 0x45, 0x4b,
+ 0x93, 0x3d, 0x5d, 0x88, 0x98, 0xb1, 0x52, 0xf5, 0x46, 0x1c, 0x2a, 0x0b, 0x05, 0x59, 0x01,
+ 0x9f, 0x30, 0x82, 0x01, 0x9b, 0x30, 0x82, 0x01, 0x4d, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02,
+ 0x02, 0x01, 0xc8, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x30, 0x2b, 0x31, 0x15, 0x30,
+ 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f,
+ 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
+ 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x32,
+ 0x34, 0x31, 0x31, 0x31, 0x34, 0x30, 0x39, 0x35, 0x32, 0x30, 0x37, 0x5a, 0x17, 0x0d, 0x34,
+ 0x39, 0x31, 0x31, 0x30, 0x38, 0x30, 0x39, 0x35, 0x32, 0x30, 0x37, 0x5a, 0x30, 0x2e, 0x31,
+ 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20,
+ 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
+ 0x03, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x68, 0x69, 0x70, 0x73, 0x65, 0x74,
+ 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08,
+ 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xc9, 0x35, 0xf7,
+ 0x7e, 0x71, 0xc9, 0xa4, 0xd2, 0x13, 0x58, 0x5a, 0xc1, 0x0c, 0x17, 0xa8, 0x2c, 0x28, 0x99,
+ 0x32, 0x8e, 0x01, 0x45, 0xb8, 0xf1, 0xf4, 0xf8, 0x37, 0x25, 0x4a, 0x25, 0x1f, 0xbf, 0x8f,
+ 0xd8, 0xdf, 0x53, 0xdd, 0x95, 0x7a, 0x90, 0xff, 0xe3, 0x40, 0xbf, 0xda, 0x19, 0x0c, 0x14,
+ 0x41, 0x1c, 0x76, 0x73, 0x4e, 0x86, 0x94, 0x7d, 0x2c, 0x21, 0x5f, 0x5e, 0x05, 0x26, 0x15,
+ 0x4f, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
+ 0x14, 0x12, 0x84, 0xe1, 0x31, 0xef, 0xa8, 0xfd, 0xcc, 0xbb, 0x35, 0x22, 0xb9, 0x99, 0xd1,
+ 0xca, 0x64, 0x19, 0x09, 0x54, 0x4c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18,
+ 0x30, 0x16, 0x80, 0x14, 0x6d, 0xd5, 0xea, 0x8c, 0xe0, 0x5a, 0x50, 0xd9, 0x36, 0xf3, 0x28,
+ 0xc2, 0x54, 0x1d, 0xfa, 0x9d, 0x94, 0x19, 0x98, 0x76, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d,
+ 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03,
+ 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30, 0x05, 0x06,
+ 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0xc7, 0x93, 0x86, 0x58, 0xb2, 0x31, 0x30, 0x4f,
+ 0x1a, 0x53, 0x06, 0x87, 0x0e, 0xdf, 0xc4, 0xd8, 0x03, 0xf4, 0xaf, 0xa3, 0x2d, 0xfb, 0x7d,
+ 0xab, 0x08, 0x70, 0x47, 0x38, 0x10, 0xc5, 0xa8, 0x5e, 0x67, 0x64, 0xc7, 0xdc, 0x28, 0xe8,
+ 0x63, 0x3c, 0xa7, 0xb8, 0xf9, 0xbe, 0x3e, 0x75, 0xa7, 0x1c, 0xac, 0xc4, 0x81, 0x82, 0x4a,
+ 0x21, 0xf0, 0x89, 0x8e, 0x99, 0xf4, 0x52, 0x23, 0x30, 0x6d, 0x04, 0x82, 0xa5, 0x01, 0x02,
+ 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xc9, 0x35, 0xf7, 0x7e, 0x71, 0xc9, 0xa4, 0xd2,
+ 0x13, 0x58, 0x5a, 0xc1, 0x0c, 0x17, 0xa8, 0x2c, 0x28, 0x99, 0x32, 0x8e, 0x01, 0x45, 0xb8,
+ 0xf1, 0xf4, 0xf8, 0x37, 0x25, 0x4a, 0x25, 0x1f, 0xbf, 0x22, 0x58, 0x20, 0x8f, 0xd8, 0xdf,
+ 0x53, 0xdd, 0x95, 0x7a, 0x90, 0xff, 0xe3, 0x40, 0xbf, 0xda, 0x19, 0x0c, 0x14, 0x41, 0x1c,
+ 0x76, 0x73, 0x4e, 0x86, 0x94, 0x7d, 0x2c, 0x21, 0x5f, 0x5e, 0x05, 0x26, 0x15, 0x4f, 0x84,
+ 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x04, 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75,
+ 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44,
+ 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54,
+ 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45, 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d,
+ 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54, 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a,
+ 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00, 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d,
+ 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44,
+ 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a, 0x00, 0x47,
+ 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xb8,
+ 0x42, 0x01, 0xd7, 0xf0, 0xb7, 0x57, 0x98, 0xe3, 0x05, 0xf5, 0xcf, 0xef, 0x7b, 0x38, 0x39,
+ 0x6d, 0x55, 0x68, 0x72, 0xa6, 0x46, 0xd3, 0x16, 0x89, 0x1a, 0x3a, 0x9b, 0xc8, 0xce, 0xc0,
+ 0x1c, 0x22, 0x58, 0x20, 0xd1, 0xd5, 0x0e, 0xb8, 0xd0, 0x99, 0x09, 0x41, 0x63, 0x93, 0x33,
+ 0x20, 0xef, 0x84, 0xbb, 0xf5, 0xc9, 0x27, 0x4b, 0x52, 0x33, 0xa9, 0x07, 0xcc, 0x5d, 0x22,
+ 0xab, 0xf6, 0x8f, 0x2d, 0x15, 0x41, 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40,
+ 0xd0, 0x6d, 0xb0, 0xd2, 0x49, 0xc8, 0xd3, 0x81, 0xdd, 0x10, 0x4b, 0xd9, 0x49, 0x45, 0x93,
+ 0x10, 0xd5, 0x1b, 0xc7, 0x59, 0x66, 0x6f, 0x6c, 0x06, 0xb5, 0x72, 0x98, 0x51, 0x2d, 0xed,
+ 0xa0, 0xd9, 0xbb, 0x4a, 0xe6, 0x9b, 0x67, 0x31, 0xd9, 0x27, 0xd0, 0x9c, 0xf8, 0x3d, 0xfc,
+ 0x61, 0x8d, 0x53, 0x13, 0x53, 0x68, 0xb4, 0xb5, 0x41, 0x4c, 0xea, 0x6a, 0x28, 0xbb, 0xcb,
+ 0x63, 0x4d, 0xd0, 0x20, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58,
+ 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
+ 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e,
+ 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78,
+ 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65,
+ 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31,
+ 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66,
+ 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64,
+ 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
+ 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79,
+ 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74,
+ 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34,
+ 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73,
+ 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73,
+ 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c,
+ 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61,
+ 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82,
+ 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xd5, 0x0b, 0x27, 0x39, 0xa3,
+ 0xd5, 0xfd, 0xd9, 0x4f, 0x87, 0x4a, 0x97, 0x17, 0x60, 0x6c, 0x63, 0x55, 0x13, 0xa0, 0xf5,
+ 0x1c, 0x2b, 0xe7, 0x0e, 0x8e, 0xdb, 0x76, 0x82, 0x69, 0x5a, 0x46, 0xec, 0x22, 0x58, 0x20,
+ 0xa6, 0x08, 0xb3, 0x57, 0xaa, 0x5f, 0x72, 0x2b, 0xb1, 0xf0, 0x43, 0x52, 0xf4, 0xcb, 0x97,
+ 0x39, 0xfd, 0x54, 0x79, 0xa3, 0xaf, 0x07, 0xb7, 0xbe, 0xbc, 0x93, 0xc1, 0xb6, 0x9b, 0x2f,
+ 0x75, 0x1b, 0x23, 0x58, 0x21, 0x00, 0xb4, 0x59, 0xe3, 0x78, 0x6f, 0x3f, 0xbd, 0xdc, 0x38,
+ 0x8a, 0xa5, 0x7d, 0xbe, 0xe0, 0xce, 0xf9, 0x2e, 0x9a, 0x5b, 0xfc, 0xbd, 0x4d, 0x27, 0x7b,
+ 0xa7, 0xc8, 0xda, 0xaa, 0xe4, 0xcd, 0xf3, 0xd2, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01,
+ 0x21, 0x58, 0x20, 0x10, 0x6c, 0xe8, 0x71, 0xa8, 0x78, 0x9d, 0x29, 0xbe, 0xf8, 0x84, 0x39,
+ 0xd4, 0xa2, 0xf5, 0x3e, 0x09, 0xf1, 0xd4, 0x81, 0x59, 0x24, 0x63, 0x07, 0xae, 0x25, 0xad,
+ 0x24, 0x72, 0x0f, 0x8b, 0xd0, 0x22, 0x58, 0x20, 0xe8, 0xba, 0x76, 0x49, 0x7b, 0x97, 0x98,
+ 0xcf, 0xbb, 0x90, 0xfa, 0x30, 0x3a, 0x2d, 0x88, 0xfe, 0x3f, 0xc6, 0x75, 0x05, 0x7b, 0x59,
+ 0xdf, 0x14, 0xd8, 0xde, 0x4d, 0x51, 0x8b, 0x2f, 0x5a, 0xc7, 0x23, 0x58, 0x20, 0x76, 0x11,
+ 0x2f, 0x31, 0xe5, 0xc2, 0xbb, 0xa7, 0x2c, 0x2b, 0x2f, 0x73, 0x16, 0x29, 0xf8, 0x67, 0x66,
+ 0x44, 0x7f, 0x3f, 0x22, 0xa2, 0x40, 0x45, 0x12, 0xac, 0x97, 0x06, 0xc8, 0x66, 0x08, 0xc9,
+ 0x58, 0x40, 0x11, 0x65, 0x46, 0xfa, 0xbd, 0xe3, 0xd3, 0x1b, 0x0d, 0x78, 0x23, 0x2e, 0x5d,
+ 0x48, 0x3c, 0xab, 0xd3, 0x74, 0xf8, 0x41, 0x88, 0x9b, 0x48, 0xf3, 0x93, 0x06, 0x40, 0x1b,
+ 0x5f, 0x60, 0x7b, 0xbe, 0xd8, 0xa6, 0x65, 0xff, 0x6a, 0x89, 0x24, 0x12, 0x1b, 0xac, 0xa3,
+ 0xd5, 0x37, 0x85, 0x6e, 0x53, 0x8d, 0xa5, 0x07, 0xe7, 0xe7, 0x44, 0x2c, 0xba, 0xa0, 0xbe,
+ 0x1a, 0x43, 0xde, 0x28, 0x59, 0x65, 0xa1, 0x6b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70,
+ 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72,
+ 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a,
+ 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30, 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e,
+ 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x2d, 0x6b, 0x65, 0x79, 0x73};
+
+inline const std::vector<uint8_t> kKeysToSignForCsrWithoutUdsCerts = {
+ 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x11, 0x29, 0x11, 0x96,
+ 0x98, 0x26, 0xb2, 0x3a, 0xf2, 0xf9, 0x95, 0xb7, 0x46, 0xb9, 0x38, 0x6e, 0x5e, 0x3d, 0x5e,
+ 0xb2, 0x19, 0x90, 0xc7, 0xd3, 0xbd, 0x49, 0x47, 0x55, 0xcb, 0xef, 0xeb, 0x89, 0x22, 0x58,
+ 0x20, 0x42, 0x87, 0xea, 0x75, 0x27, 0x42, 0x34, 0xeb, 0xe8, 0xb5, 0x50, 0xdf, 0xb0, 0xbf,
+ 0xef, 0x6b, 0x62, 0x90, 0x5c, 0xd1, 0xe8, 0x2b, 0x4d, 0x02, 0x58, 0xe6, 0xca, 0xda, 0xe6,
+ 0x33, 0x97, 0xff, 0x23, 0x58, 0x21, 0x00, 0x9b, 0x34, 0xdb, 0x1e, 0xe6, 0x53, 0x72, 0xaf,
+ 0x67, 0xb5, 0x5e, 0x9a, 0xee, 0x07, 0x31, 0x77, 0xa3, 0x8b, 0x6a, 0xe9, 0x58, 0x97, 0x04,
+ 0xe2, 0xa2, 0x48, 0x0f, 0xdf, 0x26, 0x4d, 0xe5, 0xbb, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20,
+ 0x01, 0x21, 0x58, 0x20, 0xf9, 0xd7, 0x37, 0x75, 0x6b, 0x55, 0xc7, 0x64, 0xf9, 0xe2, 0x59,
+ 0x8f, 0x11, 0x48, 0xa1, 0xac, 0x95, 0xb1, 0xe3, 0x60, 0xe5, 0xa8, 0xa4, 0x2f, 0xb5, 0xcb,
+ 0x90, 0x1e, 0x9e, 0xcb, 0x4c, 0xab, 0x22, 0x58, 0x20, 0x20, 0xad, 0x7b, 0xeb, 0xba, 0x5d,
+ 0x3c, 0xd5, 0xa3, 0x6d, 0x86, 0x6e, 0x3f, 0x38, 0xb8, 0x44, 0x32, 0x4b, 0xe7, 0x97, 0xea,
+ 0xf8, 0x3d, 0xc2, 0xc0, 0x7c, 0x1b, 0x49, 0xe4, 0x22, 0x23, 0xc7, 0x23, 0x58, 0x20, 0x5f,
+ 0x1f, 0x80, 0xe2, 0xcf, 0x59, 0x1d, 0x7e, 0x98, 0x51, 0x78, 0xbe, 0xf8, 0x88, 0x0b, 0x64,
+ 0x1b, 0xc8, 0xf2, 0x7b, 0x12, 0x22, 0x53, 0xd9, 0xd5, 0x8d, 0x32, 0xe7, 0x7f, 0x0e, 0x97,
+ 0x09};
+
+inline const std::vector<uint8_t> kCsrWithoutUdsCerts{
+ 0x84, 0x01, 0xa0, 0x82, 0xa4, 0x01, 0x01, 0x03, 0x27, 0x20, 0x06, 0x21, 0x58, 0x20, 0xca,
+ 0x73, 0xd6, 0x09, 0x91, 0xec, 0x92, 0x63, 0xee, 0x9f, 0x7c, 0x79, 0x3e, 0x80, 0xa9, 0xc9,
+ 0x4e, 0xf7, 0x3b, 0x5b, 0x41, 0xa4, 0x56, 0xc1, 0x9e, 0xf3, 0x80, 0x16, 0x6d, 0xfe, 0x14,
+ 0x98, 0x84, 0x43, 0xa1, 0x01, 0x27, 0xa0, 0x59, 0x01, 0x04, 0xa9, 0x01, 0x66, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x00,
+ 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x52, 0x58, 0x20, 0xb8,
+ 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45, 0x11, 0xc8, 0xf2, 0x63, 0xf0,
+ 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54, 0x63, 0xc4, 0xf4, 0x39, 0x30,
+ 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00, 0x01, 0x11, 0x71, 0x6e, 0x63,
+ 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x00,
+ 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a,
+ 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58,
+ 0x20, 0x45, 0x71, 0x10, 0x9a, 0x1b, 0x9c, 0x9f, 0x3c, 0x6e, 0x29, 0xf9, 0x6d, 0xb9, 0x93,
+ 0x4a, 0xf2, 0x88, 0xf1, 0x3a, 0xf7, 0x69, 0xf9, 0xf3, 0x54, 0x91, 0x3a, 0x12, 0x4f, 0xd0,
+ 0xbb, 0xb7, 0x0d, 0x22, 0x58, 0x20, 0x56, 0x8b, 0xb0, 0x0e, 0xd3, 0x8d, 0x12, 0xf5, 0x17,
+ 0xd2, 0x6b, 0x21, 0xdf, 0x4d, 0xb8, 0xaa, 0x17, 0x65, 0x02, 0x4e, 0x5c, 0x0a, 0x77, 0x93,
+ 0x64, 0x1e, 0x8d, 0xbc, 0x6a, 0xa1, 0x26, 0xe7, 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41, 0x20,
+ 0x58, 0x40, 0xb0, 0x7b, 0xdd, 0xa5, 0x8e, 0xcb, 0xce, 0xf9, 0x89, 0xfb, 0x21, 0x4b, 0x29,
+ 0x34, 0xff, 0x6b, 0x0e, 0xc1, 0xff, 0x51, 0xba, 0x12, 0x12, 0xa0, 0x93, 0x2c, 0x09, 0xca,
+ 0x3a, 0x02, 0x81, 0x2a, 0x5b, 0x6f, 0x8d, 0x58, 0x21, 0x94, 0x30, 0xde, 0x99, 0x8b, 0x36,
+ 0x69, 0x45, 0xa1, 0x52, 0x5c, 0x7b, 0x36, 0x4f, 0xec, 0x4f, 0x40, 0x5f, 0x10, 0xdf, 0x26,
+ 0x18, 0xea, 0x4b, 0x72, 0x9f, 0x05, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02, 0x0f,
+ 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
+ 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79, 0x6d,
+ 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66, 0x64,
+ 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65, 0x70,
+ 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65, 0x67,
+ 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
+ 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65,
+ 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74, 0x61,
+ 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
+ 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62, 0x6f,
+ 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a,
+ 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72,
+ 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72, 0x73,
+ 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76,
+ 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c,
+ 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x11, 0x29, 0x11,
+ 0x96, 0x98, 0x26, 0xb2, 0x3a, 0xf2, 0xf9, 0x95, 0xb7, 0x46, 0xb9, 0x38, 0x6e, 0x5e, 0x3d,
+ 0x5e, 0xb2, 0x19, 0x90, 0xc7, 0xd3, 0xbd, 0x49, 0x47, 0x55, 0xcb, 0xef, 0xeb, 0x89, 0x22,
+ 0x58, 0x20, 0x42, 0x87, 0xea, 0x75, 0x27, 0x42, 0x34, 0xeb, 0xe8, 0xb5, 0x50, 0xdf, 0xb0,
+ 0xbf, 0xef, 0x6b, 0x62, 0x90, 0x5c, 0xd1, 0xe8, 0x2b, 0x4d, 0x02, 0x58, 0xe6, 0xca, 0xda,
+ 0xe6, 0x33, 0x97, 0xff, 0x23, 0x58, 0x21, 0x00, 0x9b, 0x34, 0xdb, 0x1e, 0xe6, 0x53, 0x72,
+ 0xaf, 0x67, 0xb5, 0x5e, 0x9a, 0xee, 0x07, 0x31, 0x77, 0xa3, 0x8b, 0x6a, 0xe9, 0x58, 0x97,
+ 0x04, 0xe2, 0xa2, 0x48, 0x0f, 0xdf, 0x26, 0x4d, 0xe5, 0xbb, 0xa6, 0x01, 0x02, 0x03, 0x26,
+ 0x20, 0x01, 0x21, 0x58, 0x20, 0xf9, 0xd7, 0x37, 0x75, 0x6b, 0x55, 0xc7, 0x64, 0xf9, 0xe2,
+ 0x59, 0x8f, 0x11, 0x48, 0xa1, 0xac, 0x95, 0xb1, 0xe3, 0x60, 0xe5, 0xa8, 0xa4, 0x2f, 0xb5,
+ 0xcb, 0x90, 0x1e, 0x9e, 0xcb, 0x4c, 0xab, 0x22, 0x58, 0x20, 0x20, 0xad, 0x7b, 0xeb, 0xba,
+ 0x5d, 0x3c, 0xd5, 0xa3, 0x6d, 0x86, 0x6e, 0x3f, 0x38, 0xb8, 0x44, 0x32, 0x4b, 0xe7, 0x97,
+ 0xea, 0xf8, 0x3d, 0xc2, 0xc0, 0x7c, 0x1b, 0x49, 0xe4, 0x22, 0x23, 0xc7, 0x23, 0x58, 0x20,
+ 0x5f, 0x1f, 0x80, 0xe2, 0xcf, 0x59, 0x1d, 0x7e, 0x98, 0x51, 0x78, 0xbe, 0xf8, 0x88, 0x0b,
+ 0x64, 0x1b, 0xc8, 0xf2, 0x7b, 0x12, 0x22, 0x53, 0xd9, 0xd5, 0x8d, 0x32, 0xe7, 0x7f, 0x0e,
+ 0x97, 0x09, 0x58, 0x40, 0xe1, 0x9a, 0x3f, 0x36, 0x65, 0x7a, 0xfe, 0x1b, 0x99, 0xc9, 0x35,
+ 0x8f, 0xb5, 0x5c, 0xfe, 0x12, 0x9c, 0x6f, 0x0e, 0x97, 0x12, 0xbd, 0x26, 0x32, 0x46, 0xd9,
+ 0x08, 0x6b, 0x7c, 0xa1, 0xd3, 0x47, 0xd6, 0xba, 0xf0, 0x9c, 0xe0, 0x12, 0x37, 0x39, 0x75,
+ 0x88, 0xb5, 0xbe, 0xd8, 0x37, 0x33, 0x9b, 0x26, 0xfc, 0x38, 0x14, 0x28, 0xea, 0x47, 0xcc,
+ 0x1f, 0xf3, 0xfe, 0x44, 0x0c, 0x1e, 0x6f, 0x2b, 0xa1, 0x6b, 0x66, 0x69, 0x6e, 0x67, 0x65,
+ 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x31, 0x2f,
+ 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
+ 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30, 0x32, 0x31, 0x30, 0x38, 0x30,
+ 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61,
+ 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
+
+inline const std::vector<uint8_t> kCsrWithKeyMintInComponentName{
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x44,
+ 0xfd, 0xdd, 0xf1, 0x8a, 0x78, 0xa0, 0xbe, 0x37, 0x49, 0x51, 0x85, 0xfb, 0x7a, 0x16, 0xca,
+ 0xc1, 0x00, 0xb3, 0x78, 0x13, 0x4a, 0x90, 0x4c, 0x5a, 0xa1, 0x3b, 0xfc, 0xea, 0xb6, 0xf3,
+ 0x16, 0x22, 0x58, 0x20, 0x12, 0x7f, 0xf5, 0xe2, 0x14, 0xbd, 0x5d, 0x51, 0xd3, 0x7f, 0x2f,
+ 0x1f, 0x9c, 0xc2, 0x18, 0x31, 0x94, 0x13, 0x52, 0x31, 0x3d, 0x43, 0xc9, 0x39, 0xbc, 0xc9,
+ 0x06, 0xb0, 0xb2, 0xa9, 0x0e, 0x59, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x0e,
+ 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x52, 0x58, 0x20, 0x88, 0x44, 0x82, 0xb6, 0x6c, 0x9c, 0xcb, 0x2e, 0xe8, 0xdc, 0xb4,
+ 0xe9, 0xd3, 0xf7, 0x87, 0x63, 0x03, 0xaa, 0x90, 0x9d, 0xd9, 0xcb, 0xc3, 0x81, 0x03, 0x5b,
+ 0xa9, 0xa2, 0x75, 0xe8, 0xfa, 0x50, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x58, 0x1e, 0xa1, 0x3a,
+ 0x00, 0x01, 0x11, 0x71, 0x77, 0x4d, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20,
+ 0x6a, 0x75, 0x73, 0x74, 0x20, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0x3f, 0x3a, 0x00,
+ 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a,
+ 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58,
+ 0x20, 0xe7, 0x0e, 0x4b, 0xcb, 0x8d, 0x4a, 0xd0, 0x36, 0x7f, 0xbf, 0x19, 0xdd, 0x9a, 0xd9,
+ 0x43, 0x62, 0xab, 0x29, 0x13, 0x1e, 0x14, 0x98, 0x68, 0xee, 0x5d, 0xae, 0xfa, 0x2f, 0x49,
+ 0x99, 0xfa, 0x0b, 0x22, 0x58, 0x20, 0xfb, 0x9f, 0xd3, 0xd8, 0x67, 0x86, 0x81, 0x5f, 0xb3,
+ 0x84, 0x00, 0x32, 0xc4, 0xe8, 0x7e, 0x9b, 0xb2, 0x4c, 0x1d, 0xd7, 0x71, 0x0d, 0x8f, 0xe0,
+ 0x26, 0xc6, 0x73, 0xb1, 0x8f, 0x2d, 0x02, 0xf8, 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41, 0x20,
+ 0x58, 0x40, 0x8f, 0xb9, 0x41, 0x5f, 0xa7, 0x48, 0xe4, 0xe3, 0xfb, 0x80, 0xbf, 0x2e, 0x30,
+ 0xb8, 0xc9, 0x2c, 0xe4, 0x74, 0x4f, 0x4c, 0xb1, 0x79, 0xfb, 0x42, 0x43, 0x1e, 0xb4, 0x6c,
+ 0x6a, 0x37, 0xaf, 0x3a, 0x76, 0x15, 0x16, 0x1f, 0x25, 0x26, 0x27, 0x1b, 0x9c, 0x5c, 0xcf,
+ 0x9a, 0xfd, 0xb0, 0x82, 0xad, 0xe4, 0xd1, 0xd9, 0x04, 0x80, 0x80, 0x1a, 0x21, 0x12, 0x3e,
+ 0x81, 0xff, 0x0c, 0x23, 0x3d, 0x0a, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02, 0x10,
+ 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
+ 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b,
+ 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xea, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79, 0x6d,
+ 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66, 0x64,
+ 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65, 0x70,
+ 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65, 0x67,
+ 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
+ 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65,
+ 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74, 0x61,
+ 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
+ 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
+ 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62, 0x6f,
+ 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a,
+ 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72,
+ 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72, 0x73,
+ 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76,
+ 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c,
+ 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x40, 0x9a, 0x39,
+ 0x4d, 0xe2, 0xc5, 0x48, 0x58, 0x6e, 0xaa, 0x17, 0x81, 0x8a, 0xba, 0xc4, 0xea, 0x20, 0x23,
+ 0xc4, 0xf3, 0xdc, 0xfa, 0x78, 0x9f, 0x5b, 0x7d, 0x30, 0xd2, 0x3d, 0x6f, 0x42, 0xa8, 0x22,
+ 0x58, 0x20, 0x3e, 0x85, 0x73, 0xe5, 0x86, 0x57, 0x45, 0x72, 0xcd, 0xf2, 0xe8, 0x62, 0x93,
+ 0xf3, 0xea, 0xbf, 0x21, 0x57, 0xa9, 0x25, 0xe7, 0xa8, 0x2a, 0xa0, 0xd0, 0x0a, 0x1d, 0xa5,
+ 0x81, 0x22, 0xd0, 0xe1, 0x23, 0x58, 0x21, 0x00, 0x95, 0x00, 0xea, 0x43, 0x32, 0x8d, 0x2e,
+ 0x1c, 0x18, 0x6d, 0x73, 0x34, 0xa2, 0xe4, 0x53, 0x64, 0x20, 0x95, 0x25, 0x8d, 0x4b, 0x97,
+ 0x71, 0x13, 0xdf, 0xa6, 0x0e, 0xdc, 0x5b, 0x66, 0x66, 0x0b, 0xa6, 0x01, 0x02, 0x03, 0x26,
+ 0x20, 0x01, 0x21, 0x58, 0x20, 0xa4, 0x81, 0xd9, 0xa0, 0x37, 0x89, 0xb1, 0x5d, 0x22, 0xf1,
+ 0x22, 0x7e, 0x19, 0x00, 0xf1, 0x87, 0xdf, 0x10, 0x88, 0x1f, 0x64, 0xc5, 0x46, 0x6d, 0x91,
+ 0x9d, 0x6c, 0x86, 0x3b, 0x67, 0x07, 0x14, 0x22, 0x58, 0x20, 0x3c, 0x42, 0x1f, 0x47, 0x62,
+ 0x2c, 0x4f, 0x08, 0x29, 0xe9, 0xc6, 0x0c, 0x7c, 0xe5, 0x11, 0xc6, 0x39, 0x69, 0xc9, 0x9d,
+ 0xdf, 0x69, 0x18, 0x8e, 0xdb, 0x99, 0x87, 0x52, 0x2f, 0x6b, 0xb4, 0x6a, 0x23, 0x58, 0x21,
+ 0x00, 0x83, 0xa2, 0x6f, 0x5b, 0x3a, 0x71, 0x7c, 0x66, 0x3c, 0x96, 0x3f, 0x4e, 0x42, 0x6f,
+ 0x98, 0x45, 0x1f, 0x59, 0x50, 0x03, 0x48, 0x9b, 0x57, 0xf5, 0x0e, 0x0f, 0x96, 0x30, 0xa4,
+ 0xd6, 0xc3, 0x45, 0x58, 0x40, 0x8b, 0xdf, 0xc8, 0xc7, 0x6d, 0xa4, 0x02, 0xec, 0x3c, 0x5d,
+ 0x90, 0x73, 0x0f, 0x8c, 0x10, 0x0f, 0x99, 0xd2, 0x85, 0x6e, 0x03, 0x45, 0x55, 0x28, 0xf7,
+ 0x64, 0x0b, 0xbd, 0x7c, 0x3a, 0x69, 0xf1, 0x80, 0x1a, 0xf3, 0x93, 0x7e, 0x82, 0xfc, 0xa5,
+ 0x3b, 0x69, 0x98, 0xf1, 0xde, 0x06, 0xb6, 0x72, 0x78, 0x0b, 0xdb, 0xbb, 0x97, 0x20, 0x04,
+ 0x98, 0xb0, 0xd4, 0x07, 0x83, 0x65, 0xfb, 0xf8, 0x9c, 0xa1, 0x6b, 0x66, 0x69, 0x6e, 0x67,
+ 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x31,
+ 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63,
+ 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30, 0x32, 0x31, 0x30, 0x38,
+ 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
+
+inline std::vector<uint8_t> kCsrWithDebugMode{
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x03,
+ 0x09, 0xad, 0x0d, 0x07, 0xec, 0x59, 0xfc, 0x14, 0x31, 0x21, 0x1f, 0xbc, 0x8e, 0x44, 0xe7,
+ 0x0f, 0xa9, 0xb7, 0x5a, 0x57, 0x38, 0x5f, 0x76, 0x8a, 0xa3, 0x38, 0x2c, 0xf0, 0x1b, 0x37,
+ 0x15, 0x22, 0x58, 0x20, 0x82, 0xae, 0x09, 0x76, 0x9c, 0x1d, 0x18, 0x39, 0x5d, 0x09, 0xf8,
+ 0x19, 0x86, 0x70, 0x60, 0x12, 0x1e, 0x06, 0xb3, 0x68, 0x4a, 0x27, 0x2c, 0x79, 0xd3, 0x83,
+ 0xb8, 0x54, 0x5b, 0x9f, 0xc0, 0x9f, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x04,
+ 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45,
+ 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54,
+ 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00,
+ 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x56, 0x41, 0x02, 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03,
+ 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x5f, 0xcf, 0x63, 0xcc, 0x24, 0x16, 0x66, 0x11, 0x6c,
+ 0xaf, 0xed, 0xf4, 0x02, 0x8f, 0xc9, 0x14, 0xc7, 0x32, 0xa5, 0xdb, 0x41, 0x53, 0x54, 0x34,
+ 0xcf, 0xcd, 0x6b, 0x4c, 0xb2, 0x22, 0x89, 0x96, 0x22, 0x58, 0x20, 0x4c, 0xed, 0xe3, 0x92,
+ 0x94, 0x8f, 0x04, 0xd6, 0x04, 0x3a, 0x6c, 0x15, 0x5f, 0xbb, 0x52, 0x4a, 0x7d, 0x94, 0xcf,
+ 0x31, 0x49, 0x31, 0x28, 0x66, 0x38, 0xe2, 0x40, 0x3e, 0xd0, 0xc1, 0x2b, 0xf4, 0x3a, 0x00,
+ 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0xb6, 0x0b, 0xa7, 0x9c, 0x02, 0x6d, 0x64, 0x98,
+ 0x9d, 0x73, 0x1b, 0x74, 0x21, 0x32, 0xf6, 0xb6, 0x1e, 0x6d, 0x07, 0x56, 0x0f, 0x5f, 0x14,
+ 0x60, 0xf9, 0x68, 0xb5, 0xee, 0xa5, 0xf9, 0x9b, 0xa9, 0x88, 0x4c, 0x55, 0x75, 0x26, 0xa7,
+ 0x84, 0xee, 0x07, 0x8a, 0xdc, 0xeb, 0x6d, 0xfe, 0x53, 0xe4, 0x38, 0xa8, 0x11, 0x1f, 0x57,
+ 0xbe, 0x77, 0x51, 0xc7, 0xbe, 0x4b, 0xd5, 0x2f, 0x9c, 0x2a, 0xcd, 0x84, 0x43, 0xa1, 0x01,
0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03,
@@ -126,276 +534,180 @@
0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65,
0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65,
0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
- 0x58, 0x20, 0x46, 0xbd, 0xfc, 0xed, 0xa6, 0x94, 0x9a, 0xc4, 0x5e, 0x27, 0xcf, 0x24, 0x25,
- 0xc5, 0x0c, 0x7d, 0xed, 0x8f, 0x21, 0xe0, 0x47, 0x81, 0x5a, 0xdc, 0x3b, 0xd4, 0x9e, 0x13,
- 0xb6, 0x06, 0x36, 0x70, 0x22, 0x58, 0x20, 0x0a, 0xbd, 0xbc, 0x0d, 0x19, 0xba, 0xcc, 0xdc,
- 0x00, 0x64, 0x31, 0x4c, 0x84, 0x66, 0x1d, 0xfb, 0x50, 0xd0, 0xe3, 0xf8, 0x78, 0x9d, 0xf9,
- 0x77, 0x2b, 0x40, 0x6b, 0xb5, 0x8e, 0xd3, 0xf8, 0xa9, 0x23, 0x58, 0x21, 0x00, 0x9c, 0x42,
- 0x3f, 0x79, 0x76, 0xa0, 0xd1, 0x98, 0x58, 0xbb, 0x9b, 0x9e, 0xfb, 0x3b, 0x08, 0xf2, 0xe1,
- 0xa3, 0xfe, 0xf4, 0x21, 0x5b, 0x97, 0x2d, 0xcb, 0x9a, 0x55, 0x1a, 0x7f, 0xa7, 0xc1, 0xa8,
- 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xef, 0xd3, 0x88, 0xc4, 0xbc,
- 0xce, 0x51, 0x4d, 0x4b, 0xd3, 0x81, 0x26, 0xc6, 0xcc, 0x66, 0x3b, 0x12, 0x38, 0xbf, 0x23,
- 0x7a, 0x2e, 0x7f, 0x82, 0xa7, 0x81, 0x74, 0x21, 0xc0, 0x12, 0x79, 0xf4, 0x22, 0x58, 0x20,
- 0xdc, 0x85, 0x6c, 0x1c, 0xcc, 0xf9, 0xf3, 0xe8, 0xff, 0x90, 0xfd, 0x89, 0x03, 0xf5, 0xaf,
- 0x75, 0xa0, 0x79, 0xbb, 0x53, 0x9a, 0x1f, 0x2b, 0x34, 0x86, 0x47, 0x3d, 0x66, 0x2a, 0x07,
- 0x3b, 0x1e, 0x23, 0x58, 0x20, 0x34, 0x7b, 0x15, 0xcc, 0xbf, 0x26, 0xc9, 0x28, 0x0e, 0xee,
- 0xc5, 0x47, 0xac, 0x00, 0xc4, 0x4d, 0x81, 0x2b, 0x1e, 0xac, 0x31, 0xd2, 0x6f, 0x36, 0x85,
- 0xe6, 0xa8, 0xf0, 0x46, 0xfc, 0xd2, 0x83, 0x58, 0x40, 0x55, 0x4c, 0x38, 0xdf, 0xfe, 0x49,
- 0xa8, 0xa0, 0xa5, 0x08, 0xce, 0x2f, 0xe5, 0xf6, 0x6e, 0x2b, 0xc2, 0x95, 0x39, 0xc8, 0xca,
- 0x77, 0xd6, 0xf6, 0x67, 0x24, 0x6b, 0x0e, 0x63, 0x5d, 0x11, 0x97, 0x26, 0x52, 0x30, 0xbc,
- 0x28, 0x1d, 0xbf, 0x2a, 0x3e, 0x8c, 0x90, 0x54, 0xaa, 0xaa, 0xd1, 0x7c, 0x53, 0x7b, 0x48,
- 0x1f, 0x51, 0x50, 0x6c, 0x32, 0xe1, 0x0f, 0x57, 0xea, 0x47, 0x76, 0x85, 0x0c, 0xa1, 0x6b,
+ 0x58, 0x20, 0x78, 0xa9, 0x66, 0xc0, 0xc1, 0x92, 0xc9, 0x0d, 0x74, 0xbf, 0x81, 0x99, 0xe6,
+ 0x7c, 0x61, 0xb2, 0xc3, 0x41, 0x27, 0x4e, 0x92, 0xd8, 0xd8, 0xf8, 0x34, 0x43, 0x81, 0xe1,
+ 0x9c, 0x5f, 0xed, 0xbb, 0x22, 0x58, 0x20, 0x80, 0x05, 0x96, 0xe5, 0x65, 0x7e, 0xa8, 0x5b,
+ 0x58, 0xf7, 0x2c, 0xb8, 0x28, 0x95, 0x34, 0x7a, 0x88, 0xd5, 0xe2, 0x1c, 0x20, 0x01, 0xd7,
+ 0x60, 0xfe, 0xec, 0xf1, 0x3f, 0x69, 0xfc, 0xc0, 0xa4, 0x23, 0x58, 0x21, 0x00, 0x99, 0xad,
+ 0x34, 0x13, 0xf0, 0x7f, 0xaa, 0xf7, 0xda, 0xe9, 0x95, 0xfe, 0x2a, 0x36, 0xf5, 0xac, 0xbb,
+ 0xad, 0x39, 0x8f, 0x3f, 0x86, 0x10, 0x39, 0x2c, 0xa9, 0x4c, 0xb9, 0xbb, 0x79, 0x10, 0x45,
+ 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xd2, 0x94, 0xcb, 0x74, 0x5f,
+ 0x9c, 0xc2, 0x1e, 0x47, 0x28, 0x69, 0x85, 0x6e, 0xf2, 0x34, 0x0a, 0x62, 0x90, 0xc3, 0xb0,
+ 0xc9, 0x3a, 0xb2, 0x32, 0xdc, 0x99, 0x19, 0x9b, 0x36, 0xde, 0x78, 0xed, 0x22, 0x58, 0x20,
+ 0xd9, 0x81, 0x04, 0x83, 0xbb, 0x85, 0x3e, 0x3b, 0x46, 0xe8, 0xe1, 0xa3, 0x8a, 0x04, 0xb9,
+ 0x3f, 0x74, 0x4e, 0x5c, 0x96, 0x21, 0x5c, 0x79, 0x0b, 0x8e, 0x4e, 0x7d, 0x61, 0x1b, 0x69,
+ 0xb2, 0x46, 0x23, 0x58, 0x20, 0x2f, 0x79, 0xf7, 0xbb, 0xbb, 0x7e, 0xee, 0x15, 0x61, 0xa2,
+ 0x78, 0x5f, 0x9c, 0x8c, 0xaf, 0x52, 0xcb, 0xbe, 0x24, 0x31, 0xa8, 0x95, 0x86, 0x8d, 0xed,
+ 0x98, 0x80, 0x71, 0x53, 0x91, 0xb3, 0x87, 0x58, 0x40, 0x19, 0xc9, 0xc4, 0x4e, 0x8b, 0xae,
+ 0x26, 0x7f, 0xdd, 0x9c, 0xac, 0xe2, 0xbf, 0xe2, 0xfb, 0x3c, 0x3f, 0xd6, 0x6f, 0x9a, 0x97,
+ 0xc3, 0x2a, 0x60, 0xfe, 0x0e, 0x9f, 0x11, 0xc9, 0x04, 0xa7, 0xdf, 0xe1, 0x21, 0x1e, 0xc1,
+ 0x10, 0x10, 0x64, 0xf7, 0xeb, 0xcc, 0x3a, 0x4c, 0xa6, 0xdf, 0xd8, 0xf5, 0xcc, 0x0d, 0x34,
+ 0xa4, 0x32, 0xf4, 0x0a, 0xd7, 0x83, 0x1e, 0x30, 0x0d, 0x68, 0x6a, 0xb4, 0xc1, 0xa1, 0x6b,
0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72,
0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64,
0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30,
0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f,
0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
-// The challenge that is in kKeysToSignForCsrWithUdsCerts and kCsrWithUdsCerts
-inline const std::vector<uint8_t> kChallenge{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
- 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
- 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20};
-
-inline const std::vector<uint8_t> kKeysToSignForCsrWithUdsCerts{
- 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x35, 0xeb, 0x56, 0xed,
- 0x62, 0x13, 0x6a, 0x41, 0x89, 0xf6, 0x72, 0xa6, 0xf1, 0x5c, 0xd1, 0xf6, 0x34, 0xbd, 0x81,
- 0xdb, 0x2e, 0x0b, 0x4d, 0xf6, 0x69, 0x6f, 0xa6, 0xf3, 0xce, 0x27, 0x2c, 0x78, 0x22, 0x58,
- 0x20, 0xac, 0xa9, 0x9f, 0x62, 0x81, 0x58, 0xc7, 0x10, 0xd7, 0xb5, 0xa8, 0xa0, 0x7b, 0x11,
- 0xf5, 0x75, 0xdb, 0xd9, 0xa2, 0x1d, 0x86, 0x34, 0xc6, 0xf4, 0x23, 0x79, 0xcc, 0x8a, 0x87,
- 0x3c, 0xb2, 0xd0, 0x23, 0x58, 0x20, 0x0f, 0x2c, 0x5a, 0xb7, 0xe1, 0x3b, 0x24, 0xa3, 0x4f,
- 0xaa, 0x49, 0x51, 0xfc, 0x8c, 0xd0, 0x35, 0x43, 0x7c, 0x21, 0xfa, 0x7d, 0x56, 0x97, 0x69,
- 0xe1, 0x81, 0xf5, 0x88, 0x15, 0x33, 0xa0, 0x7f, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01,
- 0x21, 0x58, 0x20, 0xb5, 0xcc, 0xd9, 0x4f, 0x7a, 0xe2, 0xca, 0xac, 0xfe, 0xa5, 0x65, 0x0c,
- 0x6a, 0xa8, 0x16, 0x45, 0x40, 0x41, 0x1c, 0xb2, 0x64, 0xcd, 0x34, 0xe8, 0x37, 0x88, 0xb9,
- 0x9a, 0xb3, 0xc3, 0xfd, 0x6a, 0x22, 0x58, 0x20, 0x5e, 0xbe, 0xff, 0x98, 0x60, 0x6e, 0x1d,
- 0x6b, 0x42, 0x60, 0x59, 0xe9, 0x42, 0x95, 0xc8, 0x2e, 0xc5, 0xb6, 0x66, 0x4a, 0x53, 0xf1,
- 0x73, 0x02, 0xcb, 0x89, 0x8a, 0x2a, 0xc9, 0xa5, 0xa3, 0x39, 0x23, 0x58, 0x21, 0x00, 0xdb,
- 0xda, 0x3c, 0x3e, 0x27, 0x71, 0x5e, 0xd0, 0x2b, 0x09, 0xb8, 0x6f, 0xe2, 0x2c, 0xdd, 0x0a,
- 0xbf, 0x1d, 0x94, 0x36, 0xd2, 0x33, 0x88, 0x6e, 0x66, 0x05, 0x21, 0x92, 0x64, 0x79, 0xa9,
- 0x10};
-
-inline const std::vector<uint8_t> kCsrWithUdsCerts{
- 0x84, 0x01, 0xa1, 0x70, 0x74, 0x65, 0x73, 0x74, 0x2d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72,
- 0x2d, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0x59, 0x01, 0x6c, 0x30, 0x82, 0x01, 0x68, 0x30, 0x82,
- 0x01, 0x1a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x7b, 0x30, 0x05, 0x06, 0x03, 0x2b,
- 0x65, 0x70, 0x30, 0x2b, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c,
- 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x12, 0x30,
- 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x52, 0x6f,
- 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x31, 0x30, 0x31, 0x37, 0x31, 0x39, 0x32,
- 0x33, 0x30, 0x39, 0x5a, 0x17, 0x0d, 0x32, 0x34, 0x31, 0x31, 0x31, 0x36, 0x31, 0x39, 0x32,
- 0x33, 0x30, 0x39, 0x5a, 0x30, 0x2b, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a,
- 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31,
- 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20,
- 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21,
- 0x00, 0x20, 0xc5, 0xfa, 0x42, 0xe9, 0x23, 0xd3, 0x72, 0x83, 0x96, 0xc5, 0x73, 0x1e, 0xec,
- 0x07, 0x39, 0x4f, 0xc8, 0xb7, 0xd1, 0x9f, 0x77, 0xb6, 0x0b, 0x59, 0x9e, 0x62, 0xc0, 0xec,
- 0x06, 0x06, 0xad, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04,
- 0x16, 0x04, 0x14, 0xec, 0x36, 0x07, 0x83, 0xf0, 0xda, 0x23, 0xfc, 0x0f, 0xb1, 0x08, 0xd0,
- 0x60, 0x97, 0xc1, 0x9a, 0x14, 0x54, 0xbf, 0x63, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23,
- 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xec, 0x36, 0x07, 0x83, 0xf0, 0xda, 0x23, 0xfc, 0x0f,
- 0xb1, 0x08, 0xd0, 0x60, 0x97, 0xc1, 0x9a, 0x14, 0x54, 0xbf, 0x63, 0x30, 0x0f, 0x06, 0x03,
- 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e,
- 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30,
- 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x41, 0x00, 0x41, 0xfa, 0x27, 0xfd, 0xe3, 0x42,
- 0x89, 0x43, 0x68, 0x92, 0x48, 0x39, 0xb1, 0x93, 0x93, 0x8b, 0x69, 0x16, 0x50, 0xbe, 0xc0,
- 0xc5, 0x83, 0xd6, 0x1e, 0x4b, 0x2f, 0x6e, 0x18, 0x32, 0x78, 0xfe, 0x35, 0x78, 0xed, 0x6d,
- 0xc8, 0x36, 0xb2, 0x4e, 0x0d, 0x10, 0x23, 0xab, 0x28, 0x32, 0xa1, 0xfc, 0x83, 0x2a, 0xa3,
- 0xca, 0xe1, 0xca, 0x82, 0xd2, 0x5f, 0xf1, 0x7f, 0xf2, 0xba, 0xbe, 0x86, 0x0b, 0x59, 0x01,
- 0x70, 0x30, 0x82, 0x01, 0x6c, 0x30, 0x82, 0x01, 0x1e, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02,
- 0x02, 0x01, 0xc8, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x30, 0x2b, 0x31, 0x15, 0x30,
- 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
- 0x09, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x32,
- 0x34, 0x31, 0x30, 0x31, 0x37, 0x31, 0x39, 0x32, 0x33, 0x30, 0x39, 0x5a, 0x17, 0x0d, 0x32,
- 0x34, 0x31, 0x31, 0x31, 0x36, 0x31, 0x39, 0x32, 0x33, 0x30, 0x39, 0x5a, 0x30, 0x2e, 0x31,
- 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20,
- 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
- 0x03, 0x13, 0x0c, 0x46, 0x61, 0x6b, 0x65, 0x20, 0x43, 0x68, 0x69, 0x70, 0x73, 0x65, 0x74,
- 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00, 0x14, 0xf4, 0x4a,
- 0x88, 0x56, 0x9f, 0xc0, 0xf5, 0x1f, 0xe5, 0xef, 0xfb, 0xf4, 0x06, 0xbc, 0xb1, 0xe4, 0x4a,
- 0x37, 0xe5, 0x07, 0xf8, 0x65, 0x95, 0x55, 0x54, 0xfd, 0x90, 0xf9, 0x8b, 0xa7, 0xc6, 0xa3,
- 0x63, 0x30, 0x61, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xef,
- 0x05, 0x40, 0x0a, 0x1b, 0x74, 0x3e, 0x4d, 0x2e, 0x22, 0xf5, 0x66, 0x0c, 0xd7, 0xf9, 0xb8,
- 0x8e, 0x81, 0x3d, 0xab, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16,
- 0x80, 0x14, 0xec, 0x36, 0x07, 0x83, 0xf0, 0xda, 0x23, 0xfc, 0x0f, 0xb1, 0x08, 0xd0, 0x60,
- 0x97, 0xc1, 0x9a, 0x14, 0x54, 0xbf, 0x63, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
- 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d,
- 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x02, 0x04, 0x30, 0x05, 0x06, 0x03, 0x2b,
- 0x65, 0x70, 0x03, 0x41, 0x00, 0x64, 0x32, 0x42, 0x06, 0xa7, 0x11, 0xb0, 0x67, 0x81, 0x73,
- 0x19, 0x70, 0xb6, 0x60, 0x1c, 0xd2, 0x43, 0xde, 0x42, 0xec, 0x71, 0x4d, 0x6e, 0xa8, 0xed,
- 0x6f, 0xe2, 0x59, 0x3e, 0xa3, 0x45, 0x82, 0x8b, 0x25, 0x25, 0xf9, 0xc6, 0xb3, 0xf5, 0xb5,
- 0x3d, 0x11, 0x7d, 0xcf, 0xf2, 0x50, 0x22, 0xff, 0x2b, 0xc5, 0x14, 0x94, 0x64, 0xbf, 0xbf,
- 0x52, 0x69, 0xb1, 0xfe, 0x07, 0x81, 0x83, 0xb3, 0x0d, 0x82, 0xa5, 0x01, 0x01, 0x03, 0x27,
- 0x20, 0x06, 0x21, 0x58, 0x20, 0x14, 0xf4, 0x4a, 0x88, 0x56, 0x9f, 0xc0, 0xf5, 0x1f, 0xe5,
- 0xef, 0xfb, 0xf4, 0x06, 0xbc, 0xb1, 0xe4, 0x4a, 0x37, 0xe5, 0x07, 0xf8, 0x65, 0x95, 0x55,
- 0x54, 0xfd, 0x90, 0xf9, 0x8b, 0xa7, 0xc6, 0x23, 0x58, 0x20, 0x8d, 0x38, 0x0d, 0x38, 0xcb,
- 0x76, 0x73, 0xef, 0x13, 0xd1, 0x08, 0x02, 0xa5, 0x0e, 0xd2, 0x16, 0xd4, 0x0f, 0x2c, 0x29,
- 0xf8, 0xd0, 0x20, 0xb8, 0x6a, 0x7f, 0xa2, 0xd1, 0x1e, 0xeb, 0xd1, 0x5c, 0x84, 0x43, 0xa1,
- 0x01, 0x27, 0xa0, 0x59, 0x01, 0x27, 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72,
- 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58,
- 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+inline const std::vector<uint8_t> kCsrWithSharedUdsRoot1{
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x96,
+ 0xf9, 0xf7, 0x16, 0xa7, 0xe2, 0x20, 0xe3, 0x6e, 0x19, 0x8e, 0xc0, 0xc4, 0x82, 0xc5, 0xca,
+ 0x8d, 0x1d, 0xb4, 0xda, 0x94, 0x6d, 0xf8, 0xbc, 0x0b, 0x0e, 0xc7, 0x90, 0x83, 0x5b, 0xc3,
+ 0x4b, 0x22, 0x58, 0x20, 0xed, 0xe0, 0xa1, 0x56, 0x46, 0x5b, 0xe0, 0x67, 0x2d, 0xbc, 0x08,
+ 0x84, 0x6f, 0x43, 0xd0, 0x10, 0xf3, 0x70, 0x90, 0xc2, 0xbf, 0xe3, 0x6b, 0x32, 0x9f, 0xf3,
+ 0xca, 0x57, 0x0f, 0xa8, 0xb9, 0xdd, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x04,
+ 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
- 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54, 0xe2, 0x2c,
- 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45, 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d, 0x2e, 0x20,
- 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54, 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a, 0x00, 0x47,
- 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00, 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6f,
- 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44, 0x54, 0x58,
- 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45,
+ 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54,
+ 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00,
+ 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
- 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01, 0x3a, 0x00, 0x47, 0x44, 0x57,
- 0x58, 0x70, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x76, 0x82, 0x58,
- 0xce, 0x99, 0x1c, 0x29, 0xa1, 0x81, 0x3e, 0x22, 0xe3, 0x02, 0x13, 0xea, 0x2a, 0x25, 0x2e,
- 0x20, 0x14, 0xeb, 0x45, 0x0d, 0xb8, 0xdb, 0x8c, 0x38, 0xef, 0xeb, 0x25, 0xd6, 0x31, 0x22,
- 0x58, 0x20, 0xbe, 0x55, 0xba, 0x87, 0x17, 0xc2, 0x5b, 0xb6, 0x56, 0xff, 0x4b, 0xf0, 0x8a,
- 0x98, 0x57, 0x86, 0xa4, 0x36, 0x0a, 0x90, 0x38, 0xce, 0x66, 0xec, 0xcb, 0x25, 0x30, 0x29,
- 0x83, 0x02, 0x02, 0xc0, 0x23, 0x58, 0x20, 0x73, 0xdf, 0xc3, 0x4a, 0xe4, 0x2e, 0xbd, 0x04,
- 0x09, 0xec, 0x91, 0xc7, 0xe7, 0xf1, 0xec, 0x55, 0x10, 0x7e, 0xd1, 0x36, 0x5e, 0x9d, 0x11,
- 0x71, 0x27, 0xee, 0x30, 0x7b, 0x04, 0x45, 0x5f, 0x95, 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41,
- 0x20, 0x58, 0x40, 0x44, 0x7f, 0x1a, 0x67, 0x16, 0xa0, 0x49, 0xfe, 0x2c, 0xde, 0x87, 0x38,
- 0xef, 0xb9, 0xe0, 0x19, 0x25, 0x7d, 0xcc, 0x39, 0x53, 0x27, 0xbd, 0x2c, 0x04, 0x6c, 0xe3,
- 0x5c, 0x5e, 0xd6, 0x27, 0x09, 0xb9, 0xf7, 0x8c, 0x2b, 0xd2, 0x68, 0xc3, 0xf1, 0x23, 0xcf,
- 0xc6, 0xfc, 0x21, 0xb3, 0x52, 0x48, 0xe6, 0x8a, 0x89, 0x3e, 0x37, 0x24, 0x13, 0x23, 0x80,
- 0xb2, 0xc7, 0xa7, 0xc6, 0xf1, 0xec, 0x04, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02,
- 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
- 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a,
- 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79,
- 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65,
- 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66,
- 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65,
- 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65,
- 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72,
- 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74,
- 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
- 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72,
- 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62,
- 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c,
- 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65,
- 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72,
- 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65,
- 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72,
- 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34,
- 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x35, 0xeb,
- 0x56, 0xed, 0x62, 0x13, 0x6a, 0x41, 0x89, 0xf6, 0x72, 0xa6, 0xf1, 0x5c, 0xd1, 0xf6, 0x34,
- 0xbd, 0x81, 0xdb, 0x2e, 0x0b, 0x4d, 0xf6, 0x69, 0x6f, 0xa6, 0xf3, 0xce, 0x27, 0x2c, 0x78,
- 0x22, 0x58, 0x20, 0xac, 0xa9, 0x9f, 0x62, 0x81, 0x58, 0xc7, 0x10, 0xd7, 0xb5, 0xa8, 0xa0,
- 0x7b, 0x11, 0xf5, 0x75, 0xdb, 0xd9, 0xa2, 0x1d, 0x86, 0x34, 0xc6, 0xf4, 0x23, 0x79, 0xcc,
- 0x8a, 0x87, 0x3c, 0xb2, 0xd0, 0x23, 0x58, 0x20, 0x0f, 0x2c, 0x5a, 0xb7, 0xe1, 0x3b, 0x24,
- 0xa3, 0x4f, 0xaa, 0x49, 0x51, 0xfc, 0x8c, 0xd0, 0x35, 0x43, 0x7c, 0x21, 0xfa, 0x7d, 0x56,
- 0x97, 0x69, 0xe1, 0x81, 0xf5, 0x88, 0x15, 0x33, 0xa0, 0x7f, 0xa6, 0x01, 0x02, 0x03, 0x26,
- 0x20, 0x01, 0x21, 0x58, 0x20, 0xb5, 0xcc, 0xd9, 0x4f, 0x7a, 0xe2, 0xca, 0xac, 0xfe, 0xa5,
- 0x65, 0x0c, 0x6a, 0xa8, 0x16, 0x45, 0x40, 0x41, 0x1c, 0xb2, 0x64, 0xcd, 0x34, 0xe8, 0x37,
- 0x88, 0xb9, 0x9a, 0xb3, 0xc3, 0xfd, 0x6a, 0x22, 0x58, 0x20, 0x5e, 0xbe, 0xff, 0x98, 0x60,
- 0x6e, 0x1d, 0x6b, 0x42, 0x60, 0x59, 0xe9, 0x42, 0x95, 0xc8, 0x2e, 0xc5, 0xb6, 0x66, 0x4a,
- 0x53, 0xf1, 0x73, 0x02, 0xcb, 0x89, 0x8a, 0x2a, 0xc9, 0xa5, 0xa3, 0x39, 0x23, 0x58, 0x21,
- 0x00, 0xdb, 0xda, 0x3c, 0x3e, 0x27, 0x71, 0x5e, 0xd0, 0x2b, 0x09, 0xb8, 0x6f, 0xe2, 0x2c,
- 0xdd, 0x0a, 0xbf, 0x1d, 0x94, 0x36, 0xd2, 0x33, 0x88, 0x6e, 0x66, 0x05, 0x21, 0x92, 0x64,
- 0x79, 0xa9, 0x10, 0x58, 0x40, 0x87, 0xcf, 0xaa, 0x82, 0x6a, 0xba, 0x25, 0x8b, 0x81, 0xd8,
- 0x14, 0xca, 0xbd, 0xf4, 0x67, 0xdf, 0xc8, 0x2c, 0xa1, 0x04, 0x57, 0x99, 0xa0, 0x54, 0xe7,
- 0x9b, 0xb2, 0xd0, 0xaf, 0xdd, 0x07, 0x46, 0x0a, 0xd7, 0xbd, 0xa7, 0xf9, 0xa8, 0x0c, 0x08,
- 0x1e, 0x9c, 0xae, 0x73, 0x4c, 0x22, 0x6e, 0x56, 0x8b, 0xe4, 0x91, 0x54, 0xa4, 0x7a, 0xb0,
- 0xf5, 0xe4, 0x5d, 0xa9, 0x8f, 0xae, 0x43, 0x95, 0x7a};
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x56, 0x41, 0x01, 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03,
+ 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x04, 0x25, 0x41, 0x6f, 0x6a, 0xdc, 0x88, 0x56, 0x9a,
+ 0xd4, 0x39, 0x82, 0xde, 0xd1, 0xe6, 0x65, 0xd4, 0x09, 0xb8, 0x9f, 0xde, 0xbf, 0x09, 0x03,
+ 0xe3, 0x9a, 0x48, 0xd4, 0x4f, 0x13, 0xaa, 0x5b, 0x22, 0x58, 0x20, 0x3a, 0xfb, 0x46, 0x2d,
+ 0xe1, 0xdf, 0x34, 0x76, 0x03, 0x37, 0x1e, 0xcf, 0xea, 0xd5, 0xf6, 0xd3, 0x99, 0x3e, 0x55,
+ 0x2a, 0xd1, 0x9d, 0x10, 0x21, 0xb1, 0xc8, 0x4f, 0xbd, 0xec, 0xb6, 0x67, 0x82, 0x3a, 0x00,
+ 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0x10, 0xda, 0xc8, 0x8d, 0x83, 0x6d, 0xdd, 0x85,
+ 0x48, 0x92, 0xdc, 0xc0, 0xc8, 0xde, 0xe4, 0x61, 0x03, 0x04, 0xfb, 0x77, 0xdf, 0xc1, 0xce,
+ 0xb7, 0x9b, 0x74, 0x9a, 0x31, 0x7a, 0xca, 0xcb, 0x7c, 0x45, 0x65, 0xf5, 0xc1, 0x3b, 0x29,
+ 0x53, 0x22, 0xbc, 0xda, 0xa9, 0xfa, 0x97, 0x84, 0x42, 0xfc, 0xcb, 0x36, 0xae, 0xe9, 0x67,
+ 0x1c, 0xb1, 0x19, 0x42, 0x74, 0x01, 0xb1, 0x11, 0xc9, 0x7b, 0x58, 0x84, 0x43, 0xa1, 0x01,
+ 0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xe9, 0x84, 0x03,
+ 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64,
+ 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74,
+ 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61,
+ 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76,
+ 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73,
+ 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74,
+ 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c,
+ 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c,
+ 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63,
+ 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65,
+ 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65,
+ 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
+ 0x58, 0x20, 0xf6, 0x86, 0x74, 0x7d, 0x1a, 0x83, 0x75, 0xec, 0x8c, 0xf9, 0x3a, 0xa9, 0x20,
+ 0x88, 0xe5, 0xca, 0x24, 0x34, 0x24, 0xbf, 0x89, 0xe7, 0xdb, 0x44, 0xc3, 0x6e, 0xdd, 0x5d,
+ 0x1a, 0xe1, 0xf0, 0xd8, 0x22, 0x58, 0x20, 0xae, 0xcb, 0x01, 0x2e, 0x73, 0xac, 0xb5, 0x52,
+ 0x0e, 0x73, 0x15, 0xd8, 0x9d, 0x78, 0x64, 0x10, 0x35, 0x41, 0x0e, 0xc9, 0x7d, 0x9a, 0x11,
+ 0xa3, 0xed, 0x7f, 0x53, 0xa6, 0xff, 0xc4, 0xad, 0x61, 0x23, 0x58, 0x20, 0x5a, 0xd2, 0xc5,
+ 0xd0, 0x58, 0x2e, 0x94, 0x93, 0xd7, 0xa4, 0x2d, 0x5b, 0x12, 0x43, 0x52, 0x93, 0xc3, 0x95,
+ 0x91, 0xac, 0x6a, 0xa3, 0x31, 0x08, 0xda, 0x33, 0x6a, 0xce, 0x7e, 0x8e, 0xae, 0xb1, 0xa6,
+ 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x8f, 0xb1, 0x85, 0xa5, 0xf5, 0x68,
+ 0x74, 0xfc, 0x8a, 0x87, 0x2b, 0x13, 0xea, 0xf7, 0xff, 0x82, 0x6d, 0xcf, 0xc3, 0xea, 0x04,
+ 0x80, 0x40, 0xe5, 0xcb, 0x80, 0xdb, 0x07, 0x8b, 0x36, 0x8c, 0x29, 0x22, 0x58, 0x20, 0x6a,
+ 0x8c, 0x52, 0x3f, 0xf7, 0x26, 0xb3, 0xf9, 0xa8, 0x91, 0x08, 0x4e, 0xec, 0x7a, 0x03, 0x16,
+ 0x1c, 0xab, 0x12, 0xcd, 0x8b, 0x05, 0x77, 0x33, 0x16, 0x1c, 0x80, 0x99, 0x79, 0x14, 0x6a,
+ 0x5c, 0x23, 0x58, 0x21, 0x00, 0xd0, 0x0a, 0xa2, 0xaa, 0x27, 0x62, 0x10, 0x24, 0x0c, 0x74,
+ 0x34, 0xe7, 0x06, 0xb3, 0x4d, 0x33, 0x9c, 0x86, 0xa6, 0x62, 0xb9, 0x0f, 0x1a, 0x4b, 0xe2,
+ 0x8b, 0x45, 0x0a, 0xc9, 0xe3, 0x43, 0x28, 0x58, 0x40, 0xea, 0xe3, 0xd3, 0xd9, 0x7f, 0x4e,
+ 0x08, 0x8a, 0x5b, 0xb9, 0xef, 0x28, 0x5a, 0xe0, 0x02, 0x40, 0xf5, 0x68, 0x49, 0x8b, 0xa7,
+ 0xf7, 0x9d, 0xa3, 0xb3, 0x37, 0x72, 0x79, 0xa9, 0x32, 0x47, 0xf6, 0x8d, 0x5d, 0x08, 0xe7,
+ 0xec, 0x00, 0x19, 0x09, 0x6f, 0x0a, 0x4d, 0x7c, 0x62, 0x6c, 0x2b, 0xaa, 0x33, 0x61, 0xe5,
+ 0xa5, 0x3f, 0x2a, 0xfe, 0xcc, 0xdf, 0x8e, 0x62, 0x1c, 0x31, 0xe1, 0x56, 0x6b, 0xa1, 0x6b,
+ 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62, 0x72,
+ 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f, 0x64,
+ 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32, 0x30,
+ 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72, 0x2f,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
-inline const std::vector<uint8_t> kKeysToSignForCsrWithoutUdsCerts = {
- 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x50, 0x43, 0xb4, 0xf1,
- 0xc1, 0x7f, 0x17, 0xc6, 0x3b, 0x56, 0x27, 0x63, 0x03, 0x18, 0x78, 0x9d, 0x63, 0x93, 0x3b,
- 0x98, 0xed, 0x55, 0x8c, 0x87, 0x1b, 0xd7, 0x89, 0xb6, 0x81, 0x92, 0x5f, 0x24, 0x22, 0x58,
- 0x20, 0xd5, 0x24, 0x93, 0xda, 0x3e, 0x32, 0x17, 0xfa, 0xe8, 0x8d, 0x1e, 0xa9, 0xe0, 0x84,
- 0x4e, 0x1c, 0x6a, 0xef, 0x9a, 0xe3, 0xbe, 0x1d, 0xf1, 0x14, 0xe0, 0x9e, 0x82, 0xc8, 0x92,
- 0x1a, 0x3a, 0x69, 0x23, 0x58, 0x20, 0x29, 0xcb, 0x16, 0x78, 0x61, 0x35, 0x92, 0x3f, 0x71,
- 0xc4, 0x66, 0x61, 0xd4, 0xd4, 0x20, 0x8a, 0x86, 0x1e, 0xb0, 0x2b, 0x2f, 0x4f, 0x13, 0xb4,
- 0x0d, 0x89, 0x60, 0x87, 0x77, 0xac, 0x1a, 0x0f, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01,
- 0x21, 0x58, 0x20, 0x4b, 0xcc, 0x7a, 0x09, 0x99, 0x76, 0xe7, 0xfa, 0x06, 0xb9, 0x19, 0x22,
- 0x15, 0x3b, 0x9f, 0xa8, 0x34, 0x77, 0x24, 0x27, 0x8c, 0x8a, 0x97, 0x61, 0xf3, 0x6f, 0x29,
- 0x74, 0x4e, 0x9a, 0x66, 0x23, 0x22, 0x58, 0x20, 0x8f, 0xa8, 0xaf, 0x2b, 0x02, 0x3a, 0xd4,
- 0x8a, 0xa2, 0x9d, 0x25, 0xa8, 0x01, 0xe7, 0xbd, 0x61, 0x25, 0x88, 0xb4, 0xc9, 0xce, 0x05,
- 0x43, 0xcc, 0x0d, 0x38, 0x7d, 0xe2, 0xda, 0x03, 0xb3, 0x33, 0x23, 0x58, 0x21, 0x00, 0xc8,
- 0x67, 0xb8, 0xbe, 0xc4, 0x1c, 0xca, 0x3c, 0x73, 0x3c, 0xbf, 0x52, 0xb2, 0x5a, 0x64, 0x9e,
- 0x9f, 0xae, 0xc6, 0x9f, 0x02, 0x2f, 0xee, 0x92, 0x1d, 0xdb, 0x01, 0x77, 0x27, 0x12, 0x84,
- 0x14};
-
-inline const std::vector<uint8_t> kCsrWithoutUdsCerts{
- 0x84, 0x01, 0xa0, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x38, 0x22, 0x20, 0x02, 0x21, 0x58, 0x30,
- 0x21, 0x09, 0x81, 0xb2, 0x4c, 0x8e, 0x23, 0x63, 0x46, 0xe5, 0x32, 0x1e, 0x1b, 0xa3, 0x39,
- 0x47, 0xd1, 0x19, 0x91, 0xc5, 0xe1, 0xd0, 0x51, 0xa4, 0x4e, 0x6d, 0xfd, 0x21, 0x46, 0xf3,
- 0x65, 0x6b, 0xd3, 0xec, 0x20, 0x21, 0xf8, 0xef, 0x39, 0x50, 0x0a, 0xfc, 0x6d, 0x18, 0xf8,
- 0x90, 0x1c, 0xc8, 0x22, 0x58, 0x30, 0x80, 0x1f, 0xd8, 0xe3, 0x64, 0x51, 0x48, 0x66, 0xa5,
- 0xad, 0x05, 0xcb, 0xe4, 0xee, 0x0f, 0x20, 0xc1, 0xca, 0x84, 0xc2, 0xe0, 0xcc, 0x22, 0x06,
- 0x7c, 0x5e, 0x2c, 0xb3, 0x3b, 0x52, 0xd4, 0xe7, 0xc1, 0xe2, 0x57, 0x9d, 0x8a, 0xa6, 0x5c,
- 0x08, 0xbb, 0x77, 0x07, 0xa8, 0x39, 0xba, 0x9f, 0x5f, 0x23, 0x58, 0x31, 0x00, 0xff, 0x5f,
- 0xa3, 0x03, 0x87, 0x70, 0xe5, 0xf0, 0x69, 0xcd, 0x0a, 0x32, 0x9e, 0x4a, 0xe8, 0x07, 0x1f,
- 0x26, 0xb9, 0x8a, 0x01, 0x83, 0xfe, 0xb9, 0x21, 0x22, 0x49, 0x9d, 0x9f, 0x78, 0x48, 0xf4,
- 0x24, 0x87, 0xe8, 0x4d, 0xab, 0xd5, 0xe9, 0xd6, 0x90, 0x49, 0x4b, 0x42, 0xb4, 0x68, 0xac,
- 0xf1, 0x84, 0x44, 0xa1, 0x01, 0x38, 0x22, 0xa0, 0x59, 0x01, 0x28, 0xa9, 0x01, 0x66, 0x69,
- 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a,
- 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+inline const std::vector<uint8_t> kCsrWithSharedUdsRoot2{
+ 0x85, 0x01, 0xa0, 0x82, 0xa5, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x96,
+ 0xf9, 0xf7, 0x16, 0xa7, 0xe2, 0x20, 0xe3, 0x6e, 0x19, 0x8e, 0xc0, 0xc4, 0x82, 0xc5, 0xca,
+ 0x8d, 0x1d, 0xb4, 0xda, 0x94, 0x6d, 0xf8, 0xbc, 0x0b, 0x0e, 0xc7, 0x90, 0x83, 0x5b, 0xc3,
+ 0x4b, 0x22, 0x58, 0x20, 0xed, 0xe0, 0xa1, 0x56, 0x46, 0x5b, 0xe0, 0x67, 0x2d, 0xbc, 0x08,
+ 0x84, 0x6f, 0x43, 0xd0, 0x10, 0xf3, 0x70, 0x90, 0xc2, 0xbf, 0xe3, 0x6b, 0x32, 0x9f, 0xf3,
+ 0xca, 0x57, 0x0f, 0xa8, 0xb9, 0xdd, 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x01, 0x04,
+ 0xa9, 0x01, 0x66, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x02, 0x67, 0x73, 0x75, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x3a, 0x00, 0x47, 0x44, 0x50, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
- 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x52, 0x58, 0x20,
- 0xb8, 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45, 0x11, 0xc8, 0xf2, 0x63,
- 0xf0, 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54, 0x63, 0xc4, 0xf4, 0x39,
- 0x30, 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00, 0x01, 0x11, 0x71, 0x6e,
- 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
- 0x00, 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x52, 0x58, 0x20, 0xb8, 0x96, 0x54, 0xe2, 0x2c, 0xa4, 0xd2, 0x4a, 0x9c, 0x0e, 0x45,
+ 0x11, 0xc8, 0xf2, 0x63, 0xf0, 0x66, 0x0d, 0x2e, 0x20, 0x48, 0x96, 0x90, 0x14, 0xf4, 0x54,
+ 0x63, 0xc4, 0xf4, 0x39, 0x30, 0x38, 0x3a, 0x00, 0x47, 0x44, 0x53, 0x55, 0xa1, 0x3a, 0x00,
+ 0x01, 0x11, 0x71, 0x6e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x00, 0x47, 0x44, 0x54, 0x58, 0x20, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
- 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47, 0x44, 0x56, 0x41, 0x01,
- 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58, 0x71, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
- 0x58, 0x20, 0x2d, 0x41, 0x43, 0x19, 0xf2, 0x91, 0x58, 0x12, 0x65, 0x2e, 0x96, 0xb5, 0x9d,
- 0x12, 0x18, 0x58, 0x54, 0x11, 0xed, 0x41, 0x30, 0xef, 0xa4, 0xee, 0x69, 0x8f, 0x0c, 0x6e,
- 0xe6, 0x27, 0xc5, 0x20, 0x22, 0x58, 0x20, 0x21, 0x0e, 0x8f, 0x83, 0xe5, 0xeb, 0x40, 0x89,
- 0xc2, 0x0a, 0x43, 0x6c, 0x9f, 0xa8, 0x4e, 0xe0, 0xba, 0x9e, 0xba, 0x4f, 0xe3, 0x27, 0xc4,
- 0xbd, 0x41, 0xa0, 0xd6, 0xe9, 0x55, 0x54, 0x17, 0x78, 0x23, 0x58, 0x21, 0x00, 0xb6, 0x33,
- 0x44, 0x98, 0xa7, 0x1c, 0x90, 0x13, 0xcc, 0x42, 0x71, 0x43, 0x29, 0xe5, 0xe1, 0x57, 0x89,
- 0x7a, 0x39, 0x17, 0x7c, 0xcc, 0x03, 0xac, 0xd3, 0x1b, 0xd2, 0xae, 0x29, 0x5f, 0xd6, 0xf8,
- 0x3a, 0x00, 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x60, 0xc4, 0x54, 0xad, 0x40, 0xa2, 0x07,
- 0xc7, 0x80, 0xbd, 0x41, 0x77, 0x5d, 0xa7, 0xa2, 0xef, 0xef, 0x92, 0x67, 0x24, 0xab, 0xa1,
- 0x4a, 0x5e, 0x4f, 0x73, 0xfb, 0x5c, 0x1f, 0xe6, 0x46, 0x2f, 0xb9, 0x1b, 0x71, 0x86, 0x87,
- 0x29, 0xc4, 0x66, 0xb7, 0x3e, 0x85, 0x13, 0x9a, 0xa3, 0xf8, 0xfc, 0x63, 0x26, 0xe0, 0xba,
- 0x0b, 0xe0, 0x9b, 0x2e, 0x7d, 0x06, 0x06, 0xb8, 0x2f, 0xdd, 0x0c, 0xa5, 0x90, 0x1c, 0x10,
- 0x1c, 0x55, 0xf9, 0x65, 0xf6, 0x26, 0x40, 0x41, 0xaf, 0x5c, 0x16, 0x03, 0xf3, 0xee, 0x8d,
- 0x72, 0x2c, 0x6b, 0x1e, 0xb3, 0x1f, 0x96, 0x97, 0x34, 0x61, 0x0d, 0x5c, 0xe4, 0x94, 0x6a,
- 0x84, 0x43, 0xa1, 0x01, 0x26, 0xa0, 0x59, 0x02, 0x0f, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
- 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59,
- 0x01, 0xe9, 0x84, 0x03, 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62,
- 0x72, 0x61, 0x6e, 0x64, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73,
- 0x65, 0x64, 0x01, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
- 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67,
- 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76,
- 0x62, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f,
- 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61,
- 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x6d, 0x76, 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73,
- 0x74, 0x4f, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd,
- 0xee, 0xff, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76,
- 0x65, 0x6c, 0x63, 0x74, 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74,
- 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62,
- 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65,
- 0x66, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f,
- 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c,
- 0x61, 0x72, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f,
- 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03,
- 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x50, 0x43, 0xb4, 0xf1, 0xc1, 0x7f, 0x17, 0xc6, 0x3b,
- 0x56, 0x27, 0x63, 0x03, 0x18, 0x78, 0x9d, 0x63, 0x93, 0x3b, 0x98, 0xed, 0x55, 0x8c, 0x87,
- 0x1b, 0xd7, 0x89, 0xb6, 0x81, 0x92, 0x5f, 0x24, 0x22, 0x58, 0x20, 0xd5, 0x24, 0x93, 0xda,
- 0x3e, 0x32, 0x17, 0xfa, 0xe8, 0x8d, 0x1e, 0xa9, 0xe0, 0x84, 0x4e, 0x1c, 0x6a, 0xef, 0x9a,
- 0xe3, 0xbe, 0x1d, 0xf1, 0x14, 0xe0, 0x9e, 0x82, 0xc8, 0x92, 0x1a, 0x3a, 0x69, 0x23, 0x58,
- 0x20, 0x29, 0xcb, 0x16, 0x78, 0x61, 0x35, 0x92, 0x3f, 0x71, 0xc4, 0x66, 0x61, 0xd4, 0xd4,
- 0x20, 0x8a, 0x86, 0x1e, 0xb0, 0x2b, 0x2f, 0x4f, 0x13, 0xb4, 0x0d, 0x89, 0x60, 0x87, 0x77,
- 0xac, 0x1a, 0x0f, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x4b, 0xcc,
- 0x7a, 0x09, 0x99, 0x76, 0xe7, 0xfa, 0x06, 0xb9, 0x19, 0x22, 0x15, 0x3b, 0x9f, 0xa8, 0x34,
- 0x77, 0x24, 0x27, 0x8c, 0x8a, 0x97, 0x61, 0xf3, 0x6f, 0x29, 0x74, 0x4e, 0x9a, 0x66, 0x23,
- 0x22, 0x58, 0x20, 0x8f, 0xa8, 0xaf, 0x2b, 0x02, 0x3a, 0xd4, 0x8a, 0xa2, 0x9d, 0x25, 0xa8,
- 0x01, 0xe7, 0xbd, 0x61, 0x25, 0x88, 0xb4, 0xc9, 0xce, 0x05, 0x43, 0xcc, 0x0d, 0x38, 0x7d,
- 0xe2, 0xda, 0x03, 0xb3, 0x33, 0x23, 0x58, 0x21, 0x00, 0xc8, 0x67, 0xb8, 0xbe, 0xc4, 0x1c,
- 0xca, 0x3c, 0x73, 0x3c, 0xbf, 0x52, 0xb2, 0x5a, 0x64, 0x9e, 0x9f, 0xae, 0xc6, 0x9f, 0x02,
- 0x2f, 0xee, 0x92, 0x1d, 0xdb, 0x01, 0x77, 0x27, 0x12, 0x84, 0x14, 0x58, 0x40, 0x6c, 0xd5,
- 0x66, 0x0a, 0x99, 0xdd, 0x32, 0x47, 0x50, 0x1f, 0x5d, 0x46, 0x40, 0x8a, 0x60, 0x25, 0xa0,
- 0x1b, 0x3c, 0x2a, 0xcf, 0xa1, 0x92, 0x1a, 0xdc, 0x81, 0xaa, 0xb0, 0x0f, 0xf2, 0xe6, 0x94,
- 0xce, 0x3d, 0xff, 0xac, 0x25, 0x44, 0xea, 0xf7, 0x0a, 0x89, 0x9d, 0xc4, 0x7e, 0xe5, 0x02,
- 0xa7, 0xb6, 0xc2, 0x40, 0x06, 0x65, 0xc5, 0xff, 0x19, 0xc5, 0xcd, 0x1c, 0xd5, 0x78, 0x01,
- 0xd4, 0xb8};
+ 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x3a, 0x00, 0x47,
+ 0x44, 0x56, 0x41, 0x01, 0x3a, 0x00, 0x47, 0x44, 0x57, 0x58, 0x4d, 0xa5, 0x01, 0x02, 0x03,
+ 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0x2d, 0xbd, 0x92, 0x58, 0xc8, 0xcd, 0xc3, 0xc5, 0x14,
+ 0xe3, 0x6e, 0x5f, 0xab, 0x71, 0x41, 0x46, 0x83, 0xb4, 0x3e, 0x82, 0xdb, 0xe7, 0x7d, 0x27,
+ 0xe5, 0x26, 0x36, 0x94, 0xcb, 0x4c, 0x72, 0x8f, 0x22, 0x58, 0x20, 0xbf, 0xa2, 0xa7, 0x15,
+ 0x46, 0x5a, 0xea, 0xa8, 0xc7, 0xad, 0x22, 0x61, 0x9c, 0xba, 0x87, 0x70, 0x65, 0x64, 0x11,
+ 0x05, 0x8a, 0x58, 0x8c, 0x0c, 0x25, 0xc7, 0xf8, 0x5f, 0xfc, 0x4a, 0xee, 0xa1, 0x3a, 0x00,
+ 0x47, 0x44, 0x58, 0x41, 0x20, 0x58, 0x40, 0x43, 0xba, 0xff, 0xdb, 0xbb, 0xa9, 0x9e, 0x8f,
+ 0x06, 0xdf, 0x33, 0xa0, 0x3f, 0x30, 0xc3, 0x64, 0x84, 0x32, 0xb5, 0x2a, 0x06, 0x53, 0x13,
+ 0x70, 0xbe, 0xa3, 0x0b, 0x4d, 0xbe, 0x8d, 0x8c, 0x90, 0xde, 0x6c, 0x1d, 0xa8, 0xea, 0x40,
+ 0xd5, 0x17, 0xa1, 0xea, 0x62, 0x95, 0x37, 0x64, 0x92, 0xc3, 0xc4, 0xef, 0xd7, 0xcf, 0x87,
+ 0x0c, 0x9a, 0xd2, 0x5c, 0x10, 0x1d, 0x00, 0x2e, 0xe4, 0xe9, 0x1f, 0x84, 0x43, 0xa1, 0x01,
+ 0x26, 0xa0, 0x59, 0x02, 0x10, 0x82, 0x58, 0x20, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x59, 0x01, 0xea, 0x84, 0x03,
+ 0x67, 0x6b, 0x65, 0x79, 0x6d, 0x69, 0x6e, 0x74, 0xae, 0x65, 0x62, 0x72, 0x61, 0x6e, 0x64,
+ 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x65, 0x66, 0x75, 0x73, 0x65, 0x64, 0x01, 0x65,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x65, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x66, 0x64, 0x65, 0x76,
+ 0x69, 0x63, 0x65, 0x66, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x67, 0x70, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x65, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x68, 0x76, 0x62, 0x5f, 0x73, 0x74,
+ 0x61, 0x74, 0x65, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x6a, 0x6f, 0x73, 0x5f, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x31, 0x32, 0x6c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61,
+ 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x66, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x6d, 0x76,
+ 0x62, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x4f, 0x11, 0x22,
+ 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x6e, 0x73,
+ 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x63, 0x74,
+ 0x65, 0x65, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c,
+ 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x62, 0x70, 0x62, 0x6f, 0x6f, 0x74, 0x6c,
+ 0x6f, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x65, 0x64, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x70, 0x61, 0x74, 0x63,
+ 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x61, 0x72, 0x76, 0x65,
+ 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6c, 0x65, 0x76, 0x65,
+ 0x6c, 0x1a, 0x01, 0x34, 0x8c, 0x63, 0x82, 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21,
+ 0x58, 0x20, 0xad, 0xd2, 0x8c, 0xcc, 0xfb, 0x22, 0xd8, 0x5a, 0x3b, 0x9d, 0x22, 0x58, 0xb3,
+ 0x7c, 0xcc, 0xa5, 0x22, 0x46, 0x86, 0x2b, 0x29, 0x87, 0x49, 0xdd, 0xe4, 0x2c, 0xb4, 0x3f,
+ 0xf2, 0x4e, 0x6a, 0xed, 0x22, 0x58, 0x20, 0xe9, 0x34, 0x28, 0x54, 0x21, 0x7e, 0x88, 0x34,
+ 0x82, 0x0d, 0x0f, 0x14, 0x5b, 0xec, 0x61, 0xc4, 0xf2, 0xa4, 0xef, 0xf8, 0x17, 0xeb, 0xeb,
+ 0x05, 0x01, 0x36, 0x14, 0x52, 0xc7, 0xc2, 0xd8, 0xd3, 0x23, 0x58, 0x21, 0x00, 0xd9, 0xb4,
+ 0x13, 0xd0, 0x86, 0x31, 0x5e, 0x97, 0xc2, 0x54, 0x03, 0x72, 0x80, 0x6f, 0x14, 0x53, 0xbe,
+ 0x2e, 0xe5, 0x1b, 0x02, 0x1a, 0x62, 0x1a, 0x88, 0xe8, 0xa2, 0xde, 0xd0, 0x7d, 0xf6, 0x53,
+ 0xa6, 0x01, 0x02, 0x03, 0x26, 0x20, 0x01, 0x21, 0x58, 0x20, 0xca, 0x7d, 0x6e, 0xb5, 0x78,
+ 0x99, 0x9e, 0x66, 0xf4, 0x5d, 0xfe, 0xd5, 0x92, 0xe3, 0x30, 0xf5, 0xd5, 0xc2, 0x82, 0xf2,
+ 0x6d, 0x58, 0x16, 0x26, 0xa5, 0xe7, 0xfc, 0x62, 0x8f, 0xf3, 0x61, 0x56, 0x22, 0x58, 0x20,
+ 0x9f, 0x42, 0x22, 0x11, 0x1c, 0x45, 0x5c, 0x3a, 0x30, 0x95, 0xb4, 0xb3, 0x63, 0x26, 0x09,
+ 0xfc, 0x2e, 0x6e, 0x99, 0xdd, 0x44, 0x37, 0x34, 0xa9, 0x68, 0x42, 0xf5, 0x91, 0x40, 0xae,
+ 0xfa, 0x52, 0x23, 0x58, 0x21, 0x00, 0xe2, 0x3b, 0xaa, 0x88, 0xfc, 0xec, 0x23, 0xe7, 0x93,
+ 0x91, 0x04, 0x8e, 0xae, 0xa7, 0x44, 0xb4, 0x5e, 0x46, 0xe8, 0x91, 0x59, 0x3e, 0x43, 0x13,
+ 0x82, 0x8e, 0xa1, 0xee, 0x47, 0xbd, 0x13, 0x27, 0x58, 0x40, 0x43, 0x1d, 0xc8, 0x35, 0x44,
+ 0xbf, 0xd5, 0x06, 0x2c, 0xac, 0x18, 0x3c, 0xbb, 0xc6, 0x77, 0x99, 0x2f, 0x4e, 0x71, 0xcd,
+ 0x7a, 0x9b, 0x93, 0xc7, 0x08, 0xa3, 0x71, 0x89, 0xb5, 0xb2, 0x04, 0xbe, 0x69, 0x22, 0xf3,
+ 0x66, 0xb8, 0xa9, 0xc6, 0x5e, 0x7c, 0x45, 0xf6, 0x2f, 0x8a, 0xa9, 0x3e, 0xee, 0x6f, 0x92,
+ 0x2a, 0x9c, 0x91, 0xe2, 0x1d, 0x4a, 0x4e, 0x4a, 0xb4, 0xcc, 0x87, 0xd2, 0x85, 0x5f, 0xa1,
+ 0x6b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x78, 0x3b, 0x62,
+ 0x72, 0x61, 0x6e, 0x64, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x31, 0x2f,
+ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x31, 0x3a, 0x31, 0x31, 0x2f, 0x69, 0x64, 0x2f, 0x32,
+ 0x30, 0x32, 0x31, 0x30, 0x38, 0x30, 0x35, 0x2e, 0x34, 0x32, 0x3a, 0x75, 0x73, 0x65, 0x72,
+ 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2d, 0x6b, 0x65, 0x79, 0x73};
const RpcHardwareInfo kRpcHardwareInfo = {.versionNumber = 3};
@@ -640,14 +952,87 @@
ASSERT_FALSE(*result) << "DICE Chain is proper";
}
+TEST(RemoteProvUtils, csrHasUdsCerts) {
+ auto csr = hwtrust::Csr::validate(kCsrWithUdsCerts, hwtrust::DiceChain::Kind::kVsr16,
+ false /*isFactory*/, false /*allowAnyMode*/,
+ deviceSuffix(DEFAULT_INSTANCE_NAME));
+ ASSERT_TRUE(csr.ok()) << csr.error().message();
+ ASSERT_TRUE(csr->hasUdsCerts());
+}
+
+TEST(RemoteProvUtils, csrDoesntHaveUdsCerts) {
+ auto csr = hwtrust::Csr::validate(kCsrWithoutUdsCerts, hwtrust::DiceChain::Kind::kVsr16,
+ false /*isFactory*/, false /*allowAnyMode*/,
+ deviceSuffix(DEFAULT_INSTANCE_NAME));
+ ASSERT_TRUE(csr.ok()) << csr.error().message();
+ ASSERT_FALSE(csr->hasUdsCerts());
+}
+
+TEST(RemoteProvUtils, csrHasCorrectChallenge) {
+ auto csr = hwtrust::Csr::validate(kCsrWithoutUdsCerts, hwtrust::DiceChain::Kind::kVsr16,
+ false /*isFactory*/, false /*allowAnyMode*/,
+ deviceSuffix(DEFAULT_INSTANCE_NAME));
+ ASSERT_TRUE(csr.ok()) << csr.error().message();
+
+ auto equal = csr->compareChallenge(kChallenge);
+ ASSERT_TRUE(equal.ok()) << equal.error().message();
+
+ ASSERT_TRUE(*equal) << kErrorChallengeMismatch;
+
+ auto zeroes = std::vector<uint8_t>(32, 0);
+ auto notEqual = csr->compareChallenge(zeroes);
+ ASSERT_TRUE(notEqual.ok()) << notEqual.error().message();
+
+ ASSERT_FALSE(*notEqual) << "ERROR: challenges are not different";
+}
+
+TEST(RemoteProvUtils, csrHasCorrectKeysToSign) {
+ auto csr = hwtrust::Csr::validate(kCsrWithoutUdsCerts, hwtrust::DiceChain::Kind::kVsr16,
+ false /*isFactory*/, false /*allowAnyMode*/,
+ deviceSuffix(DEFAULT_INSTANCE_NAME));
+ ASSERT_TRUE(csr.ok()) << csr.error().message();
+
+ auto equal = csr->compareKeysToSign(kKeysToSignForCsrWithoutUdsCerts);
+ ASSERT_TRUE(equal.ok()) << equal.error().message();
+ ASSERT_TRUE(*equal) << kErrorKeysToSignMismatch;
+
+ auto zeroes = std::vector<uint8_t>(kKeysToSignForCsrWithoutUdsCerts.size(), 0);
+ auto notEqual = csr->compareKeysToSign(zeroes);
+ ASSERT_TRUE(notEqual.ok()) << notEqual.error().message();
+ ASSERT_FALSE(*notEqual) << kErrorKeysToSignMismatch;
+}
+
+TEST(RemoteProvUtilsTest, allowDegenerateDiceChainWhenDegenerate) {
+ auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithDegenerateDiceChain);
+ ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
+
+ const auto keysToSign = keysToSignPtr->asArray();
+ auto csr = verifyFactoryCsr(*keysToSign, kCsrWithDegenerateDiceChain, kRpcHardwareInfo,
+ DEFAULT_INSTANCE_NAME, kChallenge,
+ /*allowDegenerate=*/true, /*requireUdsCerts=*/false);
+ ASSERT_TRUE(csr) << csr.message();
+}
+
+TEST(RemoteProvUtilsTest, disallowDegenerateDiceChainWhenDegenerate) {
+ auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithDegenerateDiceChain);
+ ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
+
+ const auto keysToSign = keysToSignPtr->asArray();
+ auto csr = verifyFactoryCsr(*keysToSign, kCsrWithDegenerateDiceChain, kRpcHardwareInfo,
+ DEFAULT_INSTANCE_NAME, kChallenge,
+ /*allowDegenerate=*/false, /*requireUdsCerts=*/false);
+ ASSERT_FALSE(csr);
+ ASSERT_THAT(csr.message(), testing::HasSubstr(kErrorDiceChainIsDegenerate));
+}
+
TEST(RemoteProvUtilsTest, requireUdsCertsWhenPresent) {
auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithUdsCerts);
ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
const auto keysToSign = keysToSignPtr->asArray();
- auto csr =
- verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, kRpcHardwareInfo, "default", kChallenge,
- /*allowDegenerate=*/false, /*requireUdsCerts=*/true);
+ auto csr = verifyFactoryCsr(*keysToSign, kCsrWithUdsCerts, kRpcHardwareInfo,
+ DEFAULT_INSTANCE_NAME, kChallenge,
+ /*allowDegenerate=*/false, /*requireUdsCerts=*/true);
ASSERT_TRUE(csr) << csr.message();
}
@@ -667,13 +1052,11 @@
DEFAULT_INSTANCE_NAME, kChallenge, /*allowDegenerate=*/false,
/*requireUdsCerts=*/true);
ASSERT_FALSE(csr);
- ASSERT_THAT(csr.message(), testing::HasSubstr("UdsCerts must not be empty"));
+ ASSERT_THAT(csr.message(), testing::HasSubstr(kErrorUdsCertsAreRequired));
}
TEST(RemoteProvUtilsTest, dontRequireUdsCertsWhenNotPresent) {
- auto [keysToSignPtr, _, errMsg] = cppbor::parse(
- kKeysToSignForCsrWithoutUdsCerts.data(),
- kKeysToSignForCsrWithoutUdsCerts.data() + kKeysToSignForCsrWithoutUdsCerts.size());
+ auto [keysToSignPtr, _, errMsg] = cppbor::parse(kKeysToSignForCsrWithoutUdsCerts);
ASSERT_TRUE(keysToSignPtr) << "Error: " << errMsg;
const auto* keysToSign = keysToSignPtr->asArray();
@@ -683,6 +1066,42 @@
ASSERT_TRUE(csr) << csr.message();
}
+TEST(RemoteProvUtilsTest, compareRootPublicKeysInDiceChains) {
+ ASSERT_NE(kCsrWithSharedUdsRoot1, kCsrWithSharedUdsRoot2);
+ ASSERT_NE(kCsrWithUdsCerts, kCsrWithSharedUdsRoot1);
+
+ auto equal = compareRootPublicKeysInDiceChains(kCsrWithSharedUdsRoot1, DEFAULT_INSTANCE_NAME,
+ kCsrWithSharedUdsRoot2, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(equal) << equal.message();
+ ASSERT_TRUE(*equal) << "Root public keys in DICE chains do not match.";
+
+ auto notEqual = compareRootPublicKeysInDiceChains(kCsrWithSharedUdsRoot1, DEFAULT_INSTANCE_NAME,
+ kCsrWithUdsCerts, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(notEqual) << notEqual.message();
+ ASSERT_FALSE(*notEqual) << "Root public keys in DICE chains match.";
+}
+
+TEST(RemoteProvUtilsTest, componentNameInLeafCertificateOfDiceChainContainsKeyMint) {
+ auto result = verifyComponentNameInKeyMintDiceChain(kCsrWithKeyMintInComponentName);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_TRUE(*result) << "Leaf Certificate in CSR does not contain 'keymint' in component name";
+
+ auto result2 = verifyComponentNameInKeyMintDiceChain(kCsrWithUdsCerts);
+ ASSERT_TRUE(result2) << result2.message();
+ ASSERT_FALSE(*result2) << "Leaf Certificate in CSR contains 'keymint' in component name";
+}
+
+TEST(RemoteProvUtilsTest, checkModeOnCertificatesInDiceChain) {
+ auto hasNonNormalMode = hasNonNormalModeInDiceChain(kCsrWithDebugMode, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(hasNonNormalMode) << hasNonNormalMode.message();
+ ASSERT_TRUE(*hasNonNormalMode);
+
+ auto hasNonNormalModeInDiceChain2 =
+ hasNonNormalModeInDiceChain(kCsrWithUdsCerts, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(hasNonNormalModeInDiceChain2) << hasNonNormalModeInDiceChain2.message();
+ ASSERT_FALSE(*hasNonNormalModeInDiceChain2);
+}
+
TEST(RemoteProvUtilsTest, parseFullyQualifiedInstanceNames) {
ASSERT_EQ(deviceSuffix(RKPVM_INSTANCE_NAME), "avf");
ASSERT_EQ(deviceSuffix(DEFAULT_INSTANCE_NAME), "default");
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 5467679..f40a752 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -151,20 +151,24 @@
return corruptChain.encode();
}
-bool matching_keymint_device(const string& rp_name, std::shared_ptr<IKeyMintDevice>* keyMint) {
- auto rp_suffix = deviceSuffix(rp_name);
+template <class T>
+auto getHandle(const string& serviceName) {
+ ::ndk::SpAIBinder binder(AServiceManager_waitForService(serviceName.c_str()));
+ return T::fromBinder(binder);
+}
- vector<string> km_names = ::android::getAidlHalInstanceNames(IKeyMintDevice::descriptor);
- for (const string& km_name : km_names) {
+std::shared_ptr<IKeyMintDevice> matchingKeyMintDevice(const string& rpcName) {
+ auto rpcSuffix = deviceSuffix(rpcName);
+
+ vector<string> kmNames = ::android::getAidlHalInstanceNames(IKeyMintDevice::descriptor);
+ for (const string& kmName : kmNames) {
// If the suffix of the KeyMint instance equals the suffix of the
// RemotelyProvisionedComponent instance, assume they match.
- if (deviceSuffix(km_name) == rp_suffix && AServiceManager_isDeclared(km_name.c_str())) {
- ::ndk::SpAIBinder binder(AServiceManager_waitForService(km_name.c_str()));
- *keyMint = IKeyMintDevice::fromBinder(binder);
- return true;
+ if (deviceSuffix(kmName) == rpcSuffix && AServiceManager_isDeclared(kmName.c_str())) {
+ getHandle<IKeyMintDevice>(kmName);
}
}
- return false;
+ return nullptr;
}
} // namespace
@@ -173,8 +177,7 @@
public:
virtual void SetUp() override {
if (AServiceManager_isDeclared(GetParam().c_str())) {
- ::ndk::SpAIBinder binder(AServiceManager_waitForService(GetParam().c_str()));
- provisionable_ = IRemotelyProvisionedComponent::fromBinder(binder);
+ provisionable_ = getHandle<IRemotelyProvisionedComponent>(GetParam());
}
ASSERT_NE(provisionable_, nullptr);
auto status = provisionable_->getHardwareInfo(&rpcHardwareInfo);
@@ -210,9 +213,7 @@
std::set<std::string> uniqueIds;
for (auto hal : ::android::getAidlHalInstanceNames(IRemotelyProvisionedComponent::descriptor)) {
ASSERT_TRUE(AServiceManager_isDeclared(hal.c_str()));
- ::ndk::SpAIBinder binder(AServiceManager_waitForService(hal.c_str()));
- std::shared_ptr<IRemotelyProvisionedComponent> rpc =
- IRemotelyProvisionedComponent::fromBinder(binder);
+ auto rpc = getHandle<IRemotelyProvisionedComponent>(hal);
ASSERT_NE(rpc, nullptr);
RpcHardwareInfo hwInfo;
@@ -237,6 +238,7 @@
* on the device.
*/
// @VsrTest = 3.10-015
+// @VsrTest = 3.10-018.001
TEST(NonParameterizedTests, requireDiceOnDefaultInstanceIfStrongboxPresent) {
int vsr_api_level = get_vsr_api_level();
if (vsr_api_level < 35) {
@@ -248,6 +250,85 @@
GTEST_SKIP() << "Strongbox is not present on this device.";
}
+ auto rpc = getHandle<IRemotelyProvisionedComponent>(DEFAULT_INSTANCE_NAME);
+ ASSERT_NE(rpc, nullptr);
+
+ bytevec challenge = randomBytes(64);
+ bytevec csr;
+ auto status = rpc->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ EXPECT_TRUE(status.isOk()) << status.getDescription();
+
+ auto result = isCsrWithProperDiceChain(csr, DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_TRUE(*result);
+}
+
+/**
+ * Verify that if a protected VM (also called `avf` or RKP VM) implementation exists, then the
+ * protected VM and the primary KeyMint (also called 'default') implementation's DICE certificate
+ * chain has the same root public key, i.e., the same UDS public key
+ */
+// @VsrTest = 7.1-003.001
+TEST(NonParameterizedTests, equalUdsPubInDiceCertChainForRkpVmAndPrimaryKeyMintInstances) {
+ int apiLevel = get_vsr_api_level();
+ if (apiLevel < 202504 && !AServiceManager_isDeclared(RKPVM_INSTANCE_NAME.c_str())) {
+ GTEST_SKIP() << "The RKP VM (" << RKPVM_INSTANCE_NAME << ") is not present on this device.";
+ }
+ if (apiLevel >= 202504) {
+ ASSERT_TRUE(AServiceManager_isDeclared(RKPVM_INSTANCE_NAME.c_str()));
+ }
+
+ auto rkpVmRpc = getHandle<IRemotelyProvisionedComponent>(RKPVM_INSTANCE_NAME);
+ ASSERT_NE(rkpVmRpc, nullptr) << "The RKP VM (" << RKPVM_INSTANCE_NAME
+ << ") RPC is unavailable.";
+
+ RpcHardwareInfo hardwareInfo;
+ auto status = rkpVmRpc->getHardwareInfo(&hardwareInfo);
+ if (!status.isOk()) {
+ GTEST_SKIP() << "The RKP VM is not supported on this system.";
+ }
+
+ bytevec rkpVmChallenge = randomBytes(MAX_CHALLENGE_SIZE);
+ bytevec rkpVmCsr;
+ auto rkpVmStatus =
+ rkpVmRpc->generateCertificateRequestV2({} /* keysToSign */, rkpVmChallenge, &rkpVmCsr);
+ ASSERT_TRUE(rkpVmStatus.isOk()) << rkpVmStatus.getDescription();
+
+ auto primaryKeyMintRpc = getHandle<IRemotelyProvisionedComponent>(DEFAULT_INSTANCE_NAME);
+ ASSERT_NE(primaryKeyMintRpc, nullptr)
+ << "The Primary KeyMint (" << DEFAULT_INSTANCE_NAME << ") RPC is unavailable.";
+
+ bytevec primaryKeyMintChallenge = randomBytes(MAX_CHALLENGE_SIZE);
+ bytevec primaryKeyMintCsr;
+ auto primaryKeyMintStatus = primaryKeyMintRpc->generateCertificateRequestV2(
+ {} /* keysToSign */, primaryKeyMintChallenge, &primaryKeyMintCsr);
+ ASSERT_TRUE(primaryKeyMintStatus.isOk()) << primaryKeyMintStatus.getDescription();
+
+ auto equal = compareRootPublicKeysInDiceChains(rkpVmCsr, RKPVM_INSTANCE_NAME, primaryKeyMintCsr,
+ DEFAULT_INSTANCE_NAME);
+ ASSERT_TRUE(equal) << equal.message();
+ ASSERT_TRUE(*equal) << "Primary KeyMint and RKP VM RPCs have different UDS public keys";
+}
+
+/**
+ * Suppose that there is a StrongBox KeyMint instance on the device.
+ *
+ * Then, this test verifies that "keymint" is a substring of the component name in the configuration
+ * descriptor in the leaf certificate of the DICE chain for the primary ("default") KeyMint
+ * instance.
+ */
+// @VsrTest = 3.10-018.003
+TEST(NonParameterizedTests, componentNameInConfigurationDescriptorForPrimaryKeyMintInstance) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level < 202504) {
+ GTEST_SKIP() << "Applies only to VSR API level 202504 or newer, this device is: "
+ << vsr_api_level;
+ }
+
+ if (!AServiceManager_isDeclared(KEYMINT_STRONGBOX_INSTANCE_NAME.c_str())) {
+ GTEST_SKIP() << "Strongbox is not present on this device.";
+ }
+
::ndk::SpAIBinder binder(AServiceManager_waitForService(DEFAULT_INSTANCE_NAME.c_str()));
std::shared_ptr<IRemotelyProvisionedComponent> rpc =
IRemotelyProvisionedComponent::fromBinder(binder);
@@ -258,7 +339,7 @@
auto status = rpc->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
EXPECT_TRUE(status.isOk()) << status.getDescription();
- auto result = isCsrWithProperDiceChain(csr, DEFAULT_INSTANCE_NAME);
+ auto result = verifyComponentNameInKeyMintDiceChain(csr);
ASSERT_TRUE(result) << result.message();
ASSERT_TRUE(*result);
}
@@ -336,9 +417,8 @@
*/
TEST_P(GenerateKeyTests, generateAndUseEcdsaP256Key_prodMode) {
// See if there is a matching IKeyMintDevice for this IRemotelyProvisionedComponent.
- std::shared_ptr<IKeyMintDevice> keyMint;
- if (!matching_keymint_device(GetParam(), &keyMint)) {
- // No matching IKeyMintDevice.
+ auto keyMint = matchingKeyMintDevice(GetParam());
+ if (!keyMint) {
GTEST_SKIP() << "Skipping key use test as no matching KeyMint device found";
return;
}
@@ -416,6 +496,32 @@
check_maced_pubkey(macedPubKey, testMode, nullptr);
}
+/**
+ * Generate and validate at most 2**16 production-mode keys. This aims to catch issues that do not
+ * deterministically show up. In practice, this will test far fewer keys, but a certain number are
+ * tested at a minimum.
+ */
+TEST_P(GenerateKeyTests, generateManyEcdsaP256KeysInProdMode) {
+ const auto start = std::chrono::steady_clock::now();
+ const auto time_bound = std::chrono::seconds(5);
+ const auto upper_bound = 1 << 16;
+ const auto lower_bound = 1 << 8;
+ for (auto iteration = 0; iteration < upper_bound; iteration++) {
+ MacedPublicKey macedPubKey;
+ bytevec privateKeyBlob;
+ bool testMode = false;
+ auto status =
+ provisionable_->generateEcdsaP256KeyPair(testMode, &macedPubKey, &privateKeyBlob);
+ ASSERT_TRUE(status.isOk());
+ vector<uint8_t> coseKeyData;
+ check_maced_pubkey(macedPubKey, testMode, &coseKeyData);
+ const auto current_time = std::chrono::steady_clock::now() - start;
+ if (iteration >= lower_bound && current_time >= time_bound) {
+ break;
+ }
+ }
+}
+
class CertificateRequestTestBase : public VtsRemotelyProvisionedComponentTests {
protected:
CertificateRequestTestBase()
@@ -743,6 +849,37 @@
};
/**
+ * Check that ro.boot.vbmeta.device_state is not "locked" or ro.boot.verifiedbootstate
+ * is not "green" if and only if the mode on at least one certificate in the DICE chain
+ * is non-normal.
+ */
+TEST_P(CertificateRequestV2Test, unlockedBootloaderStatesImpliesNonnormalDiceChain) {
+ auto challenge = randomBytes(MAX_CHALLENGE_SIZE);
+ bytevec csr;
+ auto status =
+ provisionable_->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+ auto isProper = isCsrWithProperDiceChain(csr, GetParam());
+ ASSERT_TRUE(isProper) << isProper.message();
+ if (!*isProper) {
+ GTEST_SKIP() << "Skipping test: Only a proper DICE chain has a mode set.";
+ }
+
+ auto nonNormalMode = hasNonNormalModeInDiceChain(csr, GetParam());
+ ASSERT_TRUE(nonNormalMode) << nonNormalMode.message();
+
+ auto deviceState = ::android::base::GetProperty("ro.boot.vbmeta.device_state", "");
+ auto verifiedBootState = ::android::base::GetProperty("ro.boot.verifiedbootstate", "");
+
+ ASSERT_EQ(deviceState != "locked" || verifiedBootState != "green", *nonNormalMode)
+ << "ro.boot.vbmeta.device_state = '" << deviceState
+ << "' and ro.boot.verifiedbootstate = '" << verifiedBootState << "', but it is "
+ << *nonNormalMode
+ << " that the DICE chain has a certificate with a non-normal mode set.";
+}
+
+/**
* Generate an empty certificate request with all possible length of challenge, and decrypt and
* verify the structure and content.
*/
@@ -905,9 +1042,8 @@
// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, DeviceInfo) {
// See if there is a matching IKeyMintDevice for this IRemotelyProvisionedComponent.
- std::shared_ptr<IKeyMintDevice> keyMint;
- if (!matching_keymint_device(GetParam(), &keyMint)) {
- // No matching IKeyMintDevice.
+ std::shared_ptr<IKeyMintDevice> keyMint = matchingKeyMintDevice(GetParam());
+ if (!keyMint) {
GTEST_SKIP() << "Skipping key use test as no matching KeyMint device found";
return;
}
@@ -973,6 +1109,7 @@
std::unique_ptr<cppbor::Array> csrPayload = std::move(*result);
ASSERT_TRUE(csrPayload);
+ ASSERT_TRUE(csrPayload->size() > 2);
auto deviceInfo = csrPayload->get(2)->asMap();
ASSERT_TRUE(deviceInfo);
diff --git a/security/secretkeeper/aidl/Android.bp b/security/secretkeeper/aidl/Android.bp
index d282621..f0b7894 100644
--- a/security/secretkeeper/aidl/Android.bp
+++ b/security/secretkeeper/aidl/Android.bp
@@ -25,7 +25,7 @@
"android.hardware.security.authgraph-V1",
],
stability: "vintf",
- frozen: true,
+ frozen: false,
backend: {
java: {
enabled: true,
@@ -88,6 +88,6 @@
rust_defaults {
name: "secretkeeper_use_latest_hal_aidl_rust",
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
+ "android.hardware.security.secretkeeper-V2-rust",
],
}
diff --git a/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
index 8ce37cd..ed48480 100644
--- a/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
+++ b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/ISecretkeeper.aidl
@@ -38,6 +38,7 @@
byte[] processSecretManagementRequest(in byte[] request);
void deleteIds(in android.hardware.security.secretkeeper.SecretId[] ids);
void deleteAll();
+ android.hardware.security.secretkeeper.PublicKey getSecretkeeperIdentity();
const int ERROR_UNKNOWN_KEY_ID = 1;
const int ERROR_INTERNAL_ERROR = 2;
const int ERROR_REQUEST_MALFORMED = 3;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
similarity index 89%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
index 1e304ab..f690abf 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/secretkeeper/aidl/aidl_api/android.hardware.security.secretkeeper/current/android/hardware/security/secretkeeper/PublicKey.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.secretkeeper;
+/* @hide */
+@VintfStability
+parcelable PublicKey {
+ byte[] keyMaterial;
}
diff --git a/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
index b07dba8..91493a1 100644
--- a/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
+++ b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/ISecretkeeper.aidl
@@ -17,6 +17,7 @@
package android.hardware.security.secretkeeper;
import android.hardware.security.authgraph.IAuthGraphKeyExchange;
+import android.hardware.security.secretkeeper.PublicKey;
import android.hardware.security.secretkeeper.SecretId;
@VintfStability
@@ -101,4 +102,12 @@
* Delete data of all clients.
*/
void deleteAll();
+
+ /**
+ * Gets the public key of the secret keeper instance. This should be a CBOR-encoded
+ * COSE_Key, as a PubKeyEd25519 / PubKeyECDSA256 / PubKeyECDSA384, as defined in
+ * generateCertificateRequestV2.cddl. Clients must have a trusted way of ensuring
+ * this key is valid.
+ */
+ PublicKey getSecretkeeperIdentity();
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
similarity index 69%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
copy to security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
index bfa5daa..ccc89b3 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
+++ b/security/secretkeeper/aidl/android/hardware/security/secretkeeper/PublicKey.aidl
@@ -1,6 +1,5 @@
-
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,11 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package android.hardware.security.see.hwcrypto.types;
-/*
- * Type encapsulating nonce used on non-authenticated AES symmetric encryption.
+package android.hardware.security.secretkeeper;
+
+/**
+ * Contents of a pubkey.
+ * @hide
*/
-parcelable CipherModeParameters {
- byte[16] nonce;
+@VintfStability
+parcelable PublicKey {
+ /**
+ * CBOR-encoded COSE_Key
+ */
+ byte[] keyMaterial;
}
diff --git a/security/secretkeeper/aidl/vts/Android.bp b/security/secretkeeper/aidl/vts/Android.bp
index be07a7b..c84afae 100644
--- a/security/secretkeeper/aidl/vts/Android.bp
+++ b/security/secretkeeper/aidl/vts/Android.bp
@@ -38,6 +38,7 @@
srcs: ["secretkeeper_test_client.rs"],
defaults: [
"rdroidtest.defaults",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
test_suites: [
"general-tests",
@@ -45,7 +46,6 @@
],
test_config: "AndroidTest.xml",
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libauthgraph_boringssl",
"libauthgraph_core",
"libauthgraph_wire",
@@ -66,9 +66,10 @@
rust_binary {
name: "secretkeeper_cli",
srcs: ["secretkeeper_cli.rs"],
+ defaults: ["secretkeeper_use_latest_hal_aidl_rust"],
lints: "android",
- rlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
+ prefer_rlib: true,
+ rustlibs: [
"libanyhow",
"libauthgraph_boringssl",
"libauthgraph_core",
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index 449a99a..b944865 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -16,6 +16,7 @@
use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::ISecretkeeper::ISecretkeeper;
use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::SecretId::SecretId;
+use android_hardware_security_secretkeeper::aidl::android::hardware::security::secretkeeper::PublicKey::PublicKey;
use authgraph_vts_test as ag_vts;
use authgraph_boringssl as boring;
use authgraph_core::key;
@@ -70,20 +71,32 @@
0x06, 0xAC, 0x36, 0x8B, 0x3C, 0x95, 0x50, 0x16, 0x67, 0x71, 0x65, 0x26, 0xEB, 0xD0, 0xC3, 0x98,
]);
-// Android expects the public key of Secretkeeper instance to be present in the Linux device tree.
+// Android expects the public key of Secretkeeper instance to be available either
+// a) by being present in the Linux device tree (prior to version 2 of the secretkeeper HAL), or
+// b) via the `getSecretKeeperIdentity` operation from v2 onwards.
// This allows clients to (cryptographically) verify that they are indeed talking to the real
// secretkeeper.
// Note that this is the identity of the `default` instance (and not `nonsecure`)!
-fn get_secretkeeper_identity() -> Option<CoseKey> {
- let path = Path::new(SECRETKEEPER_KEY_HOST_DT);
- if path.exists() {
- let key = fs::read(path).unwrap();
- let mut key = CoseKey::from_slice(&key).unwrap();
- key.canonicalize(CborOrdering::Lexicographic);
- Some(key)
+fn get_secretkeeper_identity(instance: &str) -> Option<CoseKey> {
+ let sk = get_connection(instance);
+ let key_material = if sk.getInterfaceVersion().expect("Error getting sk interface version") >= 2 {
+ let PublicKey { keyMaterial } = sk.getSecretkeeperIdentity().expect("Error calling getSecretkeeperIdentity");
+ Some(keyMaterial)
} else {
- None
- }
+ let path = Path::new(SECRETKEEPER_KEY_HOST_DT);
+ if path.exists() {
+ let key_material = fs::read(path).unwrap();
+ Some(key_material)
+ } else {
+ None
+ }
+ };
+
+ key_material.map(|km| {
+ let mut cose_key = CoseKey::from_slice(&km).expect("Error deserializing CoseKey from key material");
+ cose_key.canonicalize(CborOrdering::Lexicographic);
+ cose_key
+ })
}
fn get_instances() -> Vec<(String, String)> {
@@ -760,12 +773,12 @@
}
// This test checks that the identity of Secretkeeper (in context of AuthGraph key exchange) is
-// same as the one advertized in Linux device tree. This is only expected from `default` instance.
+// same as the one either a) advertized in Linux device tree or b) retrieved from SK itself
+// from (HAL v2 onwards). This is only expected from `default` instance.
#[rdroidtest(get_instances())]
-#[ignore_if(|p| p != "default")]
fn secretkeeper_check_identity(instance: String) {
- let sk_key = get_secretkeeper_identity()
- .expect("Failed to extract identity of default instance from device tree");
+ let sk_key = get_secretkeeper_identity(&instance)
+ .expect("Failed to extract identity of default instance");
// Create a session with this expected identity. This succeeds only if the identity used by
// Secretkeeper is sk_key.
let _ = SkClient::with_expected_sk_identity(&instance, sk_key).unwrap();
diff --git a/security/secretkeeper/default/Android.bp b/security/secretkeeper/default/Android.bp
index 799188f..134afc9 100644
--- a/security/secretkeeper/default/Android.bp
+++ b/security/secretkeeper/default/Android.bp
@@ -28,9 +28,9 @@
vendor_available: true,
defaults: [
"authgraph_use_latest_hal_aidl_rust",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libauthgraph_boringssl",
"libauthgraph_core",
"libauthgraph_hal",
@@ -50,9 +50,9 @@
prefer_rlib: true,
defaults: [
"authgraph_use_latest_hal_aidl_rust",
+ "secretkeeper_use_latest_hal_aidl_rust",
],
rustlibs: [
- "android.hardware.security.secretkeeper-V1-rust",
"libandroid_logger",
"libbinder_rs",
"liblog_rust",
diff --git a/security/secretkeeper/default/secretkeeper.xml b/security/secretkeeper/default/secretkeeper.xml
index 40aebe0..699fff0 100644
--- a/security/secretkeeper/default/secretkeeper.xml
+++ b/security/secretkeeper/default/secretkeeper.xml
@@ -19,7 +19,7 @@
<hal format="aidl">
<name>android.hardware.security.secretkeeper</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>ISecretkeeper</name>
<instance>nonsecure</instance>
diff --git a/security/see/Android.bp b/security/see/Android.bp
new file mode 100644
index 0000000..ba873e0
--- /dev/null
+++ b/security/see/Android.bp
@@ -0,0 +1,5 @@
+dirgroup {
+ name: "trusty_dirgroup_hardware_interfaces_security_see",
+ dirs: ["."],
+ visibility: ["//trusty/vendor/google/aosp/scripts"],
+}
diff --git a/security/see/OWNERS b/security/see/OWNERS
new file mode 100644
index 0000000..d1a606f
--- /dev/null
+++ b/security/see/OWNERS
@@ -0,0 +1,5 @@
+# include OWNERS from the top level trusty repo
+include trusty:main:/OWNERS
+
+paulcrowley@google.com
+swillden@google.com
diff --git a/security/see/authmgr/aidl/Android.bp b/security/see/authmgr/aidl/Android.bp
new file mode 100644
index 0000000..a32d4e9
--- /dev/null
+++ b/security/see/authmgr/aidl/Android.bp
@@ -0,0 +1,57 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.see.authmgr",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/security/see/authmgr/*.aidl",
+ ],
+ stability: "vintf",
+ frozen: false,
+ backend: {
+ java: {
+ platform_apis: true,
+ },
+ ndk: {
+ enabled: true,
+ },
+ rust: {
+ enabled: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.virt",
+ ],
+ },
+ },
+}
+
+// A rust_defaults that includes the latest authmgr AIDL library.
+// Modules that depend on authmgr directly can include this rust_defaults to avoid
+// managing dependency versions explicitly.
+rust_defaults {
+ name: "authmgr_use_latest_hal_aidl_rust",
+ rustlibs: [
+ "android.hardware.security.see.authmgr-V1-rust",
+ ],
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceChainEntry.aidl
similarity index 87%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceChainEntry.aidl
index 1e304ab..b775f95 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceChainEntry.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.authmgr;
+@RustDerive(Clone=true, Eq=true, PartialEq=true) @VintfStability
+parcelable DiceChainEntry {
+ byte[] diceChainEntry;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
similarity index 82%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
index d88d5c8..0f61900 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,12 +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.security.see.hwcrypto;
-parcelable MemoryBufferParameter {
- android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
- int sizeBytes;
- union MemoryBuffer {
- ParcelFileDescriptor input;
- ParcelFileDescriptor output;
- }
+package android.hardware.security.see.authmgr;
+@RustDerive(Clone=true, Eq=true, PartialEq=true) @VintfStability
+parcelable DiceLeafArtifacts {
+ android.hardware.security.see.authmgr.DiceChainEntry diceLeaf;
+ android.hardware.security.see.authmgr.DicePolicy diceLeafPolicy;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DicePolicy.aidl
similarity index 87%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DicePolicy.aidl
index 1e304ab..f434c3c 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DicePolicy.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.authmgr;
+@RustDerive(Clone=true, Eq=true, PartialEq=true) @VintfStability
+parcelable DicePolicy {
+ byte[] dicePolicy;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
similarity index 64%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
index 5c26cc2..9e6a501 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,24 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.authmgr;
+@Backing(type="int") @VintfStability
+enum Error {
+ OK = 0,
+ AUTHENTICATION_ALREADY_STARTED = (-1) /* -1 */,
+ INSTANCE_ALREADY_AUTHENTICATED = (-2) /* -2 */,
+ INVALID_DICE_CERT_CHAIN = (-3) /* -3 */,
+ INVALID_DICE_LEAF = (-4) /* -4 */,
+ INVALID_DICE_POLICY = (-5) /* -5 */,
+ DICE_POLICY_MATCHING_FAILED = (-6) /* -6 */,
+ SIGNATURE_VERIFICATION_FAILED = (-7) /* -7 */,
+ CONNECTION_HANDOVER_FAILED = (-8) /* -8 */,
+ CONNECTION_NOT_AUTHENTICATED = (-9) /* -9 */,
+ NO_CONNECTION_TO_AUTHORIZE = (-10) /* -10 */,
+ INVALID_INSTANCE_IDENTIFIER = (-11) /* -11 */,
+ MEMORY_ALLOCATION_FAILED = (-12) /* -12 */,
+ INSTANCE_PENDING_DELETION = (-13) /* -13 */,
+ CLIENT_PENDING_DELETION = (-14) /* -14 */,
+ AUTHENTICATION_NOT_STARTED = (-15) /* -15 */,
+ INSTANCE_CONTEXT_CREATION_DENIED = (-16) /* -16 */,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl
similarity index 87%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl
index 1e304ab..18d90eb 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.authmgr;
+@RustDerive(Clone=true, Eq=true, PartialEq=true) @VintfStability
+parcelable ExplicitKeyDiceCertChain {
+ byte[] diceCertChain;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
similarity index 70%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
index 5c26cc2..a120b49 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.authmgr;
+@VintfStability
+interface IAuthMgrAuthorization {
+ byte[32] initAuthentication(in android.hardware.security.see.authmgr.ExplicitKeyDiceCertChain diceCertChain, in @nullable byte[] instanceIdentifier);
+ void completeAuthentication(in android.hardware.security.see.authmgr.SignedConnectionRequest signedConnectionRequest, in android.hardware.security.see.authmgr.DicePolicy dicePolicy);
+ void authorizeAndConnectClientToTrustedService(in byte[] clientID, String serviceName, in byte[32] token, in android.hardware.security.see.authmgr.DiceLeafArtifacts clientDiceArtifacts);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
similarity index 86%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
index 1e304ab..46d8373 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.authmgr;
+@RustDerive(Clone=true, Eq=true, PartialEq=true) @VintfStability
+parcelable SignedConnectionRequest {
+ byte[] signedConnectionRequest;
}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceChainEntry.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceChainEntry.aidl
new file mode 100644
index 0000000..3b4a35b
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceChainEntry.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+/**
+ * A CBOR encoded DICE certificate.
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true)
+parcelable DiceChainEntry {
+ /**
+ * Data is CBOR encoded according to the `DiceChainEntry` CDDL in
+ * hardware/interfaces/security/rkp/aidl/android/hardware/security/keymint/
+ * generateCertificateRequestV2.cddl
+ */
+ byte[] diceChainEntry;
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
new file mode 100644
index 0000000..333096f
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+import android.hardware.security.see.authmgr.DiceChainEntry;
+import android.hardware.security.see.authmgr.DicePolicy;
+
+/**
+ * This contains the DICE certificate and the DICE policy created for the client by the AuthMgr FE.
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true)
+parcelable DiceLeafArtifacts {
+ DiceChainEntry diceLeaf;
+ DicePolicy diceLeafPolicy;
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DicePolicy.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DicePolicy.aidl
new file mode 100644
index 0000000..4b55330
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/DicePolicy.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+/**
+ * DICE policy - CBOR encoded according to DicePolicy.cddl.
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true)
+parcelable DicePolicy {
+ /**
+ * Data is CBOR encoded according to the `DicePolicy` CDDL in
+ * hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/
+ * DicePolicy.cddl
+ */
+ byte[] dicePolicy;
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/Error.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/Error.aidl
new file mode 100644
index 0000000..f7c3592
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/Error.aidl
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+/**
+ * AuthMgr error codes. Aidl will return these error codes as service specific errors in
+ * EX_SERVICE_SPECIFIC.
+ */
+@VintfStability
+@Backing(type="int")
+enum Error {
+ /** Success */
+ OK = 0,
+
+ /** Duplicated attempt to start authentication from the same transport ID */
+ AUTHENTICATION_ALREADY_STARTED = -1,
+
+ /** Duplicated authenticated attempt with the same instance ID */
+ INSTANCE_ALREADY_AUTHENTICATED = -2,
+
+ /** Invalid DICE certificate chain of the AuthMgr FE */
+ INVALID_DICE_CERT_CHAIN = -3,
+
+ /** Invalid DICE leaf of the client */
+ INVALID_DICE_LEAF = -4,
+
+ /** Invalid DICE policy */
+ INVALID_DICE_POLICY = -5,
+
+ /** The DICE chain to policy matching failed */
+ DICE_POLICY_MATCHING_FAILED = -6,
+
+ /** Invalid signature */
+ SIGNATURE_VERIFICATION_FAILED = -7,
+
+ /** Failed to handover the connection to the trusted service */
+ CONNECTION_HANDOVER_FAILED = -8,
+
+ /**
+ * An authentication required request (e.g. phase 2) is invoked on a non-authenticated
+ * connection
+ */
+ CONNECTION_NOT_AUTHENTICATED = -9,
+
+ /** There is no pending connection with a matching token to authorize in phase 2 */
+ NO_CONNECTION_TO_AUTHORIZE = -10,
+
+ /** Invalid instance identifier */
+ INVALID_INSTANCE_IDENTIFIER = -11,
+
+ /** Failed to allocate memory */
+ MEMORY_ALLOCATION_FAILED = -12,
+
+ /** An instance which is pending deletion is trying to authenticate */
+ INSTANCE_PENDING_DELETION = -13,
+
+ /** A client which is pending deletion is trying to authorize */
+ CLIENT_PENDING_DELETION = -14,
+
+ /** Trying to complete authentication for an instance for which authentication is not started */
+ AUTHENTICATION_NOT_STARTED = -15,
+
+ /** Creation of the pVM instance's context in the secure storage is not allowed */
+ INSTANCE_CONTEXT_CREATION_DENIED = -16,
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl
new file mode 100644
index 0000000..de23530
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/ExplicitKeyDiceCertChain.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+/**
+ * DICE certificate chain - CBOR encoded according to ExplicitKeyDiceCertChain.cddl.
+ */
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true)
+parcelable ExplicitKeyDiceCertChain {
+ /**
+ * Data is CBOR encoded according to the `ExplicitKeyDiceCertChain` CDDL in
+ * hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/
+ * ExplicitKeyDiceCertChain.cddl
+ */
+ byte[] diceCertChain;
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
new file mode 100644
index 0000000..43c3bde
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
@@ -0,0 +1,276 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+import android.hardware.security.see.authmgr.DiceLeafArtifacts;
+import android.hardware.security.see.authmgr.DicePolicy;
+import android.hardware.security.see.authmgr.ExplicitKeyDiceCertChain;
+import android.hardware.security.see.authmgr.SignedConnectionRequest;
+
+/**
+ * This is the interface to be implemented by an AuthMgr backend component (AuthMgr BE), in order to
+ * allow the AuthMgr frontend component (AuthMgr FE) in a pVM instance to authenticate itself and
+ * to authorize one or more clients in the pVM instance, in order to let the clients access
+ * trusted services in the Trusted Execution Environment (TEE).
+ *
+ * The following assumptions must be true for the underlying IPC mechanism and the transport layer:
+ * 1. Both parties should be able to retrieve a non-spoofable identifier of the other party from
+ * the transport layer (a.k.a transport ID or vM ID), which stays the same throughout a given
+ * boot cycle of a pVM instance. This is important to prevent person-in-the-middle (PITM)
+ * attacks and to authorize a new connection from a pVM instance based on an already
+ * authenicated connection from the same pVM instance.
+ *
+ * 2. Each of AuthMgr FE and the AuthMgr BE should be able to hand over a connection that is
+ * setup between them to another party so that such connection can be used for communication
+ * between the two new parties subsequently. This is important to be able to handover an
+ * authorized connection established between the AuthMgr FE and the AuthMgr BE to a client in
+ * in a pVM instance and a trusted service in TEE respectively.
+ *
+ * 3. This API should be exposed over an IPC mechanism that supports statefull connections. This
+ * is important for the AuthMgr FE to setup an authenicated connection once per boot cycle
+ * and reuse it to authorize multiple client connections afterwards, if needed.
+ *
+ * 4. AuthMgr FE has a mechanism for discovering and establishing a connection to the trusted
+ * AuthMgr BE. Based on this assumptionson, mutual authentication is not covered by this
+ * API.
+ *
+ * The AuthMgr authorization protocol consists of two phases:
+ * 1. Phase 1 authenticates the AuthMgr FE to the AuthMgr BE via the first two methods of this
+ * API: `initAuthentication` and `completeAuthentication`. At the end of the successful
+ * excecution of phase 1, the AuthMgr FE and the AuthMgr BE have an authenticated connection
+ * established between them. Phase 1 also enforces rollback protection on AuthMgr FE in
+ * addition to authentication.
+ *
+ * Authentication is performed by verifying the AuthMgr FE's signature on the challenge
+ * issued by the AuthMgr BE. The public signing key of the AuthMgr FE is obtained from the
+ * validated DICE certificate chain for verifying the signature. Rollback protection is
+ * enforced by matching the DICE certificate chain against the stored DICE policy.
+ * AuthMgr FE uses this authenticated connection throughout the boot cycle of the pVM to send
+ * phase 2 requests to the AuthMgr BE. Therefore, phase 1 needs to be executed only once per
+ * boot cycle of the pVM. AuthMgr BE should take measures to prevent any duplicate
+ * authentication attempts from the same instance or from any impersonating instances.
+ *
+ * 2. Phase 2 authorizes a client in the pVM to access trusted service(s) in the TEE and
+ * establishes a new connection between the client and the trusted service based on the trust
+ * in the authenticated connection established in phase 1. The client and the trusted service
+ * can communicate independently from the AuthMgr(s) after the successful execution of
+ * phase 2 of the authorization protocol.
+ *
+ * The AuthMgr FE first opens a new vsock connection to the AuthMgr BE and sends a one-time
+ * token over that connection. The AuthMgr FE then invokes the third method of this API
+ * (`authorizeAndConnectClientToTrustedService`) on the authenticated connection established
+ * with the AuthMgr BE in phase 1. Rollback protection is enforced on the client by matching
+ * the client's DICE certificate against the stored DICE policy. The new connection is
+ * authorized by matching the token sent over the new connection and the token sent over the
+ * authenicated connection.
+ *
+ * AuthMgr BE should make sure that "use-after-destroy" threats are prevented in the implementation
+ * of this authorization protocol. This means that even if a client/pVM instance is created with the
+ * same identifier(s) of a deleted client/pVM instance, the new client should not be able to access
+ * the deleted client's secrets/resources created in the trusted services. The following
+ * requirements should be addressed in order to ensure this:
+ * 1) Each client should be identified by a unique identifier at the AuthMgr BE. The uniqueness
+ * should be guaranteed across factory resets.
+ * 2) The client's unique identifier should be used when constructing the file path to store the
+ * client's context, including the client's DICE policy, in the AuthMgr BE's secure storage.
+ * 3) The client's unique identifier should be conveyed to the trusted service(s) that the client
+ * accesses, when an authorized connection is setup between the client and the trusted service in
+ * phase 2. The trusted service(s) should mix in this unique client identifier when providing the
+ * critical services to the clients (e.g. deriving HW-backed keys by the HWCrypto service,
+ * storing data by the SecureStorage service).
+ *
+ * An example approach to build a unique identifier for a client is as follows:
+ * The AuthMgr BE stores a `global sequence number` in the secure storage that does not get
+ * wiped upon factory reset. Everytime the AuthMgr BE sees a new instance or a client, it assigns
+ * the current `global sequence number` as the unique sequence number of the instance or the client
+ * and increments the `global sequence number`.
+ */
+@VintfStability
+interface IAuthMgrAuthorization {
+ /**
+ * AuthMgr FE initiates the challenge-response protocol with the AuthMgr BE in order to
+ * authenticate the AuthMgr FE to the AuthMgr BE. AuthMgr BE creates and returns a challenge
+ * (a cryptographic random of 32 bytes) to the AuthMgr FE.
+ *
+ * The AuthMgr BE extracts the instance identifier from the DICE certificate chain of the
+ * AuthMgr FE (given in the input: `diceCertChain`). If the instance identifier is not included
+ * in the DICE certificate chain, then it should be sent in the optional
+ * input: `instanceIdentifier`. The instance identifier is used by the AuthMgr BE in this step
+ * to detect and reject any duplicate authentication attempts.
+ * The instance identifier is used in step 2 to build the file path in the secure storage to
+ * store the instance's context.
+ *
+ * If authentication is already started (but not completed) from the same transport ID, return
+ * the error code `AUTHENTICATION_ALREADY_STARTED`.
+ *
+ * @param diceCertChain - DICE certificate chain of the AuthMgr FE.
+ *
+ * @param instanceIdentifier - optional parameter to send the instance identifier, if it is not
+ * included in the DICE certificate chain
+ *
+ * @return challenge to be included in the signed response sent by the AuthMgr FE in
+ * `completeAuthentication`
+ *
+ * @throws ServiceSpecificException:
+ * Error::INSTANCE_ALREADY_AUTHENTICATED - when a pVM instance with the same
+ * `instanceIdentifier` or the same transport id has already been authenticated.
+ * Error::AUTHENTICATION_ALREADY_STARTED - when a pVM instance with the same
+ * the same transport id has already started authentication
+ */
+ byte[32] initAuthentication(in ExplicitKeyDiceCertChain diceCertChain,
+ in @nullable byte[] instanceIdentifier);
+
+ /**
+ * AuthMgr FE invokes this method to complete phase 1 of the authorization protocol. The AuthMgr
+ * BE verifies the signature in `signedConnectionRequest` with the public signing key of the
+ * AuthMgr FE obtained from the DICE certificate chain.
+ *
+ * As per the CDDL for `SignedConnectionRequest` in SignedConnectionRequest.cddl, the AuthMgr FE
+ * includes the challenge sent by the AuthMgr BE and the unique transport IDs of the AuthMgr FE
+ * and AuthMgr BE in the signed response. This is to prevent replay attacks in the presence of
+ * more than one AuthMgr BE, where one AuthMgr BE may impersonate a pVM instance/AuthMgr FE to
+ * another AuthMgr BE. Both transport IDs are included for completeness, although it is
+ * sufficient to include either of them for the purpose of preventing such attacks.
+ *
+ * AuthMgr BE validates the DICE certificate chain by verifying all the signatures in the chain
+ * and by checking wither the root public key is trusted.
+ *
+ * The AuthMgr BE matches the DICE certificate chain of the AuthMgr FE to the DICE policy given
+ * in the input: `dicePolicy`. If this is the first invocation of this method during the
+ * lifetime of the AuthMgr FE, the AuthMgr BE stores the DICE policy in the secure storage as
+ * part of the pVM instance's context, upon successful matching of DICE chain to the policy.
+ * The file path for the storage of the pVM context is constructed using the instance
+ * identifier. Note that the creation of a pVM instance's context in the secure storage is
+ * allowed only during the factory, for the first version of this API. In the future, we expect
+ * to allow the creation of a pVM instance's context in the secure storage even after the device
+ * leaves the factory, based on hard-coded DICE policies and/or via a separate
+ * `IAuthMgrInstanceContextMaintenance` API.
+ *
+ * In the subsequent invocations of this method, the AuthMgr BE matches the given DICE chain
+ * to the stored DICE policy in order to enforce rollback protection. If that succeeds and if
+ * the given DICE poliy is different from the stored DICE policy, the AuthMgr BE replaces the
+ * stored DICE policy with the given DICE policy.
+ *
+ * Upon successful execution of this method, the AuthMgr BE should store some state associated
+ * with the connection, in order to distinguish authenicated connections from any
+ * non-authenticated connections. The state associated with the connection may cache certain
+ * artifacts such as instance identifier, instance sequence number, transport ID, DICE chain
+ * and DICE policy of the AuthMgr FE, so that they can be reused when serving phase 2 requests.
+ * The requests for phase 2 of the authorization protocol are allowed only on authenticated
+ * connections.
+ *
+ * @param signedConnectionRequest - signature from AuthMgr FE (CBOR encoded according to
+ * SignedConnectionRequest.cddl)
+ *
+ * @param dicePolicy - DICE policy of the AuthMgr FE
+ *
+ * @throws ServiceSpecificException:
+ * Error::AUTHENTICATION_NOT_STARTED - when the authentication process has not been
+ * started for the pVM instance.
+ * Error::INSTANCE_ALREADY_AUTHENTICATED - when a pVM instance with the same
+ * `instanceIdentifier` or the same transport id has already been authenticated.
+ * Error::SIGNATURE_VERIFICATION_FAILED - when the signature verification fails.
+ * Error::INVALID_DICE_CERT_CHAIN - when the DICE certificate chain validation fails.
+ * Error::DICE_POLICY_MATCHING_FAILED - when the DICE certificate chain to DICE policy
+ * matching fails for the pVM instance.
+ * Error::INSTANCE_CONTEXT_CREATION_DENIED - when the creation of the pVM instances's
+ * context in the AuthMgr BE is not allowed.
+ * Error::INSTANCE_PENDING_DELETION - when a pVM that is being deleted is trying to
+ * authenticate.
+ *
+ */
+ void completeAuthentication(
+ in SignedConnectionRequest signedConnectionRequest, in DicePolicy dicePolicy);
+
+ /**
+ * When the AuthMgr FE receives a request from a client to access a trusted service, the
+ * AuthMgr FE first creates a new (out-of-band) connection with the AuthMgr BE and sends a
+ * one-time cryptographic token of 32 bytes over that new connection.
+ *
+ * The AuthMgr FE then invokes this method on the authenticated connection established with the
+ * AuthMgr BE in phase 1. When this method is invoked, the AuthMgr BE checks whether the
+ * underlying connection of this method call is already authenticated.
+ *
+ * The AuthMgr FE acts as the DICE manager for all the clients in the pVM and generates the DICE
+ * leaf certificate and the DICE leaf policy for the client, which are sent in the input:
+ * `clientDiceArtifacts`.
+ *
+ * The AuthMgr BE matches the client's DICE leaf certificate to the client's DICE policy.
+ * If this is the first invocation of this method in the lifetime of the client, the AuthMgr BE
+ * stores the client's DICE policy in the secure storage as part of the client's context, upon
+ * successful matching of the DICE certificate to the policy. The file path for the storage of
+ * the client's context should be constructed using the unique id assigned to the pVM instance
+ * by the AuthMgr BE (e.g. instance sequence number) and the client ID. There is no use
+ * case for deleting a client context or a pVM context created in the secure storage, for the
+ * first version of this API, outside of the factory reset. In the future, we expect to
+ * expose APIs for those tasks.
+ *
+ * In the subsequent invocations of this method, the AuthMgr BE matches the given DICE leaf
+ * certificate to the stored DICE policy in order to enforce rollback protection. If that
+ * succeeds and if the given DICE policy is different from the stored DICE policy, the AuthMgr
+ * BE replaces the stored DICE policy with the given DICE policy.
+ *
+ * If the same client requests multiple trusted services or connects to the same trusted service
+ * multiple times during the same boot cycle of the pVM instance, it is recommended to validate
+ * the client's DICE artifacts only once for a given client as an optimization.
+ *
+ * The AuthMgr BE keeps track of the aforementioned new connections that are pending
+ * authorization along with the tokens sent over them and the transport ID of the pVM instance
+ * which created those connections.
+ *
+ * The AuthMgr FE sends the same token that was sent over an aforementioned new connection
+ * in the input: `token` of this method call, in order to authorize the new connection, based on
+ * the trust in the authenticated connection established in phase 1.
+ *
+ * Once the validation of the client's DICE artifacts is completed, the AuthMgr BE retrieves the
+ * pending new connection to be authorized, which is associated with a token that matches the
+ * token sent in this method call and a transport ID that matches the transport ID associated
+ * with the connection underlying this method call.
+ *
+ * Next the AuthMgr BE connects to the trusted service requested by the client in order to
+ * handover the new authorized connection to the trusted service. Once the connection
+ * handover is successful, the AuthMgr BE returns OK to the AuthMgr FE. Then the AuthMgr FE
+ * returns to the client a handle to the new connection (created at the beginning of phase 2).
+ * At this point, an authorized connection is setup between the client and the trusted service,
+ * which they can use to communicate independently of the AuthMgr FE and the AuthMgr BE.
+ *
+ * @param clientID - the identifier of the client in the pVM instance, which is unique in the
+ * context of the pVM instance
+ *
+ * @param service name - the name of the trusted service requested by the client
+ *
+ * @param token - the one-time token used to authorize the new connection created between the
+ * AuthMgr FE and the AuthMgr BE
+ *
+ * @param clientDiceArtifacts - DICE leaf certificate and the DICE leaf policy of the client
+ *
+ * @throws ServiceSpecificException:
+ * Error::CONNECTION_NOT_AUTHENTICATED - when the underlying connection of this method
+ * call is not authenticated.
+ * Error::DICE_POLICY_MATCHING_FAILED - when the DICE certificate chain to DICE policy
+ * matching fails for the client.
+ * Error::NO_CONNECTION_TO_AUTHORIZE - when there is no pending new connection that
+ * is associated with a token and a transport ID that matches those of this
+ * method call.
+ * Error::CONNECTION_HANDOVER_FAILED - when the hanover of the authorized connection to
+ * the trusted service fails.
+ * Error::CLIENT_PENDING_DELETION - when a client that is being deleted is trying to be
+ * authorized.
+ */
+ void authorizeAndConnectClientToTrustedService(in byte[] clientID, String serviceName,
+ in byte[32] token, in DiceLeafArtifacts clientDiceArtifacts);
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
new file mode 100644
index 0000000..f258603
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.security.see.authmgr;
+
+/**
+ * The response from the AuthMgr FE which includes the challenge sent by the AuthMgr BE and other
+ * information signed by the AuthMgr FE's signing key.
+ */
+
+@VintfStability
+@RustDerive(Clone=true, Eq=true, PartialEq=true)
+parcelable SignedConnectionRequest {
+ /* Data is CBOR encoded according the CDDL in ./SignedConnectionRequest.cddl */
+ byte[] signedConnectionRequest;
+}
diff --git a/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.cddl b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.cddl
new file mode 100644
index 0000000..a74ccd7
--- /dev/null
+++ b/security/see/authmgr/aidl/android/hardware/security/see/authmgr/SignedConnectionRequest.cddl
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+SignedConnectionRequestProtected = {
+ 1 : AlgorithmEdDSA / AlgorithmES256,
+}
+
+SignedConnectionRequest = [ ; COSE_Sign1 (untagged) [RFC9052 s4.2]
+ protected: bstr .cbor SignedConnectionRequesProtected,
+ unprotected: {},
+ payload: bstr .cbor ConnectionRequest,
+ signature: bstr ; PureEd25519(privateKey, SignedResponseSigStruct) /
+ ; ECDSA(privateKey, SignedResponseSigStruct)
+]
+
+ConnectionRequestSigStruct = [ ; Sig_structure for SignedConnectionRequest [ RFC9052 s4.4]
+ context: "Signature1",
+ body_protected: bstr .cbor SignedConnectionRequesProtected,
+ external_aad: bstr .cbor ExternalAADForDICESignedConnectionRequest,
+ payload: bstr .cbor ConnectionRequest,
+]
+
+; The payload structure signed by the DICE signing key
+ConnectionRequest [
+ challenge: bstr .size 32,
+ transport_type: TransportType, ; this indicates what CBOR structure should be exected for the
+ ; next element (i.e. transport_id_info)
+ transport_id_info: TransportIdInfo, ; this information is used to detect person-in-the-middle
+ ; attacks
+]
+
+; The unique id assigned to the `ConnectionRequest` payload structure
+ConnectionRequestUuid = h'34c82916 9579 4d86 baef 592a066419e4' ; bstr .size 16 (UUID v4 - RFC 9562)
+
+; An integer that identifies the type of the transport used for communication between clients and
+; trusted services
+TransportType = &(
+ FFA: 1,
+ ; Any other transport type(s) also be defined here
+)
+
+; Identity information of the peers provided by the transport layer
+TransportIdInfo = &(
+ FFATransportId,
+ ; Any other type(s) containing transport layer identity information should also be defiend here
+)
+
+; Transport ids (a.k.a VM IDs) provided by the FFA transport
+FFATransportId = [
+ feID: uint .size 2, ; FF-A partition ID of the AuthMgr FE
+ beID: uint .size 2, ; FF-A partition ID of the AuthMgr BE
+]
+
+; External AAD to be added to any Sig_structure signed by the DICE signing key, with the mandatory
+; field of `uuid_of_payload_struct` of type UUID v4 (RFC 9562). This field is required to ensure
+; that both the signer and the verifier refer to the same payload structure, given that there are
+; various payload structures signed by the DICE signing key in different protocols in Android.
+ExternalAADForDICESigned = [
+ uuid_of_payload_struct: buuid,
+]
+
+; RFC8610 - Section 3.6
+buuid = #6.37(bstr .size 16)
+
+ExternalAADForDICESignedConnectionRequest = [ ; ExternalAADForDICESigned for ConnectionRequest
+ uuid_of_payload_struct: #6.37(ConnectionRequestUuid),
+]
+
+AlgorithmES256 = -7 ; [RFC9053 s2.1]
+AlgorithmEdDSA = -8 ; [RFC9053 s2.2]
diff --git a/security/see/authmgr/aidl/vts/Android.bp b/security/see/authmgr/aidl/vts/Android.bp
new file mode 100644
index 0000000..3d6fce2
--- /dev/null
+++ b/security/see/authmgr/aidl/vts/Android.bp
@@ -0,0 +1,36 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ // 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: ["Android-Apache-2.0"],
+ default_team: "trendy_team_trusty",
+}
+
+rust_test {
+ name: "VtsAidlAuthMgrNonExistentTest",
+ srcs: ["test.rs"],
+ require_root: true,
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+ rustlibs: [
+ "libbinder_rs",
+ ],
+}
diff --git a/security/see/authmgr/aidl/vts/test.rs b/security/see/authmgr/aidl/vts/test.rs
new file mode 100644
index 0000000..45533a7
--- /dev/null
+++ b/security/see/authmgr/aidl/vts/test.rs
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//! Test for asserting the non-existence of an IAuthMgrAuthorization.aidl
+
+#![cfg(test)]
+
+use binder;
+
+const AUTHMGR_INTERFACE_NAME: &str = "android.hardware.security.see.authmgr.IAuthMgrAuthorization";
+
+#[test]
+fn test_authmgr_non_existence() {
+ let authmgr_instances = match binder::get_declared_instances(AUTHMGR_INTERFACE_NAME) {
+ Ok(vec) => vec,
+ Err(e) => {
+ panic!("failed to retrieve the declared interfaces for AuthMgr: {:?}", e);
+ }
+ };
+ assert!(authmgr_instances.is_empty());
+}
diff --git a/staging/security/see/hwcrypto/aidl/Android.bp b/security/see/hwcrypto/aidl/Android.bp
similarity index 77%
rename from staging/security/see/hwcrypto/aidl/Android.bp
rename to security/see/hwcrypto/aidl/Android.bp
index 2da59a4..e15f494 100644
--- a/staging/security/see/hwcrypto/aidl/Android.bp
+++ b/security/see/hwcrypto/aidl/Android.bp
@@ -8,10 +8,8 @@
}
aidl_interface {
- name: "android.hardware.security.see",
- unstable: false,
- // TODO Remove this owner field when this interface is moved out of /staging
- owner: "google_while_staging",
+ name: "android.hardware.security.see.hwcrypto",
+ stability: "vintf",
host_supported: true,
srcs: [
"android/hardware/security/see/hwcrypto/*.aidl",
@@ -22,11 +20,15 @@
enabled: false,
},
cpp: {
- enabled: false,
+ enabled: true,
},
rust: {
enabled: true,
},
+ ndk: {
+ enabled: true,
+ },
},
frozen: false,
+ system_ext_specific: true,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
index 0a7e7a2..fd2904b 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
union CryptoOperation {
android.hardware.security.see.hwcrypto.MemoryBufferParameter setMemoryBuffer;
android.hardware.security.see.hwcrypto.OperationParameters setOperationParameters;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
index 05780e1..66bed55 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable CryptoOperationErrorAdditionalInfo {
long failingCommandIndex;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
index 1088e27..7996b9a 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable CryptoOperationResult {
@nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
index f3b9b43..75bb0dc 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable CryptoOperationSet {
@nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
android.hardware.security.see.hwcrypto.CryptoOperation[] operations;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
index 472215f..7646656 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -32,5 +32,6 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
interface ICryptoOperationContext {
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
similarity index 99%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
index 5b34572..b31a06c 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
interface IHwCryptoKey {
android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey);
android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundKeyResult deriveDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
@@ -43,7 +44,6 @@
android.hardware.security.see.hwcrypto.IOpaqueKey getKeyslotData(android.hardware.security.see.hwcrypto.IHwCryptoKey.KeySlot slotId);
enum DeviceKeyId {
DEVICE_BOUND_KEY,
- BATCH_KEY,
}
enum KeySlot {
KEYMINT_SHARED_HMAC_KEY,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
index 5c26cc2..7c87dd3 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
interface IHwCryptoOperations {
android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
index 88dbdf1..1121f01 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
interface IOpaqueKey {
byte[] exportWrappedKey(in android.hardware.security.see.hwcrypto.IOpaqueKey wrappingKey);
android.hardware.security.see.hwcrypto.KeyPolicy getKeyPolicy();
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
index 0e3896e..ca114c3 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable KeyPolicy {
android.hardware.security.see.hwcrypto.types.KeyUse usage;
android.hardware.security.see.hwcrypto.types.KeyLifetime keyLifetime = android.hardware.security.see.hwcrypto.types.KeyLifetime.EPHEMERAL;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
index d88d5c8..1c49297 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable MemoryBufferParameter {
android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
int sizeBytes;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
index e069610..d6f57ab 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
union OperationParameters {
android.hardware.security.see.hwcrypto.types.SymmetricAuthOperationParameters symmetricAuthCrypto;
android.hardware.security.see.hwcrypto.types.SymmetricOperationParameters symmetricCrypto;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
index 0fd1ee7..7b9924e 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto;
+@VintfStability
parcelable PatternParameters {
long numberBlocksProcess;
long numberBlocksCopy;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
index e7501ff..6ad2c09 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union AesCipherMode {
android.hardware.security.see.hwcrypto.types.CipherModeParameters cbc;
android.hardware.security.see.hwcrypto.types.CipherModeParameters ctr;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
index 4084abb..68ad142 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union AesGcmMode {
android.hardware.security.see.hwcrypto.types.AesGcmMode.AesGcmModeParameters gcmTag16;
parcelable AesGcmModeParameters {
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl
index f4bf786..78b1ff8 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/AesKey.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union AesKey {
byte[16] aes128 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte[32] aes256;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
index 7a77521..83713ff 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable CipherModeParameters {
byte[16] nonce;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
index 9970678..45cb234 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union ExplicitKeyMaterial {
android.hardware.security.see.hwcrypto.types.AesKey aes;
android.hardware.security.see.hwcrypto.types.HmacKey hmac;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
index 742314c..969e9c8 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable HalErrorCode {
const int NO_ERROR = 0;
const int GENERIC_ERROR = (-1) /* -1 */;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
index f8de94a..4d4e65d 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union HmacKey {
byte[32] sha256 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
byte[64] sha512;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
index 532cd8d..33a518d 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable HmacOperationParameters {
android.hardware.security.see.hwcrypto.IOpaqueKey key;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
similarity index 97%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
index db5964c..ddee337 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
-@Backing(type="byte")
+@Backing(type="byte") @VintfStability
enum KeyLifetime {
EPHEMERAL,
HARDWARE,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
index ea3a173..919be32 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
enum KeyPermissions {
ALLOW_EPHEMERAL_KEY_WRAPPING,
ALLOW_HARDWARE_KEY_WRAPPING,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
index 59b83c4..07a7ce4 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
enum KeyType {
AES_128_CBC_NO_PADDING,
AES_128_CBC_PKCS7_PADDING,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
similarity index 97%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
index e888bdf..b607fd5 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
-@Backing(type="int")
+@Backing(type="int") @VintfStability
enum KeyUse {
ENCRYPT = 1,
DECRYPT = 2,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
similarity index 96%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
index 59c8757..184e21f 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
-@RustDerive(Clone=true, Copy=true)
+@RustDerive(Clone=true, Copy=true) @VintfStability
parcelable MemoryBufferReference {
int startOffset;
int sizeBytes;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
index fc2dd63..6dfefcb 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable OpaqueKeyToken {
byte[] keyToken;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
index aad3ac1..858ef1c 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union OperationData {
android.hardware.security.see.hwcrypto.types.MemoryBufferReference memoryBufferReference;
byte[] dataBuffer;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
index ca8b3eb..03c2bba 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
enum OperationType {
READ,
WRITE,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
index 1e304ab..cb963ee 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
enum ProtectionId {
WIDEVINE_OUTPUT_BUFFER = 1,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
index d3d1763..e42190e 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union SymmetricAuthCryptoParameters {
android.hardware.security.see.hwcrypto.types.AesGcmMode aes;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
index 8a8ef09..78c4a4f 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable SymmetricAuthOperationParameters {
android.hardware.security.see.hwcrypto.IOpaqueKey key;
android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
index cc93094..8fd5e85 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
union SymmetricCryptoParameters {
android.hardware.security.see.hwcrypto.types.AesCipherMode aes;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
index 1a17525..40fd2d5 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
enum SymmetricOperation {
ENCRYPT,
DECRYPT,
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
index 769833b..7007074 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable SymmetricOperationParameters {
android.hardware.security.see.hwcrypto.IOpaqueKey key;
android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/Void.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
rename to security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/Void.aidl
index b37848b..80c91ee 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
+++ b/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see.hwcrypto/current/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -32,5 +32,6 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.security.see.hwcrypto.types;
+@VintfStability
parcelable Void {
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
similarity index 99%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
index 2fdbc78..0859d2a 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -25,6 +25,7 @@
* Type that describes the different operations that can be performed along with its required
* parameters. It will be used to construct a vector of operation that are executed sequentially.
*/
+@VintfStability
union CryptoOperation {
/*
* Sets a memory buffer to operate on. References to positions of this memory buffer can be used
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
index f3ac8ea..cc94b02 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -18,6 +18,7 @@
/*
* Type that provides more information about failures when processing a list of commands.
*/
+@VintfStability
parcelable CryptoOperationErrorAdditionalInfo {
/*
* Index indicating the first step of <code>CryptoOperationSet::operations</code> that failed
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
index 07c2983..5c3b81e 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -20,6 +20,7 @@
/*
* Type that describes the result of a set of crypto operations.
*/
+@VintfStability
parcelable CryptoOperationResult {
/*
* Token that can be passed on a CryptoOperationSet to issue more operations on the same context
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
index 9aff1e8..285ed36 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -21,6 +21,7 @@
/*
* Type that describes a set of crypto operations to execute
*/
+@VintfStability
parcelable CryptoOperationSet {
/*
* Token to be used to issue the operations. If NULL, a new context will be created and
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
index 68d0c03..8cfa735 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -22,4 +22,5 @@
* operation in progress context includes any memory buffer previously mapped by a
* <code>CryptoOperation::SetMemoryBuffer</code> call.
*/
+@VintfStability
interface ICryptoOperationContext {}
diff --git a/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
new file mode 100644
index 0000000..97a4c37
--- /dev/null
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,294 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.IHwCryptoOperations;
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+import android.hardware.security.see.hwcrypto.types.ExplicitKeyMaterial;
+import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
+
+/*
+ * Higher level interface to access and generate keys.
+ */
+@VintfStability
+interface IHwCryptoKey {
+ /*
+ * Identifier for the requested device provided key. The currently supported identifiers are:
+ *
+ */
+ enum DeviceKeyId {
+ /*
+ * This is a key unique to the device.
+ */
+ DEVICE_BOUND_KEY,
+ }
+
+ /*
+ * Identifier for the requested key slot. The currently supported identifiers are:
+ *
+ */
+ enum KeySlot {
+ /*
+ * This is the shared HMAC key that will now be computed by HwCryptoKey after participating
+ * in the ISharedSecret protocol that can be shared with KeyMint and authenticators. See
+ * ISharedSecret.aidl for more information.
+ */
+ KEYMINT_SHARED_HMAC_KEY,
+ }
+
+ union DiceBoundDerivationKey {
+ /*
+ * Opaque to be used to derive the DICE bound key.
+ */
+ IOpaqueKey opaqueKey;
+
+ /*
+ * Device provided key to be used to derive the DICE bound key.
+ */
+ DeviceKeyId keyId;
+ }
+
+ parcelable DiceCurrentBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Current dice policy which was used to generate the returned key. This policy is opaque
+ * from this service perspective (it will be sent to an Authentication Manager Service to be
+ * verified). It follows the structure defined on DicePolicy.cddl, located under
+ * hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/ with the
+ * caveat that it could be encrypted if the client does not have enough permissions to see
+ * the device dice policy information.
+ */
+ byte[] dicePolicyForKeyVersion;
+ }
+
+ parcelable DiceBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Indicates if the diceBoundKey returned was created using a current DICE policy. The
+ * caller can use this to detect if an old policy was provided and rotate its keys if so
+ * desired. Old, valid policies remain usable, but care needs to be taken to not continue to
+ * use a potentially compromised key.
+ */
+ boolean dicePolicyWasCurrent;
+ }
+
+ parcelable ClearKeyPolicy {
+ /*
+ * Indicates the desired key size. It will be used to calculate how many bytes of key
+ * material should be returned.
+ */
+ int keySizeBytes;
+ }
+
+ union DerivedKeyPolicy {
+ /*
+ * If used we will derive a clear key and pass it back as an array of bytes on
+ * <code>HwCryptoKeyMaterial::explicitKey</code>.
+ */
+ ClearKeyPolicy clearKey;
+
+ /*
+ * Policy for the newly derived opaque key. Defines how the key can be used and its type.
+ */
+ byte[] opaqueKey;
+ }
+
+ parcelable DerivedKeyParameters {
+ /*
+ * Key to be used to derive the new key using HKDF.
+ */
+ IOpaqueKey derivationKey;
+
+ /*
+ * Policy for the newly derived key. Depending on its type, either a clear or opaque key
+ * will be derived.
+ */
+ DerivedKeyPolicy keyPolicy;
+
+ /*
+ * An arbitrary set of bytes incorporated into the key derivation. May have an
+ * implementation-specific maximum length, but it is guaranteed to accept at least 32 bytes.
+ */
+ byte[] context;
+ }
+
+ union DerivedKey {
+ /*
+ * Derived key in clear format.
+ */
+ byte[] explicitKey = {};
+
+ /*
+ * Derived key as a key token to be used only through the HWCrypto service.
+ */
+ IOpaqueKey opaque;
+ }
+
+ /*
+ * Derives a versioned key tied to the caller's current DICE policy. It will return this current
+ * policy back to the caller along with the generated key.
+ *
+ * @param derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * @return:
+ * A DiceCurrentBoundKeyResult containint the versioned key tied the current client version
+ * on success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey);
+
+ /*
+ * Derive a versioned key by checking the provided DICE policy against the caller and then using
+ * it as a context for deriving the returned key.
+ *
+ * @param derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * @param dicePolicyForKeyVersion:
+ * Policy used to derive keys tied to specific versions. Using this parameter the caller can
+ * tie a derived key to a minimum version of itself, so in the future only itself or a more
+ * recent version can derive the same key. This parameter is opaque to the caller and it
+ * could be encrypted in the case the client doesn't have permission to know the dice chain.
+ * When implementing this function, this parameter shall be one of the components fed to the
+ * KDF context and it needs to be checked against the caller DICE certificate before being
+ * used.
+ *
+ * @return:
+ * A DiceBoundKeyResult containing the versioned key tied to the provided DICE policy on
+ * success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ DiceBoundKeyResult deriveDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
+
+ /*
+ * Derive a new key based on the given key, policy and context.
+ *
+ * @param parameters:
+ * Parameters used for the key derivation. See <code>DerivedKeyParameters</code> on this
+ * file for more information.
+ *
+ * @return:
+ * A HwCryptoKeyMaterial containing the derived key on success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ DerivedKey deriveKey(in DerivedKeyParameters parameters);
+
+ /*
+ * Returns an interface used to work on opaque keys. This interface can also be used to operate
+ * on any opaque key generated by hwkeyDeriveVersioned, even if this key has been generated
+ * after retrieving a IHwCryptoOperations binder object, as long as the parent
+ * IHwCryptoDeviceKeyAccess is not dropped between retrieving the IHwCryptoOperations binder
+ * object and deriving the key. IHwCryptoOperations can also be used to create opaque keys that
+ * are not bound to the device.
+ *
+ * @return:
+ * IHwCryptoOperations on success
+ */
+ IHwCryptoOperations getHwCryptoOperations();
+
+ /*
+ * Imports a SW clear key into the secure environment.
+ *
+ * @param keyMaterial:
+ * key to be imported.
+ *
+ * @param newKeyPolicy:
+ * Policy of the new key. Defines how the newly created key can be used. Because any clear
+ * key imported into the system is considered to have a <code>KeyLifetime::PORTABLE</code>
+ * lifetime, a call to this function will return an error if
+ * <code>newKeyPolicy.newKeyPolicy</code> is not set to portable.
+ *
+ * @return:
+ * IOpaqueKey on success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ IOpaqueKey importClearKey(in ExplicitKeyMaterial keyMaterial, in KeyPolicy newKeyPolicy);
+
+ /*
+ * Returns the client current DICE policy. This policy is encrypted and considered opaque from
+ * the client perspective. This policy is the same used to create DICE bound keys and will also
+ * be used to seal secrets that can only be retrieved by the DICE policy owner. The first use of
+ * this seal operation will be <code>IOpaqueKey::getShareableToken</code> and will call this
+ * <code>IHwCryptoKey::keyTokenImport</code>. To start this process, the intended key receiver
+ * function and then pass the generated DICE policy to the owner of the key that the receiver
+ * wants to import. The key owner will then call <code>IOpaqueKey::getShareableToken</code>
+ * passing the receiver DICE policy to insure that only that receiver can import the key.
+ *
+ * @return:
+ * byte[] on success, which is the caller encrypted DICE policy.
+ */
+ byte[] getCurrentDicePolicy();
+
+ /*
+ * Imports a key from a different client service instance. Because IOpaqueKey are binder objects
+ * that cannot be directly shared between binder rpc clients, this method provide a way to send
+ * a key to another client. Keys to be imported by the receiver are represented by a token
+ * created using <code>IOpaqueKey::getShareableToken</code>. The flow to create this token is
+ * described in <code>IHwCryptoKey::getCurrentDicePolicy</code>.
+ *
+ * @param requested_key:
+ * Handle to the key to be imported to the caller service.
+ *
+ * @param sealingDicePolicy:
+ * DICE policy used to seal the exported key.
+ *
+ * @return:
+ * An IOpaqueKey that can be directly be used on the local HWCrypto service on success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ IOpaqueKey keyTokenImport(in OpaqueKeyToken requestedKey, in byte[] sealingDicePolicy);
+
+ /*
+ * Gets the keyslot key material referenced by slotId. This interface is used to access device
+ * specific keys with known types and uses. Because the returned key is opaque, it can only be
+ * used through the different HwCrypto interfaces. Because the keys live in a global namespace
+ * the identity of the caller needs to be checked to verify that it has permission to access the
+ * requested key.
+ *
+ * @param slotId:
+ * Identifier for the requested keyslot
+ *
+ * @return:
+ * An IOpaqueKey corresponding to the requested key slot on success.
+ *
+ * @throws:
+ * ServiceSpecificException <code>UNAUTHORIZED</code> if the caller cannot access the
+ * requested key, another specific error based on <code>HalErrorCode</code> otherwise.
+ */
+ IOpaqueKey getKeyslotData(KeySlot slotId);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
similarity index 84%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
index 4d394ed..9df6d67 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -24,20 +24,25 @@
* cryptographic keys. Interactions with this interface are done through a command-base API,
* which allow callers to execute a large set of operations on a single call.
*/
+@VintfStability
interface IHwCryptoOperations {
/*
- * processCommandList() - Executes a list of cryptographic commands in order
+ * Executes a list of cryptographic commands in order
*
- * @operations:
+ * @param operations:
* Parameter containing 1 or more set of commands to execute. Additionally, each set can
* also contain a context on which the commands will be executed.
- * @additionalErrorInfo:
+ *
+ * @param additionalErrorInfo:
* Structure containing additional info when errors are encountered. Only valid if the
* function failed its execution.
- * Return:
+ *
+ * @return:
* CryptoOperationResult[] on success, which can contain a context to continue executing
- * each of the provided operations sets, service specific error based on
- * <code>HalErrorCode</code> otherwise.
+ * each of the provided operations sets.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
*/
CryptoOperationResult[] processCommandList(inout CryptoOperationSet[] operations,
out CryptoOperationErrorAdditionalInfo additionalErrorInfo);
diff --git a/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
new file mode 100644
index 0000000..318a27e
--- /dev/null
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
+import android.hardware.security.see.hwcrypto.types.OperationType;
+import android.hardware.security.see.hwcrypto.types.ProtectionId;
+
+@VintfStability
+interface IOpaqueKey {
+ /*
+ * Exports this key as a wrapped (encrypted) blob.
+ *
+ * @param wrapping_key:
+ * wrapping key. It needs to be an opaque key and its policy needs to indicate that it can
+ * be used for key wrapping.
+ *
+ * @return:
+ * Wrapped key blob as a byte array on success. Format of the blob is opaque to the service
+ * but has to match the command accepted by
+ * <code>IHwCryptoKeyGeneration::importWrappedKey</code>
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ byte[] exportWrappedKey(in IOpaqueKey wrappingKey);
+
+ /*
+ * Returns the key policy.
+ *
+ * @return:
+ * A <code>KeyPolicy</code> on success
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ KeyPolicy getKeyPolicy();
+
+ /*
+ * Returns the public key portion of this OpaqueKey. This operation is only valid for asymmetric
+ * keys.
+ *
+ * @return:
+ * public key as a byte array on success. Format used for the returned public key is COSE.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ byte[] getPublicKey();
+
+ /*
+ * Returns a token that can shared with another HWCrypto client.
+ *
+ * @param sealingDicePolicy:
+ * Token to be used to protect the returned OpaqueKeyToken. It will be used so only
+ * the owner of the sealingDicePolicy can import the key.
+ *
+ * @return:
+ * <code>OpaqueKeyMaterial</code> token on success.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ OpaqueKeyToken getShareableToken(in byte[] sealingDicePolicy);
+
+ /*
+ * Sets the protectionID associated with the buffers where the operation will be performed. A
+ * protection ID serves as a limitation on the key so it can only operate on buffers with a
+ * matching protection ID. The client calling this functions needs to have the necessary
+ * permissions to read and/or write to this buffer. Setting this parameter means that if the key
+ * is shared with a different client, the client receiving the key will be limited in which
+ * buffers can be used to read/write data for this operation.
+ *
+ * @param protectionId:
+ * ID of the given use case to provide protection for. The method of protecting the buffer
+ * will be platform dependent.
+ *
+ * @param allowedOperations:
+ * array of allowed operations. Allowed operations are either READ or WRITE.
+ *
+ * @throws:
+ * ServiceSpecificException based on <code>HalErrorCode</code> if any error occurs.
+ */
+ void setProtectionId(in ProtectionId protectionId, in OperationType[] allowedOperations);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
index 9266bfa..a20e99b 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -23,6 +23,7 @@
/*
* Parcelable that specified how a key can be used.
*/
+@VintfStability
parcelable KeyPolicy {
/*
* Enum specifying the operations the key can perform (encryption, decryption, etc.).
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.cddl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.cddl
similarity index 100%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.cddl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.cddl
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
index c5a6a5c..efc5767 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -18,6 +18,7 @@
/*
* Parcelable representing a memory buffer.
*/
+@VintfStability
parcelable MemoryBufferParameter {
union MemoryBuffer {
ParcelFileDescriptor input;
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
index a977f56..bf0b720 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -22,6 +22,7 @@
/*
* Type that describes the parameters for the different operations that can be performed.
*/
+@VintfStability
union OperationParameters {
/*
* Parameters for authenticated symmetric cryptography (AES GCM).
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
index 3f62abe..9f8950f 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -18,6 +18,7 @@
/*
* Parcelable that specifies a pattern to process data.
*/
+@VintfStability
parcelable PatternParameters {
/*
* Number of blocks that will be processed. The size of the block matches the size of the
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
index ac31557..8ce83aa 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -21,6 +21,7 @@
/*
* Type used for the parameters needed to run a non-authenticated AES operation.
*/
+@VintfStability
union AesCipherMode {
/*
* Cipher Block Chaining mode. Padding will either be none or PKCS#7 depending on the key policy
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
index 4025553..1c6551c 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -18,6 +18,7 @@
/*
* Type used for the parameters needed to run an authenticated AES operation (GCM).
*/
+@VintfStability
union AesGcmMode {
parcelable AesGcmModeParameters {
/*
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl
index cf9082d..ae62ef9 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesKey.aidl
@@ -18,6 +18,7 @@
/*
* Type that represents an AES key.
*/
+@VintfStability
union AesKey {
/*
* Raw AES 128 bit key material.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
similarity index 88%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
index bfa5daa..e7ede57 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -19,6 +19,10 @@
/*
* Type encapsulating nonce used on non-authenticated AES symmetric encryption.
*/
+@VintfStability
parcelable CipherModeParameters {
+ /*
+ * nonce to be used as IV for AES-CBC or as the nonce in AES-CTR
+ */
byte[16] nonce;
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
similarity index 88%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
index 3aa5611..a5bf594 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ExplicitKeyMaterial.aidl
@@ -21,7 +21,15 @@
/*
* Type encapsulating a clear key.
*/
+@VintfStability
union ExplicitKeyMaterial {
+ /*
+ * AES key in clear format.
+ */
AesKey aes;
+
+ /*
+ * HMAC key in clear format.
+ */
HmacKey hmac;
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
index f536c0e..df12262 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -18,6 +18,7 @@
/*
* Service error codes. Will be returned as service specific errors.
*/
+@VintfStability
parcelable HalErrorCode {
/* Success */
const int NO_ERROR = 0;
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
index a0b6ba7..b1a988e 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacKey.aidl
@@ -18,6 +18,7 @@
/*
* Type that represents an Hmac key.
*/
+@VintfStability
union HmacKey {
/*
* Raw Hmac key for use with sha256.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
similarity index 97%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
index da09a2c..faa3072 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HmacOperationParameters.aidl
@@ -19,6 +19,7 @@
/*
* Data needed to perform HMAC operations.
*/
+@VintfStability
parcelable HmacOperationParameters {
/*
* Key to be used for the HMAC operation.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
index 9958a0b..b03b850 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -20,6 +20,7 @@
* represented as a bitmask to allow us to internally combine them on a single property to describe
* a set of allowed lifetimes.
*/
+@VintfStability
@Backing(type="byte")
enum KeyLifetime {
/*
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
index a1e4f21..c48ef8b 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -18,6 +18,7 @@
/*
* Additional characteristics and permissions of the key.
*/
+@VintfStability
enum KeyPermissions {
/*
* Key can be wrapped by an ephemeral key.
diff --git a/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
new file mode 100644
index 0000000..ed90899
--- /dev/null
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Enum describing all supported key types. Key types are strongly bound to the algorithm to
+ * prevent reusing the same key on different algorithms (e.g. using the same key for 2 different AES
+ * 128 Cipher modes).
+ */
+@VintfStability
+enum KeyType {
+ /*
+ * AES with key size 128 bits using CBC mode of operation and no padding.
+ */
+ AES_128_CBC_NO_PADDING,
+
+ /*
+ * AES with key size 128 bits using CBC mode of operation and PKCS7 padding.
+ */
+ AES_128_CBC_PKCS7_PADDING,
+
+ /*
+ * AES with key size 128 bits using counter mode.
+ */
+ AES_128_CTR,
+
+ /*
+ * AES with key size 128 bits using GCM mode for authenticated encryption.
+ */
+ AES_128_GCM,
+
+ /*
+ * AES with key size 128 bits for CMAC calculation.
+ */
+ AES_128_CMAC,
+
+ /*
+ * AES with key size 256 bits using CBC mode of operation and no padding.
+ */
+ AES_256_CBC_NO_PADDING,
+
+ /*
+ * AES with key size 256 bits using CBC mode of operation and PKCS7 padding.
+ */
+ AES_256_CBC_PKCS7_PADDING,
+
+ /*
+ * AES with key size 128 bits using counter mode.
+ */
+ AES_256_CTR,
+
+ /*
+ * AES with key size 128 bits using GCM mode for authenticated encryption.
+ */
+ AES_256_GCM,
+
+ /*
+ * AES with key size 128 bits for CMAC calculation.
+ */
+ AES_256_CMAC,
+
+ /*
+ * Key of length of 32 bytes for HMAC operations using SHA256.
+ */
+ HMAC_SHA256,
+
+ /*
+ * Key of length of 64 bytes for HMAC operations using SHA512.
+ */
+ HMAC_SHA512,
+
+ /*
+ * RSA of key size of 2048 bits for signing using PSS.
+ */
+ RSA2048_PSS_SHA256,
+
+ /*
+ * RSA of key size of 2048 bits for signing with padding PKCS 1.5 and SHA256 as the digest
+ * algorithm.
+ */
+ RSA2048_PKCS1_5_SHA256,
+
+ /*
+ * ECC key for signing using curve P-256 and no padding.
+ */
+ ECC_NIST_P256_SIGN_NO_PADDING,
+
+ /*
+ * ECC key for signing using curve P-256 and SHA256 as hashing algorithm.
+ */
+ ECC_NIST_P256_SIGN_SHA256,
+
+ /*
+ * ECC key for signing using curve P-521 and no padding.
+ */
+ ECC_NIST_P521_SIGN_NO_PADDING,
+
+ /*
+ * ECC key for signing using curve P-512 and SHA512 as hashing algorithm.
+ */
+ ECC_NIST_P521_SIGN_SHA512,
+
+ /*
+ * ECC key for signing using EdDSA.
+ */
+ ECC_ED25519_SIGN,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
similarity index 77%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
index 76bfd62..60bfd06 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -18,12 +18,24 @@
/*
* Enum describing the allowed operations that can be performed with the given key.
*/
+@VintfStability
@Backing(type="int")
enum KeyUse {
+ /* Key can be used to encrypt */
ENCRYPT = 1,
+
+ /* Key can be used to decrypt */
DECRYPT = 2,
+
+ /* Key can be used to encrypt or decrypt */
ENCRYPT_DECRYPT = ENCRYPT | DECRYPT,
+
+ /* Key can be used to sign */
SIGN = 4,
+
+ /* Key can be used to derive other keys */
DERIVE = 8,
+
+ /* Key can be used to wrap other keys */
WRAP = 16,
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
index 1175dc5..0f3c099 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -18,6 +18,7 @@
/*
* Structure representing a section of a memory buffer.
*/
+@VintfStability
@RustDerive(Copy=true, Clone=true)
parcelable MemoryBufferReference {
/*
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
index db95c18..25cc6fb 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OpaqueKeyToken.aidl
@@ -20,6 +20,7 @@
* valid on the current boot, and its reuse after a session is closed (or between sessions) is not
* guaranteed.
*/
+@VintfStability
parcelable OpaqueKeyToken {
/*
* Opaque type used to send IOpaqueKeys keys to different clients. Its format is implementation
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
index 642d05e..8dfca72 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -20,6 +20,7 @@
/*
* Union holding buffers to be used by the cryptographic operation.
*/
+@VintfStability
union OperationData {
/*
* Reference (offset, size) to the active operations' MemoryBuffer.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
similarity index 90%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
index 76878a3..2dc9ae9 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -18,7 +18,11 @@
/*
* Enum describing the different types of operations allowed on a buffer.
*/
+@VintfStability
enum OperationType {
+ /* Read operations allowed*/
READ,
+
+ /* Write operations allowed*/
WRITE,
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
index 8686882..8fd0551 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
@@ -19,6 +19,7 @@
* Enum describing the different types of protected buffers. Protected buffers are named by its
* corresponding use case and its underlaying implementation is platform dependant.
*/
+@VintfStability
enum ProtectionId {
/*
* ProtectionID used by HwCrypto to enable Keys that can be used for Widevine video buffers.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
index 278e48d..79c39f9 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -20,6 +20,7 @@
/*
* Data needed to perform authenticated symmetric cryptographic operations.
*/
+@VintfStability
union SymmetricAuthCryptoParameters {
/*
* AES (Advanced Encryption Standard) GCM parameters.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
index 46568c3..844a3bc 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -23,6 +23,7 @@
* Parameters needed to perform an authenticated symmetric cryptographic operation. Currently only
* AES-GCM is supported.
*/
+@VintfStability
parcelable SymmetricAuthOperationParameters {
/*
* Key to be used on the operation.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
index 2350242..679fe6a 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -20,6 +20,7 @@
/*
* Data needed to perform non-authenticated symmetric cryptographic operations.
*/
+@VintfStability
union SymmetricCryptoParameters {
/*
* AES (Advanced Encryption Standard) parameters.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
similarity index 92%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
index 2717472..d88d4e9 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -18,4 +18,4 @@
/*
* Enum describing the type of symmetric operation desired.
*/
-enum SymmetricOperation { ENCRYPT, DECRYPT }
+@VintfStability enum SymmetricOperation { ENCRYPT, DECRYPT }
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
similarity index 98%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
index 1d1554d..509d416 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -22,6 +22,7 @@
/*
* Parameters needed to perform a non-authenticated symmetric cryptographic operation.
*/
+@VintfStability
parcelable SymmetricOperationParameters {
/*
* Key to be used on the operation.
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
similarity index 92%
rename from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
rename to security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
index f9f608d..243fb45 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -15,4 +15,8 @@
*/
package android.hardware.security.see.hwcrypto.types;
+/*
+ * Type used to represent no data.
+ */
+@VintfStability
parcelable Void {}
diff --git a/staging/security/see/storage/aidl/Android.bp b/security/see/storage/aidl/Android.bp
similarity index 91%
rename from staging/security/see/storage/aidl/Android.bp
rename to security/see/storage/aidl/Android.bp
index f669be8..279cb90 100644
--- a/staging/security/see/storage/aidl/Android.bp
+++ b/security/see/storage/aidl/Android.bp
@@ -4,7 +4,7 @@
aidl_interface {
name: "android.hardware.security.see.storage",
- unstable: true,
+ stability: "vintf",
host_supported: true,
srcs: [
"android/hardware/security/see/storage/*.aidl",
@@ -23,4 +23,5 @@
enabled: true,
},
},
+ frozen: false,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Availability.aidl
similarity index 92%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Availability.aidl
index 1e304ab..62af569 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Availability.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.storage;
+@VintfStability
+enum Availability {
+ BEFORE_USERDATA,
+ AFTER_USERDATA,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/CreationMode.aidl
similarity index 92%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/CreationMode.aidl
index 1e304ab..f999205 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/CreationMode.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.storage;
+@VintfStability
+enum CreationMode {
+ NO_CREATE,
+ CREATE_EXCLUSIVE,
+ CREATE,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/FileMode.aidl
similarity index 92%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/FileMode.aidl
index 1e304ab..604e61f 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/FileMode.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.storage;
+@VintfStability
+enum FileMode {
+ READ_ONLY,
+ WRITE_ONLY,
+ READ_WRITE,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Filesystem.aidl
similarity index 81%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Filesystem.aidl
index 5c26cc2..df08380 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Filesystem.aidl
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.storage;
+@VintfStability
+parcelable Filesystem {
+ android.hardware.security.see.storage.Integrity integrity = android.hardware.security.see.storage.Integrity.TAMPER_PROOF_AT_REST;
+ android.hardware.security.see.storage.Availability availability = android.hardware.security.see.storage.Availability.BEFORE_USERDATA;
+ boolean persistent;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IDir.aidl
similarity index 91%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IDir.aidl
index 1e304ab..7068ea2 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IDir.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.storage;
+@VintfStability
+interface IDir {
+ @utf8InCpp String[] readNextFilenames(int maxCount);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IFile.aidl
similarity index 83%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IFile.aidl
index d88d5c8..734ec0c 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IFile.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.security.see.hwcrypto;
-parcelable MemoryBufferParameter {
- android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
- int sizeBytes;
- union MemoryBuffer {
- ParcelFileDescriptor input;
- ParcelFileDescriptor output;
- }
+package android.hardware.security.see.storage;
+@VintfStability
+interface IFile {
+ byte[] read(long size, long offset);
+ long write(long offset, in byte[] buffer);
+ long getSize();
+ void setSize(long newSize);
+ void rename(in @utf8InCpp String destPath, in android.hardware.security.see.storage.CreationMode destCreateMode);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/ISecureStorage.aidl
similarity index 78%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/ISecureStorage.aidl
index 5c26cc2..c99c039 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/ISecureStorage.aidl
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.storage;
+@VintfStability
+interface ISecureStorage {
+ android.hardware.security.see.storage.IStorageSession startSession(in android.hardware.security.see.storage.Filesystem filesystem);
+ const int ERR_UNSUPPORTED_PROPERTIES = 1;
+ const int ERR_NOT_FOUND = 2;
+ const int ERR_ALREADY_EXISTS = 3;
+ const int ERR_BAD_TRANSACTION = 4;
+ const int ERR_AB_UPDATE_IN_PROGRESS = 5;
+ const int ERR_FS_TAMPERED = 6;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IStorageSession.aidl
similarity index 72%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IStorageSession.aidl
index 5c26cc2..11b4b9a 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/IStorageSession.aidl
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.storage;
+@VintfStability
+interface IStorageSession {
+ void commitChanges();
+ void stageChangesForCommitOnAbUpdateComplete();
+ void abandonChanges();
+ android.hardware.security.see.storage.IFile openFile(in @utf8InCpp String filePath, in android.hardware.security.see.storage.OpenOptions options);
+ void deleteFile(in @utf8InCpp String filePath);
+ void renameFile(in @utf8InCpp String currentPath, in @utf8InCpp String destPath, in android.hardware.security.see.storage.CreationMode destCreateMode);
+ android.hardware.security.see.storage.IDir openDir(in @utf8InCpp String path);
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Integrity.aidl
similarity index 92%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Integrity.aidl
index 1e304ab..801da04 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/Integrity.aidl
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.security.see.storage;
+@VintfStability
+enum Integrity {
+ TAMPER_PROOF_AT_REST,
+ TAMPER_DETECT,
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/OpenOptions.aidl
similarity index 81%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
copy to security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/OpenOptions.aidl
index 5c26cc2..eda2404 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
+++ b/security/see/storage/aidl/aidl_api/android.hardware.security.see.storage/current/android/hardware/security/see/storage/OpenOptions.aidl
@@ -31,7 +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.security.see.hwcrypto;
-interface IHwCryptoOperations {
- android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+package android.hardware.security.see.storage;
+@VintfStability
+parcelable OpenOptions {
+ android.hardware.security.see.storage.CreationMode createMode = android.hardware.security.see.storage.CreationMode.NO_CREATE;
+ android.hardware.security.see.storage.FileMode accessMode = android.hardware.security.see.storage.FileMode.READ_WRITE;
+ boolean truncateOnOpen;
}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl
index 21a275c..e2954d5 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/Availability.aidl
@@ -16,6 +16,7 @@
package android.hardware.security.see.storage;
/** Determines how early during the boot process file is able to be accessed. */
+@VintfStability
enum Availability {
/** Available before userdata is mounted, but after android has booted. */
BEFORE_USERDATA,
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
index 1c65038..652d5c6 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
@@ -15,6 +15,7 @@
*/
package android.hardware.security.see.storage;
+@VintfStability
enum CreationMode {
/** Returns an error if the file does not already exist. */
NO_CREATE,
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
similarity index 97%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
index 18a2eae..b167a17 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
@@ -15,6 +15,7 @@
*/
package android.hardware.security.see.storage;
+@VintfStability
enum FileMode {
/** The file may only be read from. */
READ_ONLY,
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl
index ea8db53..eacd4fe 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/Filesystem.aidl
@@ -21,6 +21,7 @@
/**
* Specifies minimum security requirements for a Secure Storage filesystem.
*/
+@VintfStability
parcelable Filesystem {
Integrity integrity = Integrity.TAMPER_PROOF_AT_REST;
Availability availability = Availability.BEFORE_USERDATA;
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
index 5d9a761..ddf8ed1 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
@@ -16,6 +16,7 @@
package android.hardware.security.see.storage;
/** The interface for an open directory */
+@VintfStability
interface IDir {
/**
* Gets the next batch of filenames in this directory.
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
similarity index 99%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
index fd2032e..414d423 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
@@ -18,6 +18,7 @@
import android.hardware.security.see.storage.CreationMode;
/** The interface for an open file */
+@VintfStability
interface IFile {
/**
* Read bytes from this file.
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
similarity index 71%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
index 022de9a..d2ac4d3 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
@@ -23,6 +23,7 @@
*
* Creates sessions which can be used to access storage.
*/
+@VintfStability
interface ISecureStorage {
const int ERR_UNSUPPORTED_PROPERTIES = 1;
const int ERR_NOT_FOUND = 2;
@@ -34,6 +35,13 @@
/**
* Starts a storage session for a filesystem.
*
+ * Clients should be prepared for `startSession` and any methods called on the `IStorageSession`
+ * or its sub-interfaces to return `WOULD_BLOCK` (a `binder::Status` with an exception code of
+ * `EX_TRANSACTION_FAILED` and a transaction error code of `android::WOULD_BLOCK`), which
+ * indicates that the requested storage is not currently available. Possible cases that might
+ * cause this return code might be accessing the data partition during boot stages where it
+ * isn't yet mounted or attempting to commit changes while an A/B update is in progress.
+ *
* @filesystem:
* The minimum filesystem properties requested.
*
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
similarity index 87%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
index 1b70a0e..9a8d0d7 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
@@ -31,6 +31,7 @@
*
* Any changes still pending when the session is dropped will be abandoned.
*/
+@VintfStability
interface IStorageSession {
/**
* Commits any pending changes made through this session to storage.
@@ -44,6 +45,21 @@
void commitChanges();
/**
+ * If an A/B update is in progress, stages any pending changes made through this session to be
+ * committed when the A/B update completes successfully. If the update fails, the changes will
+ * be discarded.
+ *
+ * If no A/B update is in progess, behaves identically to `commitChanges`.
+ *
+ * After this call returns successfully, the session will no longer have pending changes. Files
+ * may then still be modified through this session to create another commit.
+ *
+ * May return service-specific errors:
+ * - ERR_BAD_TRANSACTION
+ */
+ void stageChangesForCommitOnAbUpdateComplete();
+
+ /**
* Abandons any pending changes made through this session.
*
* The session can then be reused to make new changes.
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl
index 2f7f7ab..6f86ab0 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/Integrity.aidl
@@ -15,6 +15,7 @@
*/
package android.hardware.security.see.storage;
+@VintfStability
enum Integrity {
/** REE may prevent operations, but cannot alter data once written. */
TAMPER_PROOF_AT_REST,
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl b/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
similarity index 98%
rename from staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
rename to security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
index 9fdf9e5..110b370 100644
--- a/staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
+++ b/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
@@ -18,6 +18,7 @@
import android.hardware.security.see.storage.CreationMode;
import android.hardware.security.see.storage.FileMode;
+@VintfStability
parcelable OpenOptions {
/** Controls creation behavior of the to-be-opened file. See `CreationMode` docs for details. */
CreationMode createMode = CreationMode.NO_CREATE;
diff --git a/staging/security/see/Android.bp b/staging/security/see/Android.bp
new file mode 100644
index 0000000..a83b65d
--- /dev/null
+++ b/staging/security/see/Android.bp
@@ -0,0 +1,5 @@
+dirgroup {
+ name: "trusty_dirgroup_hardware_interfaces_staging_security_see",
+ dirs: ["."],
+ visibility: ["//trusty/vendor/google/aosp/scripts"],
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
deleted file mode 100644
index bb194a3..0000000
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.hardware.security.see.hwcrypto;
-
-import android.hardware.security.see.hwcrypto.IHwCryptoOperations;
-import android.hardware.security.see.hwcrypto.IOpaqueKey;
-import android.hardware.security.see.hwcrypto.KeyPolicy;
-import android.hardware.security.see.hwcrypto.types.ExplicitKeyMaterial;
-import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
-
-/*
- * Higher level interface to access and generate keys.
- */
-interface IHwCryptoKey {
- /*
- * Identifier for the requested device provided key. The currently supported identifiers are:
- *
- * DEVICE_BOUND_KEY:
- * This is a key unique to the device.
- * BATCH_KEY:
- * This is a shared by a set of devices.
- */
- enum DeviceKeyId {
- DEVICE_BOUND_KEY,
- BATCH_KEY,
- }
-
- /*
- * Identifier for the requested key slot. The currently supported identifiers are:
- *
- * KEYMINT_SHARED_HMAC_KEY:
- * This is the shared HMAC key that will now be computed by HwCryptoKey after participating
- * in the ISharedSecret protocol that can be shared with KeyMint and authenticators. See
- * ISharedSecret.aidl for more information.
- */
- enum KeySlot {
- KEYMINT_SHARED_HMAC_KEY,
- }
-
- union DiceBoundDerivationKey {
- /*
- * Opaque to be used to derive the DICE bound key.
- */
- IOpaqueKey opaqueKey;
-
- /*
- * Device provided key to be used to derive the DICE bound key.
- */
- DeviceKeyId keyId;
- }
-
- parcelable DiceCurrentBoundKeyResult {
- /*
- * Key cryptographically bound to a DICE policy.
- */
- IOpaqueKey diceBoundKey;
-
- /*
- * Current dice policy which was used to generate the returned key. This policy is
- * opaque from this service perspective (it will be sent to an Authentication Manager
- * Service to be verified). It follows the structure defined on DicePolicy.cddl, located
- * under hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/
- * with the caveat that it could be encrypted if the client does not have enough permissions
- * to see the device dice policy information.
- */
- byte[] dicePolicyForKeyVersion;
- }
-
- parcelable DiceBoundKeyResult {
- /*
- * Key cryptographically bound to a DICE policy.
- */
- IOpaqueKey diceBoundKey;
-
- /*
- * Indicates if the diceBoundKey returned was created using a current DICE policy. The
- * caller can use this to detect if an old policy was provided and rotate its keys if so
- * desired. Old, valid policies remain usable, but care needs to be taken to not continue to
- * use a potentially compromised key.
- */
- boolean dicePolicyWasCurrent;
- }
-
- parcelable ClearKeyPolicy {
- /*
- * Indicates the desired key size. It will be used to calculate how many bytes of key
- * material should be returned.
- */
- int keySizeBytes;
- }
-
- union DerivedKeyPolicy {
- /*
- * If used we will derive a clear key and pass it back as an array of bytes on
- * <code>HwCryptoKeyMaterial::explicitKey</code>.
- */
- ClearKeyPolicy clearKey;
-
- /*
- * Policy for the newly derived opaque key. Defines how the key can be used and its type.
- */
- byte[] opaqueKey;
- }
-
- parcelable DerivedKeyParameters {
- /*
- * Key to be used to derive the new key using HKDF.
- */
- IOpaqueKey derivationKey;
-
- /*
- * Policy for the newly derived key. Depending on its type, either a clear or opaque key
- * will be derived.
- */
- DerivedKeyPolicy keyPolicy;
-
- /*
- * An arbitrary set of bytes incorporated into the key derivation. May have
- * an implementation-specific maximum length, but it is guaranteed to accept
- * at least 32 bytes.
- */
- byte[] context;
- }
-
- union DerivedKey {
- /*
- * Derived key in clear format.
- */
- byte[] explicitKey = {};
-
- /*
- * Derived key as a key token to be used only through the HWCrypto service.
- */
- IOpaqueKey opaque;
- }
-
- /*
- * deriveCurrentDicePolicyBoundKey() - Derives a versioned key tied to the caller's current DICE
- * policy. It will return this current policy back to the caller
- * along with the generated key.
- *
- * @derivationKey:
- * Key to be used to derive the new key using HKDF.
- *
- * Return:
- * Ok(DiceCurrentBoundKeyResult) on success, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(
- in DiceBoundDerivationKey derivationKey);
-
- /*
- * deriveDicePolicyBoundKey() - Derive a versioned key by checking the provided DICE policy
- * against the caller and then using it as a context for deriving
- * the returned key.
- *
- * @derivationKey:
- * Key to be used to derive the new key using HKDF.
- *
- * @dicePolicyForKeyVersion:
- * Policy used to derive keys tied to specific versions. Using this parameter
- * the caller can tie a derived key to a minimum version of itself, so in the future only
- * itself or a more recent version can derive the same key. This parameter is opaque to the
- * caller and it could be encrypted in the case the client doesn't have permission to know
- * the dice chain.
- * When implementing this function, this parameter shall be one of the components fed
- * to the KDF context and it needs to be checked against the caller DICE certificate before
- * being used.
- *
- * Return:
- * Ok(DiceBoundKeyResult) on success, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- DiceBoundKeyResult deriveDicePolicyBoundKey(
- in DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
-
- /*
- * deriveKey() - Derive a new key based on the given key, policy and context.
- *
- * @parameters:
- * Parameters used for the key derivation. See <code>DerivedKeyParameters</code> on this
- * file for more information.
- *
- * Return:
- * Ok(HwCryptoKeyMaterial) on success, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- DerivedKey deriveKey(in DerivedKeyParameters parameters);
-
- /*
- * getHwCryptoOperations() - Returns an interface used to work on opaque keys. This interface
- * can also be used to operate on any opaque key generated by
- * hwkeyDeriveVersioned, even if this key has been generated after
- * retrieving a IHwCryptoOperations binder object, as long as the
- * parent IHwCryptoDeviceKeyAccess is not dropped between retrieving
- * the IHwCryptoOperations binder object and deriving the key.
- * IHwCryptoOperations can also be used to create opaque keys that
- * are not bound to the device.
- *
- * Return:
- * IHwCryptoOperations on success
- */
- IHwCryptoOperations getHwCryptoOperations();
-
- /*
- * importClearKey() - Imports a SW clear key into the secure environment.
- *
- * @keyMaterial:
- * key to be imported.
- * @newKeyPolicy:
- * Policy of the new key. Defines how the newly created key can be used. Because any
- * clear key imported into the system is considered to have a
- * <code>KeyLifetime::PORTABLE</code> lifetime, a call to this function will return an
- * error if <code>newKeyPolicy.newKeyPolicy</code> is not set to portable.
- *
- * Return:
- * IOpaqueKey on success, service specific error based on <code>HalErrorCode</code>
- * otherwise.
- */
- IOpaqueKey importClearKey(in ExplicitKeyMaterial keyMaterial, in KeyPolicy newKeyPolicy);
-
- /*
- * getCurrentDicePolicy() - Returns the client current DICE policy. This policy is encrypted and
- * considered opaque from the client perspective. This policy is the
- * same used to create DICE bound keys and will also be used to seal
- * secrets that can only be retrieved by the DICE policy owner. The
- * first use of this seal operation will be
- * <code>IOpaqueKey::getShareableToken</code> and
- * <code>IHwCryptoKey::keyTokenImport</code>. To start this process,
- * the intended key receiver will call this function and then pass the
- * generated DICE policy to the owner of the key that the receiver
- * wants to import. The key owner will then call
- * <code>IOpaqueKey::getShareableToken</code> passing the receiver DICE
- * policy to insure that only that receiver can import the key.
- *
- * Return:
- * byte[] on success, which is the caller encrypted DICE policy.
- */
- byte[] getCurrentDicePolicy();
-
- /*
- * key_token_import() - Imports a key from a different client service instance. Because
- * IOpaqueKey are binder objects that cannot be directly shared between
- * binder rpc clients, this method provide a way to send a key to another
- * client. Keys to be imported by the receiver are represented by a token
- * created using <code>IOpaqueKey::getShareableToken</code>. The flow
- * to create this token is described in
- * <code>IHwCryptoKey::getCurrentDicePolicy</code>.
- *
- * @requested_key:
- * Handle to the key to be imported to the caller service.
- * @sealingDicePolicy:
- * DICE policy used to seal the exported key.
- * Return:
- * A IOpaqueKey that can be directly be used on the local HWCrypto service on
- * success, service specific error based on <code>HalErrorCode</code> otherwise.
- */
- IOpaqueKey keyTokenImport(in OpaqueKeyToken requestedKey, in byte[] sealingDicePolicy);
-
- /*
- * getKeyslotData() - Gets the keyslot key material referenced by slotId.
- *
- * @slotId:
- * Identifier for the requested keyslot
- *
- * This interface is used to access device specific keys with known types and uses. Because the
- * returned key is opaque, it can only be used through the different HwCrypto interfaces.
- * Because the keys live in a global namespace the identity of the caller needs to be
- * checked to verify that it has permission to accesses the requested key.
- *
- * Return:
- * Ok(IOpaqueKey) on success, UNAUTHORIZED if the caller cannot access the requested key,
- * another specific error code otherwise.
- */
- IOpaqueKey getKeyslotData(KeySlot slotId);
-}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
deleted file mode 100644
index 9a72639..0000000
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.hardware.security.see.hwcrypto;
-
-import android.hardware.security.see.hwcrypto.KeyPolicy;
-import android.hardware.security.see.hwcrypto.types.OpaqueKeyToken;
-import android.hardware.security.see.hwcrypto.types.OperationType;
-import android.hardware.security.see.hwcrypto.types.ProtectionId;
-
-interface IOpaqueKey {
- /*
- * exportWrappedKey() - Exports this key as a wrapped (encrypted) blob.
- *
- * @wrapping_key:
- * wrapping key. It needs to be an opaque key and its policy needs to indicate that it can
- * be used for key wrapping.
- *
- * Return:
- * Wrapped key blob as a byte array on success. Format of the blob is opaque to the service
- * but has to match the command accepted by
- * <code>IHwCryptoKeyGeneration::importWrappedKey</code>, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- byte[] exportWrappedKey(in IOpaqueKey wrappingKey);
-
- /*
- * getKeyPolicy() - Returns the key policy.
- *
- * Return:
- * A <code>KeyPolicy</code> on success, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- KeyPolicy getKeyPolicy();
-
- /*
- * getPublicKey() - Returns the public key portion of this OpaqueKey. This operation is only
- * valid for asymmetric keys
- *
- * Return:
- * public key as a byte array on success, service specific error based on
- * <code>HalErrorCode</code> otherwise. Format used for the returned public key is COSE.
- */
- byte[] getPublicKey();
-
- /*
- * getShareableToken() - Returns a token that can shared with another HWCrypto client.
- *
- * @sealingDicePolicy:
- * Token to be used to protect the returned OpaqueKeyToken. It will be used so only
- * the owner of the sealingDicePolicy can import the key.
- * Return:
- * <code>OpaqueKeyMaterial</code> token on success, service specific error based on
- * <code>HalErrorCode</code> otherwise.
- */
- OpaqueKeyToken getShareableToken(in byte[] sealingDicePolicy);
-
- /*
- * setProtectionId() - Sets the protectionID associated with the buffers where the operation
- * will be performed. A protection ID serves as a limitation on the key so
- * it can only operate on buffers with a matching protection ID.
- * The client calling this functions needs to have the necessary permissions
- * to read and/or write to this buffer. Setting this parameter means that
- * if the key is shared with a different client, the client receiving the
- * key will be limited in which buffers can be used to read/write data for
- * this operation.
- *
- * @protectionId:
- * ID of the given use case to provide protection for. The method of protecting the buffer
- * will be platform dependent.
- * @allowedOperations:
- * array of allowed operations. Allowed operations are either READ or WRITE.
- *
- * Return:
- * service specific error based on <code>HalErrorCode</code> on failure.
- */
- void setProtectionId(in ProtectionId protectionId, in OperationType[] allowedOperations);
-}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
deleted file mode 100644
index 3cf4670..0000000
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package android.hardware.security.see.hwcrypto.types;
-
-/*
- * Enum describing all supported key types. Key types are strongly bound to the algorithm to
- * prevent reusing the same key on different algorithms (e.g. using the same key for 2 different AES
- * 128 Cipher modes).
- */
-enum KeyType {
- AES_128_CBC_NO_PADDING,
- AES_128_CBC_PKCS7_PADDING,
- AES_128_CTR,
- AES_128_GCM,
- AES_128_CMAC,
- AES_256_CBC_NO_PADDING,
- AES_256_CBC_PKCS7_PADDING,
- AES_256_CTR,
- AES_256_GCM,
- AES_256_CMAC,
- HMAC_SHA256,
- HMAC_SHA512,
- RSA2048_PSS_SHA256,
- RSA2048_PKCS1_5_SHA256,
- ECC_NIST_P256_SIGN_NO_PADDING,
- ECC_NIST_P256_SIGN_SHA256,
- ECC_NIST_P521_SIGN_NO_PADDING,
- ECC_NIST_P521_SIGN_SHA512,
- ECC_ED25519_SIGN,
-}
diff --git a/thermal/OWNERS b/thermal/OWNERS
index 7229b22..13895bd 100644
--- a/thermal/OWNERS
+++ b/thermal/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 826709
-
-# ADPF virtual team
-lpy@google.com
+file:platform/frameworks/base:/ADPF_OWNERS
wvw@google.com
diff --git a/virtualization/capabilities_service/aidl/Android.bp b/virtualization/capabilities_service/aidl/Android.bp
new file mode 100644
index 0000000..b0bbbdd
--- /dev/null
+++ b/virtualization/capabilities_service/aidl/Android.bp
@@ -0,0 +1,35 @@
+// Copyright (C) 2024 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_team: "trendy_team_virtualization",
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+aidl_interface {
+ name: "android.hardware.virtualization.capabilities.capabilities_service",
+ vendor_available: true,
+ srcs: ["android/**/*.aidl"],
+ stability: "vintf",
+ backend: {
+ rust: {
+ enabled: true,
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.virt",
+ ],
+ },
+ },
+ frozen: false,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
similarity index 85%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
index 1e304ab..68ff021 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/virtualization/capabilities_service/aidl/aidl_api/android.hardware.virtualization.capabilities.capabilities_service/current/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 The Android Open Source Project
+ * Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +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.security.see.hwcrypto.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.virtualization.capabilities;
+@VintfStability
+interface IVmCapabilitiesService {
+ void grantAccessToVendorTeeServices(in ParcelFileDescriptor vmFd, in String[] vendorTeeServices);
}
diff --git a/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl b/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
new file mode 100644
index 0000000..0d09ecb
--- /dev/null
+++ b/virtualization/capabilities_service/aidl/android/hardware/virtualization/capabilities/IVmCapabilitiesService.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.virtualization.capabilities;
+
+/**
+ * Encapsulates vendor-specific capabilities that can be granted to VMs.
+ */
+@VintfStability
+interface IVmCapabilitiesService {
+ /**
+ * Grant access for the VM represented by the given vm_fd to the given vendor-owned tee
+ * services. The names in |vendorTeeServices| must match the ones defined in the
+ * tee_service_contexts files.
+ * TODO(ioffe): link to the integration doc for custom smc filtering feature once
+ * it's ready.
+ */
+ void grantAccessToVendorTeeServices(
+ in ParcelFileDescriptor vmFd, in String[] vendorTeeServices);
+}