Merge "Spatializer AIDL: add spatializedSpeakerLayout" into main
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index e2d4b79..14e70ef 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -117,6 +117,9 @@
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
static_libs: ["libaudioaidlranges"],
srcs: ["VtsHalDynamicsProcessingTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
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/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl
index f7e8c5a..8651c30 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/StatusCode.aidl
@@ -45,4 +45,5 @@
NOT_AVAILABLE_SPEED_HIGH = 8,
NOT_AVAILABLE_POOR_VISIBILITY = 9,
NOT_AVAILABLE_SAFETY = 10,
+ NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED = 11,
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
index 642ce83..cc88e70 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
@@ -36,5 +36,12 @@
enum VehiclePropertyStatus {
AVAILABLE = 0x00,
UNAVAILABLE = 0x01,
+ NOT_AVAILABLE_GENERAL = 0x01,
ERROR = 0x02,
+ NOT_AVAILABLE_DISABLED = (0x1000 | 0x01) /* 4097 */,
+ NOT_AVAILABLE_SPEED_LOW = (0x1000 | 0x02) /* 4098 */,
+ NOT_AVAILABLE_SPEED_HIGH = (0x1000 | 0x03) /* 4099 */,
+ NOT_AVAILABLE_POOR_VISIBILITY = (0x1000 | 0x04) /* 4100 */,
+ NOT_AVAILABLE_SAFETY = (0x1000 | 0x05) /* 4101 */,
+ NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED = (0x1000 | 0x06) /* 4102 */,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl
index fd4b199..3fb4532 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/StatusCode.aidl
@@ -96,4 +96,11 @@
* operation such as closing a trunk door, etc.
*/
NOT_AVAILABLE_SAFETY = 10,
+ /**
+ * The feature cannot be accessed because the sub-system for the feature is
+ * not connected.
+ *
+ * E.g. trailer light state is not available when the trailer is detached.
+ */
+ NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED = 11,
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
index 400e256..4b1dcdb 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropertyStatus.aidl
@@ -22,9 +22,15 @@
@VintfStability
@Backing(type="int")
enum VehiclePropertyStatus {
- /** Property is available and behaving normally */
+ /**
+ * Property is available and behaving normally
+ */
AVAILABLE = 0x00,
/**
+ * Same as {@link #NOT_AVAILABLE_GENERAL}.
+ */
+ UNAVAILABLE = 0x01,
+ /**
* A property in this state is not available for reading and writing. This
* is a transient state that depends on the availability of the underlying
* implementation (e.g. hardware or driver). It MUST NOT be used to
@@ -34,8 +40,45 @@
* this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore
* the value of the status field when writing a property value coming from
* Android.
+ *
+ * This represents a general not-available status. If more detailed info is
+ * known, a more specific not-available status should be used instead.
*/
- UNAVAILABLE = 0x01,
- /** There is an error with this property. */
+ NOT_AVAILABLE_GENERAL = 0x01,
+ /**
+ * There is an error with this property.
+ */
ERROR = 0x02,
+ // All NOT_AVAILABLE_XXX status starts with 0x1000.
+ /**
+ * The property is not available because the underlying feature is disabled.
+ */
+ NOT_AVAILABLE_DISABLED = 0x1000 | 0x01,
+ /**
+ * The property is not available because the vehicle speed is too low.
+ */
+ NOT_AVAILABLE_SPEED_LOW = 0x1000 | 0x02,
+ /**
+ * The property is not available because the vehicle speed is too high.
+ */
+ NOT_AVAILABLE_SPEED_HIGH = 0x1000 | 0x03,
+ /**
+ * The property is not available because of bad camera or sensor visibility. Examples
+ * might be bird poop blocking the camera or a bumper cover blocking an ultrasonic sensor.
+ */
+ NOT_AVAILABLE_POOR_VISIBILITY = 0x1000 | 0x04,
+ /**
+ * The property cannot be accessed due to safety reasons. Eg. System could be
+ * in a faulty state, an object or person could be blocking the requested
+ * operation such as closing a trunk door, etc.
+ */
+ NOT_AVAILABLE_SAFETY = 0x1000 | 0x05,
+ /**
+ * The property is not available because the sub-system for the feature is
+ * not connected.
+ *
+ * E.g. the trailer light property is in this state if the trailer is not
+ * attached.
+ */
+ NOT_AVAILABLE_SUBSYSTEM_NOT_CONNECTED = 0x1000 | 0x06,
}
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..be79b0d 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;
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..481e2ac 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
@@ -48,5 +48,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/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..5e32e5e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecSpecificConfigurationLtv.aidl
@@ -43,6 +43,7 @@
enum FrameDuration {
US7500 = 0x00,
US10000 = 0x01,
+ US20000 = 0x02,
}
parcelable AudioChannelAllocation {
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..8583221 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -16,10 +16,11 @@
package android.hardware.bluetooth.audio;
+import android.hardware.bluetooth.audio.AptxAdaptiveLeCapabilities;
import android.hardware.bluetooth.audio.AudioLocation;
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,6 +36,7 @@
Lc3Capabilities lc3Capabilities;
VendorCapabilities vendorCapabillities;
AptxAdaptiveLeCapabilities aptxAdaptiveLeCapabilities;
+ OpusCapabilities opusCapabilities;
}
CodecType codecType;
AudioLocation supportedChannel;
diff --git a/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/LeAudioOffloadAudioProvider.cpp
index 61c29d3..a10e0a6 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>
@@ -768,7 +770,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 +781,7 @@
filtered_ase_configuration_setting.value());
}
}
+ }
} else {
sink_matched_ase_configuration_settings = ase_configuration_settings;
}
@@ -809,7 +812,6 @@
// Matching priority list:
// Preferred context - exact 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()) {
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/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
index 37812fa..8475d39 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp
@@ -92,6 +92,7 @@
/* Frame Durations */
constexpr uint8_t kLeAudioCodecFrameDur7500us = 0x00;
constexpr uint8_t kLeAudioCodecFrameDur10000us = 0x01;
+constexpr uint8_t kLeAudioCodecFrameDur20000us = 0x02;
/* Audio Allocations */
constexpr uint32_t kLeAudioLocationNotAllowed = 0x00000000;
@@ -171,7 +172,9 @@
{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 = {
@@ -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/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/ranging/aidl/vts/Android.bp b/bluetooth/ranging/aidl/vts/Android.bp
index 9984ce8..bcae5d0 100644
--- a/bluetooth/ranging/aidl/vts/Android.bp
+++ b/bluetooth/ranging/aidl/vts/Android.bp
@@ -17,7 +17,7 @@
"libutils",
],
static_libs: [
- "android.hardware.bluetooth.ranging-V1-ndk",
+ "android.hardware.bluetooth.ranging-V2-ndk",
"libbluetooth-types",
],
test_config: "VtsHalBluetoothRangingTargetTest.xml",
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/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
index b3a3778..5ec8d70 100644
--- a/compatibility_matrices/compatibility_matrix.202504.xml
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -249,7 +249,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.health</name>
- <version>3</version>
+ <version>3-4</version>
<interface>
<name>IHealth</name>
<instance>default</instance>
@@ -507,6 +507,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>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index eabb603..4995a72 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -158,6 +158,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{
@@ -167,6 +169,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/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/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
index 040afd7..c522188 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -41,6 +41,7 @@
int configGroup;
int vsyncPeriod;
@nullable android.hardware.graphics.composer3.VrrConfig vrrConfig;
+ android.hardware.graphics.composer3.OutputType hdrOutputType;
parcelable Dpi {
float x;
float y;
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.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 graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.aidl
index 1e304ab..e1149cb 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/OutputType.aidl
@@ -1,11 +1,11 @@
/*
- * 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.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -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.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.graphics.composer3;
+@Backing(type="int") @VintfStability
+enum OutputType {
+ INVALID = 0,
+ SYSTEM = 1,
+ SDR = 2,
+ HDR10 = 3,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
index 09c42dc..80d1337 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -15,6 +15,8 @@
*/
package android.hardware.graphics.composer3;
+
+import android.hardware.graphics.composer3.OutputType;
import android.hardware.graphics.composer3.VrrConfig;
@VintfStability
@@ -67,4 +69,9 @@
* Non-VRR modes should set this to null.
*/
@nullable VrrConfig vrrConfig;
+
+ /**
+ * The HDR output format available.
+ */
+ OutputType hdrOutputType;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Luts.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Luts.aidl
index 592ac50..393354e 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Luts.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Luts.aidl
@@ -40,15 +40,16 @@
* For data precision, 32-bit float is used to specify a Lut by both the HWC and
* the platform.
*
- * For unflattening/flattening 3D Lut(s), the algorithm below should be observed
- * by both the HWC and the platform.
* Assuming that we have a 3D array `ORIGINAL[WIDTH, HEIGHT, DEPTH]`, we would turn it into
* `FLAT[WIDTH * HEIGHT * DEPTH]` by
*
* `FLAT[z + DEPTH * (y + HEIGHT * x)] = ORIGINAL[x, y, z]`
*
- * Noted that 1D Lut(s) should be gain curve ones
- * and 3D Lut(s) should be pure color lookup ones.
+ * Note that 1D Lut(s) should be gain curve ones and 3D Lut(s) should be pure color lookup
+ * ones. For 3D Luts buffer,the values of the lut buffer should be normalized, ranging from 0.0
+ * to 1.0, inclusively and the data is organized in the order of R, G, B channels.
+ * For 1D Luts, the lut's values should be also normalized for fixed point pixel formats,
+ * and we now ignore floating point pixel formats + extended range buffers.
*/
@nullable ParcelFileDescriptor pfd;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl
new file mode 100644
index 0000000..bf4a786
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/OutputType.aidl
@@ -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.
+ */
+
+package android.hardware.graphics.composer3;
+
+/**
+ * Display output formats for HDR content.
+ */
+@VintfStability
+@Backing(type="int")
+enum OutputType {
+ /**
+ * Invalid HDR output type
+ */
+ INVALID = 0,
+ /**
+ * Display output format will be chosen by the HAL implementation
+ * and will not adjust to match the content format
+ */
+ SYSTEM = 1,
+ /**
+ * Display supports SDR output type
+ */
+ SDR = 2,
+ /**
+ * Display supports HDR10 output type
+ */
+ HDR10 = 3,
+}
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 354e3e0..2c53377 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -22,6 +22,7 @@
#include <aidl/android/hardware/graphics/common/PixelFormat.h>
#include <aidl/android/hardware/graphics/common/Rect.h>
#include <aidl/android/hardware/graphics/composer3/Composition.h>
+#include <aidl/android/hardware/graphics/composer3/OutputType.h>
#include <aidl/android/hardware/graphics/composer3/IComposer.h>
#include <android-base/properties.h>
#include <android/binder_process.h>
@@ -3393,6 +3394,19 @@
}
}
+TEST_P(GraphicsComposerAidlCommandV4Test, GetDisplayConfigurations_hasHdrType) {
+ for (const auto& display : mDisplays) {
+ const auto& [status, displayConfigurations] =
+ mComposerClient->getDisplayConfigurations(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+ EXPECT_FALSE(displayConfigurations.empty());
+
+ for (const auto& displayConfig : displayConfigurations) {
+ EXPECT_NE(displayConfig.hdrOutputType, OutputType::INVALID);
+ }
+ }
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlCommandTest,
diff --git a/health/aidl/Android.bp b/health/aidl/Android.bp
index 97de0e2..d2ad3b1 100644
--- a/health/aidl/Android.bp
+++ b/health/aidl/Android.bp
@@ -50,9 +50,8 @@
version: "3",
imports: [],
},
-
],
- frozen: true,
+ frozen: false,
}
@@ -84,7 +83,7 @@
name: "android.hardware.health-translate-ndk",
defaults: ["android.hardware.health-translate-ndk_defaults"],
shared_libs: [
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
],
}
@@ -101,7 +100,7 @@
name: "android.hardware.health-translate-java",
srcs: ["android/hardware/health/Translate.java"],
libs: [
- "android.hardware.health-V3-java",
+ "android.hardware.health-V4-java",
"android.hardware.health-V2.0-java",
"android.hardware.health-V2.1-java",
],
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryPartStatus.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryPartStatus.aidl
index e013e31..9303767 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryPartStatus.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/BatteryPartStatus.aidl
@@ -34,7 +34,7 @@
package android.hardware.health;
@Backing(type="int") @VintfStability
enum BatteryPartStatus {
- UNSUPPORTED,
- ORIGINAL,
- REPLACED,
+ UNSUPPORTED = 0,
+ ORIGINAL = 1,
+ REPLACED = 2,
}
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
index bfa1475..548a793 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HealthInfo.aidl
@@ -60,5 +60,6 @@
android.hardware.health.BatteryChargingState chargingState;
android.hardware.health.BatteryChargingPolicy chargingPolicy;
@nullable android.hardware.health.BatteryHealthData batteryHealthData;
+ @nullable android.hardware.health.HingeInfo[] foldInfos;
const int BATTERY_CHARGE_TIME_TO_FULL_NOW_SECONDS_UNSUPPORTED = (-1) /* -1 */;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HingeInfo.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 health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HingeInfo.aidl
index 1e304ab..b3c38ad 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/HingeInfo.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.health;
+@VintfStability
+parcelable HingeInfo {
+ int numTimesFolded;
+ int expectedHingeLifespan;
}
diff --git a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
index b49dfff..e919f14 100644
--- a/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
+++ b/health/aidl/aidl_api/android.hardware.health/current/android/hardware/health/IHealth.aidl
@@ -49,6 +49,7 @@
void setChargingPolicy(android.hardware.health.BatteryChargingPolicy in_value);
android.hardware.health.BatteryChargingPolicy getChargingPolicy();
android.hardware.health.BatteryHealthData getBatteryHealthData();
+ android.hardware.health.HingeInfo[] getHingeInfo();
const int STATUS_UNKNOWN = 2;
const int STATUS_CALLBACK_DIED = 4;
}
diff --git a/health/aidl/android/hardware/health/HealthInfo.aidl b/health/aidl/android/hardware/health/HealthInfo.aidl
index af84089..12a397a 100644
--- a/health/aidl/android/hardware/health/HealthInfo.aidl
+++ b/health/aidl/android/hardware/health/HealthInfo.aidl
@@ -24,6 +24,7 @@
import android.hardware.health.BatteryStatus;
import android.hardware.health.DiskStats;
import android.hardware.health.StorageInfo;
+import android.hardware.health.HingeInfo;
/**
* Health Information.
@@ -115,7 +116,6 @@
* Battery capacity level. See {@link BatteryCapacityLevel} for more details.
*/
BatteryCapacityLevel batteryCapacityLevel;
-
/**
* Value of {@link #batteryChargeTimeToFullNowSeconds} if it is not
* supported.
@@ -148,4 +148,8 @@
* Battery health data
*/
@nullable BatteryHealthData batteryHealthData;
+ /**
+ * Information about foldable hinge health. Will be an empty vector if no hinges present
+ */
+ @nullable HingeInfo[] foldInfos;
}
diff --git a/health/aidl/android/hardware/health/HingeInfo.aidl b/health/aidl/android/hardware/health/HingeInfo.aidl
new file mode 100644
index 0000000..19b46df
--- /dev/null
+++ b/health/aidl/android/hardware/health/HingeInfo.aidl
@@ -0,0 +1,37 @@
+/*
+ * 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.health;
+
+/*
+ * Information on foldable hinge health life time estimates, end of life
+ * information and other attributes.
+ *
+ * All integers in this struct must be interpreted as non-negative.
+ */
+@VintfStability
+parcelable HingeInfo {
+ /**
+ * returns count of times a given hinge has been folded.
+ *
+ * opening fully counts as 1 fold and closing fully counts as another
+ */
+ int numTimesFolded;
+ /**
+ * returns the expected lifespan of hinge in units of number of folds
+ */
+ int expectedHingeLifespan;
+}
diff --git a/health/aidl/android/hardware/health/IHealth.aidl b/health/aidl/android/hardware/health/IHealth.aidl
index bdfe07a..c88141c 100644
--- a/health/aidl/android/hardware/health/IHealth.aidl
+++ b/health/aidl/android/hardware/health/IHealth.aidl
@@ -23,6 +23,7 @@
import android.hardware.health.HealthInfo;
import android.hardware.health.IHealthInfoCallback;
import android.hardware.health.StorageInfo;
+import android.hardware.health.HingeInfo;
/**
* IHealth manages health info and posts events on registered callbacks.
@@ -242,4 +243,17 @@
* for other errors.
*/
BatteryHealthData getBatteryHealthData();
+
+ /**
+ * Get Hinge info.
+ *
+ * @return vector of HingeInfo structs if successful.
+ * If error:
+ * - Return exception with code EX_UNSUPPORTED_OPERATION
+ * if this property is not supported,
+ * - Return service specific error with code STATUS_UNKNOWN
+ * for other errors.
+ */
+ HingeInfo[] getHingeInfo();
+
}
diff --git a/health/aidl/default/Android.bp b/health/aidl/default/Android.bp
index 2071f08..cc5d0a0 100644
--- a/health/aidl/default/Android.bp
+++ b/health/aidl/default/Android.bp
@@ -29,7 +29,7 @@
"libcutils",
"liblog",
"libutils",
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
// TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
"libhidlbase",
@@ -48,7 +48,7 @@
name: "libhealth_aidl_charger_defaults",
shared_libs: [
// common
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
"libbase",
"libcutils",
"liblog",
@@ -195,7 +195,7 @@
"service_fuzzer_defaults",
],
static_libs: [
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
"libbase",
"liblog",
"fuzz_libhealth_aidl_impl",
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index 37662ea..d0e2dac 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -192,6 +192,12 @@
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
+ndk::ScopedAStatus Health::getHingeInfo(std::vector<HingeInfo>*) {
+ // This implementation does not support HingeInfo. An implementation may extend this
+ // class and override this function to support storage info.
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
ndk::ScopedAStatus Health::getHealthInfo(HealthInfo* out) {
battery_monitor_.updateValues();
diff --git a/health/aidl/default/android.hardware.health-service.example.xml b/health/aidl/default/android.hardware.health-service.example.xml
index 2acaaba..8ddfbda 100644
--- a/health/aidl/default/android.hardware.health-service.example.xml
+++ b/health/aidl/default/android.hardware.health-service.example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.health</name>
- <version>3</version>
+ <version>4</version>
<fqname>IHealth/default</fqname>
</hal>
</manifest>
diff --git a/health/aidl/default/include/health-impl/Health.h b/health/aidl/default/include/health-impl/Health.h
index 429ae2a..96df517 100644
--- a/health/aidl/default/include/health-impl/Health.h
+++ b/health/aidl/default/include/health-impl/Health.h
@@ -72,6 +72,7 @@
// The default implementations return nothing in |out|.
ndk::ScopedAStatus getDiskStats(std::vector<DiskStats>* out) override;
ndk::ScopedAStatus getStorageInfo(std::vector<StorageInfo>* out) override;
+ ndk::ScopedAStatus getHingeInfo(std::vector<HingeInfo>* out) override;
ndk::ScopedAStatus setChargingPolicy(BatteryChargingPolicy in_value) override;
ndk::ScopedAStatus getChargingPolicy(BatteryChargingPolicy* out) override;
diff --git a/health/aidl/vts/functional/Android.bp b/health/aidl/vts/functional/Android.bp
index 25ba5f8..75bec97 100644
--- a/health/aidl/vts/functional/Android.bp
+++ b/health/aidl/vts/functional/Android.bp
@@ -40,7 +40,7 @@
"libbinder_ndk",
],
static_libs: [
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
"libgmock",
],
header_libs: [
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 45a1e40..c47ddca 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -360,6 +360,19 @@
}
/*
+ * Tests the values returned by getHingeInfo() from interface IHealth.
+ */
+TEST_P(HealthAidl, getHingeInfo) {
+ std::vector<HingeInfo> value;
+ auto status = health->getHingeInfo(&value);
+ ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
+ if (!status.isOk()) return;
+ for (auto& hinge : value) {
+ ASSERT_TRUE(hinge.expectedHingeLifespan > 0);
+ }
+}
+
+/*
* Tests the values returned by getDiskStats() from interface IHealth.
*/
TEST_P(HealthAidl, getDiskStats) {
diff --git a/health/utils/libhealthshim/Android.bp b/health/utils/libhealthshim/Android.bp
index b0ea743..9f9970f 100644
--- a/health/utils/libhealthshim/Android.bp
+++ b/health/utils/libhealthshim/Android.bp
@@ -34,7 +34,7 @@
"-Werror",
],
static_libs: [
- "android.hardware.health-V3-ndk",
+ "android.hardware.health-V4-ndk",
"android.hardware.health-translate-ndk",
"android.hardware.health@1.0",
"android.hardware.health@2.0",
diff --git a/health/utils/libhealthshim/include/health-shim/shim.h b/health/utils/libhealthshim/include/health-shim/shim.h
index ff6849b..9a62601 100644
--- a/health/utils/libhealthshim/include/health-shim/shim.h
+++ b/health/utils/libhealthshim/include/health-shim/shim.h
@@ -43,6 +43,7 @@
ndk::ScopedAStatus getEnergyCounterNwh(int64_t* _aidl_return) override;
ndk::ScopedAStatus getChargeStatus(BatteryStatus* _aidl_return) override;
ndk::ScopedAStatus getStorageInfo(std::vector<StorageInfo>* _aidl_return) override;
+ ndk::ScopedAStatus getHingeInfo(std::vector<HingeInfo>* _aidl_return) override;
ndk::ScopedAStatus getDiskStats(std::vector<DiskStats>* _aidl_return) override;
ndk::ScopedAStatus getHealthInfo(HealthInfo* _aidl_return) override;
ndk::ScopedAStatus setChargingPolicy(BatteryChargingPolicy in_value) override;
diff --git a/health/utils/libhealthshim/shim.cpp b/health/utils/libhealthshim/shim.cpp
index a5ba919..2ddf97e 100644
--- a/health/utils/libhealthshim/shim.cpp
+++ b/health/utils/libhealthshim/shim.cpp
@@ -190,6 +190,10 @@
return ReturnAndResultToStatus(ret, out_result);
}
+ScopedAStatus HealthShim::getHingeInfo(std::vector<HingeInfo>* /*out*/) {
+ return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
ScopedAStatus HealthShim::getDiskStats(std::vector<DiskStats>* out) {
Result out_result = Result::UNKNOWN;
auto ret = service_->getDiskStats([out, &out_result](auto result, const auto& value) {
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/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl b/security/keymint/aidl/android/hardware/security/keymint/KeyCreationResult.aidl
index 4fe3bd9..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 400
- * attestationSecurityLevel SecurityLevel, # See below
- * keyMintVersion INTEGER, # Value 400
- * 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,15 +172,15 @@
* 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 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
+ * version INTEGER, -- As determined at boot time
* }
*
* -- Note that the AuthorizationList SEQUENCE is also used in IKeyMintDevice::importWrappedKey
@@ -181,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,
@@ -195,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,
@@ -221,7 +235,8 @@
* bootPatchLevel [719] EXPLICIT INTEGER OPTIONAL,
* deviceUniqueAttestation [720] EXPLICIT NULL OPTIONAL,
* attestationIdSecondImei [723] EXPLICIT OCTET_STRING OPTIONAL,
- * moduleHash [724] EXPLICIT OCTET_STRING OPTIONAL, -- SHA-256 hash of DER-encoded `Modules`
+ * -- 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/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 51afa12..0ce6a15 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.
@@ -2228,6 +2232,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 +2292,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/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 5467679..b9c742a 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -416,6 +416,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()
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/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
similarity index 85%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
index 50e1bbb..0f61900 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/DiceLeafArtifacts.aidl
@@ -31,10 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
-@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+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/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
similarity index 66%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
index 50e1bbb..9e6a501 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/Error.aidl
@@ -31,10 +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.wifi;
-@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+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/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
similarity index 73%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
index 50e1bbb..a120b49 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/IAuthMgrAuthorization.aidl
@@ -31,10 +31,10 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.security.see.authmgr;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+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/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
similarity index 87%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
index 50e1bbb..46d8373 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/security/see/authmgr/aidl/aidl_api/android.hardware.security.see.authmgr/current/android/hardware/security/see/authmgr/SignedConnectionRequest.aidl
@@ -31,10 +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.wifi;
-@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+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..83b8496 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);
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..44ec32f
--- /dev/null
+++ b/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,298 @@
+/*
+ * 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,
+ /*
+ * This is a shared by a set of devices.
+ */
+ BATCH_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 98%
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 1841bf5..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;
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 99%
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 dc1e6a8..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.
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/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/tv/mediaquality/aidl/Android.bp b/tv/mediaquality/aidl/Android.bp
index 0084248..49cfd80 100644
--- a/tv/mediaquality/aidl/Android.bp
+++ b/tv/mediaquality/aidl/Android.bp
@@ -25,10 +25,11 @@
},
ndk: {
enabled: true,
- min_sdk_version: "29",
+ min_sdk_version: "31",
},
rust: {
enabled: true,
+ min_sdk_version: "31",
},
cpp: {
enabled: 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/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DigitalOutput.aidl
similarity index 90%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DigitalOutput.aidl
index 1e304ab..a6e8b91 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DigitalOutput.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.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum DigitalOutput {
+ AUTO,
+ BYPASS,
+ PCM,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
similarity index 84%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
index 50e1bbb..c29ae18 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
@@ -31,10 +31,17 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable DolbyAudioProcessing {
+ android.hardware.tv.mediaquality.DolbyAudioProcessing.SoundMode soundMode;
+ boolean volumeLeveler;
+ boolean surroundVirtualizer;
+ boolean doblyAtmos;
+ enum SoundMode {
+ GAME,
+ MOVIE,
+ MUSIC,
+ NEWS,
+ }
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DownmixMode.aidl
similarity index 90%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DownmixMode.aidl
index 1e304ab..ecb7db2 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DownmixMode.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.tv.mediaquality;
+@VintfStability
+enum DownmixMode {
+ STEREO,
+ SURROUND,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DtsVirtualX.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DtsVirtualX.aidl
index 50e1bbb..d136dd9 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/DtsVirtualX.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable DtsVirtualX {
+ boolean tbHdx;
+ boolean limiter;
+ boolean truSurroundX;
+ boolean truVolumeHd;
+ boolean dialogClarity;
+ boolean definition;
+ boolean height;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/EqualizerDetail.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/EqualizerDetail.aidl
index 50e1bbb..99543e9 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/EqualizerDetail.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable EqualizerDetail {
+ int band120Hz;
+ int band500Hz;
+ int band1_5kHz;
+ int band5kHz;
+ int band10kHz;
}
diff --git a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
index d2b2bc3..7215464 100644
--- a/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -38,4 +38,19 @@
void setAmbientBacklightDetector(in android.hardware.tv.mediaquality.AmbientBacklightSettings settings);
void setAmbientBacklightDetectionEnabled(in boolean enabled);
boolean getAmbientBacklightDetectionEnabled();
+ boolean isAutoPqSupported();
+ boolean getAutoPqEnabled();
+ void setAutoPqEnabled(boolean enable);
+ boolean isAutoSrSupported();
+ boolean getAutoSrEnabled();
+ void setAutoSrEnabled(boolean enable);
+ boolean isAutoAqSupported();
+ boolean getAutoAqEnabled();
+ void setAutoAqEnabled(boolean enable);
+ android.hardware.tv.mediaquality.IPictureProfileChangedListener getPictureProfileListener();
+ void setPictureProfileAdjustmentListener(android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener listener);
+ android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
+ android.hardware.tv.mediaquality.ISoundProfileChangedListener getSoundProfileListener();
+ void setSoundProfileAdjustmentListener(android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener listener);
+ android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long soundProfileId);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
index 50e1bbb..ae3d391 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+interface IPictureProfileAdjustmentListener {
+ oneway void onPictureProfileAdjusted(in android.hardware.tv.mediaquality.PictureProfile pictureProfile);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
index 50e1bbb..c1bfc36 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+interface IPictureProfileChangedListener {
+ oneway void onPictureProfileChanged(in android.hardware.tv.mediaquality.PictureProfile pictureProfile);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
index 50e1bbb..ceebb1b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+interface ISoundProfileAdjustmentListener {
+ oneway void onSoundProfileAdjusted(in android.hardware.tv.mediaquality.SoundProfile soundProfile);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
index 50e1bbb..d07abe7 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+interface ISoundProfileChangedListener {
+ oneway void onSoundProfileChanged(in android.hardware.tv.mediaquality.SoundProfile soundProfile);
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
index 50e1bbb..134997b 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -31,10 +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.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+union PictureParameter {
+ float brightness;
+ int contrast;
+ int sharpness;
+ int saturation;
+ int hue;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameters.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameters.aidl
index 50e1bbb..627369d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureParameters.aidl
@@ -31,10 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable PictureParameters {
+ android.hardware.tv.mediaquality.PictureParameter[] pictureParameters;
+ ParcelableHolder vendorPictureParameters;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureProfile.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureProfile.aidl
index 50e1bbb..ec2f9ff 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/PictureProfile.aidl
@@ -31,10 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable PictureProfile {
+ long pictureProfileId;
+ android.hardware.tv.mediaquality.PictureParameters parameters;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/QualityLevel.aidl
similarity index 93%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/QualityLevel.aidl
index 1e304ab..a7f130f 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/QualityLevel.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.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.tv.mediaquality;
+@VintfStability
+enum QualityLevel {
+ OFF,
+ LOW,
+ MEDIUM,
+ HIGH,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameter.aidl
similarity index 69%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameter.aidl
index 50e1bbb..63eb55f 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameter.aidl
@@ -31,10 +31,23 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+union SoundParameter {
+ int balance;
+ int bass;
+ int treble;
+ boolean surroundSoundEnabled;
+ android.hardware.tv.mediaquality.EqualizerDetail equalizerDetail;
+ boolean speakersEnabled;
+ int speakersDelayMs;
+ boolean enhancedAudioReturnChannelEnabled;
+ boolean autoVolumeControl;
+ android.hardware.tv.mediaquality.DownmixMode downmixMode;
+ boolean dtsDrc;
+ @nullable android.hardware.tv.mediaquality.DolbyAudioProcessing dolbyAudioProcessing;
+ android.hardware.tv.mediaquality.QualityLevel dolbyDialogueEnhancer;
+ @nullable android.hardware.tv.mediaquality.DtsVirtualX dtsVirtualX;
+ android.hardware.tv.mediaquality.DigitalOutput digitalOutput;
+ int digitalOutputDelayMs;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameters.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameters.aidl
index 50e1bbb..6492163 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundParameters.aidl
@@ -31,10 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable SoundParameters {
+ android.hardware.tv.mediaquality.SoundParameter[] soundParameters;
+ ParcelableHolder vendorSoundParameters;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundProfile.aidl
similarity index 88%
rename from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
rename to tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundProfile.aidl
index 50e1bbb..05f936f 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/tv/mediaquality/aidl/aidl_api/android.hardware.tv.mediaquality/current/android/hardware/tv/mediaquality/SoundProfile.aidl
@@ -31,10 +31,9 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.tv.mediaquality;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable SoundProfile {
+ long soundProfileId;
+ android.hardware.tv.mediaquality.SoundParameters parameters;
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DigitalOutput.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DigitalOutput.aidl
new file mode 100644
index 0000000..1a46ae6
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DigitalOutput.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.tv.mediaquality;
+
+@VintfStability
+enum DigitalOutput {
+ /**
+ * Automatically selects the best audio format to send to the connected audio device
+ * based on the incoming audio stream. This mode prioritizes high-quality formats
+ * like Dolby Digital or DTS if supported by the device, otherwise falls back to PCM.
+ */
+ AUTO,
+
+ /**
+ * Sends the raw, unprocessed audio stream directly to the connected audio device.
+ * This mode requires the audio device to handle decoding and processing of various
+ * audio formats like Dolby Digital or DTS.
+ */
+ BYPASS,
+
+ /**
+ * Converts all incoming audio to 2-channel PCM (Pulse Code Modulation) stereo
+ * before sending it to the audio device. This ensures compatibility with a wide
+ * range of devices but sacrifices surround sound capabilities.
+ */
+ PCM,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
new file mode 100644
index 0000000..d56848c
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DolbyAudioProcessing.aidl
@@ -0,0 +1,64 @@
+/*
+ * 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.tv.mediaquality;
+
+@VintfStability
+parcelable DolbyAudioProcessing {
+ enum SoundMode {
+ GAME,
+ MOVIE,
+ MUSIC,
+ NEWS,
+ }
+
+ /**
+ * sound mode for dolby audio processing.
+ */
+ SoundMode soundMode;
+
+ /**
+ * Indicates whether Volume Leveler is enabled.
+ *
+ * <p>Volume Leveler helps to maintain a consistent volume level across different
+ * types of content and even within the same program. It minimizes the jarring jumps
+ * between loud commercials and quiet dialogue or action sequences.
+ */
+ boolean volumeLeveler;
+
+ /**
+ * Indicates whether Surround Virtualizer is enabled.
+ *
+ * <p>Surround Virtualizer creates a virtual surround sound experience from stereo
+ * content, making it seem like the sound is coming from multiple speakers, even if
+ * you only have your TV's built-in speakers. It expands the soundstage and adds
+ * depth to the audio.
+ */
+ boolean surroundVirtualizer;
+
+ /**
+ * Indicates whether Dolby Atmos is enabled.
+ *
+ * <p>Dolby Atmos creates a more immersive and realistic sound experience by adding
+ * a height dimension to surround sound. It allows sound to be placed and moved
+ * precisely around you, including overhead.
+ *
+ * <p>Note: To experience Dolby Atmos, you need content that has been specifically
+ * mixed in Dolby Atmos and a compatible sound system with upward-firing speakers
+ * or a Dolby Atmos soundbar.
+ */
+ boolean doblyAtmos;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DownmixMode.aidl
similarity index 77%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/DownmixMode.aidl
index f9f608d..c30a0ba 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DownmixMode.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.
@@ -13,6 +13,11 @@
* 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.tv.mediaquality;
+
+@VintfStability
+enum DownmixMode {
+ STEREO,
+ SURROUND,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DtsVirtualX.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DtsVirtualX.aidl
new file mode 100644
index 0000000..b26a41d
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/DtsVirtualX.aidl
@@ -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 android.hardware.tv.mediaquality;
+
+@VintfStability
+parcelable DtsVirtualX {
+ /*
+ * Total Bass Harmonic Distortion (X).
+ * Enables/disables TBHDX bass enhancement. Provides a richer low-frequency experience,
+ * simulating deeper bass.
+ */
+ boolean tbHdx;
+
+ /*
+ * Activates an audio limiter. Prevents excessive volume peaks that could cause distortion
+ * or speaker damage
+ */
+ boolean limiter;
+
+ /*
+ * Enables/disables the core DTS Virtual:X surround sound processing. Creates an immersive,
+ * multi-channel audio experience from the speaker configuration.
+ */
+ boolean truSurroundX;
+
+ /*
+ * Activates DTS TruVolume HD. Reduces the dynamic range of audio, minimizing loudness
+ * variations between content and channels.
+ */
+ boolean truVolumeHd;
+
+ /* Enhances the clarity and intelligibility of speech in audio content. */
+ boolean dialogClarity;
+
+ /* Applies audio processing to improve overall sound definition and clarity. */
+ boolean definition;
+
+ /*
+ * Enables/disables the processing of virtual height channels. Creates a more immersive
+ * audio experience by simulating sounds from above.
+ */
+ boolean height;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/EqualizerDetail.aidl
similarity index 62%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/EqualizerDetail.aidl
index bfa5daa..6eebdc0 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/EqualizerDetail.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,14 @@
* 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.
- */
-parcelable CipherModeParameters {
- byte[16] nonce;
+package android.hardware.tv.mediaquality;
+
+@VintfStability
+parcelable EqualizerDetail {
+ int band120Hz; // Range: -50 to 50
+ int band500Hz; // Range: -50 to 50
+ int band1_5kHz; // Range: -50 to 50
+ int band5kHz; // Range: -50 to 50
+ int band10kHz; // Range: -50 to 50
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
index def9e39..f15d3c6 100644
--- a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IMediaQuality.aidl
@@ -18,6 +18,12 @@
import android.hardware.tv.mediaquality.AmbientBacklightSettings;
import android.hardware.tv.mediaquality.IMediaQualityCallback;
+import android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener;
+import android.hardware.tv.mediaquality.IPictureProfileChangedListener;
+import android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener;
+import android.hardware.tv.mediaquality.ISoundProfileChangedListener;
+import android.hardware.tv.mediaquality.PictureParameters;
+import android.hardware.tv.mediaquality.SoundParameters;
/**
* Interface for the media quality service
@@ -56,4 +62,120 @@
* @return True if the ambient backlight detection is enabled, false otherwise.
*/
boolean getAmbientBacklightDetectionEnabled();
+
+ /**
+ * Check if auto picture quality feature is supported on the current TV device.
+ *
+ * @return true when the device supports the auto picture quality, false when the device does
+ * not supports the auto picture quality.
+ */
+ boolean isAutoPqSupported();
+
+ /**
+ * Get the current state of auto picture quality.
+ *
+ * @return true when auto picture quality is enabled, false when auto picture quality is
+ * disabled.
+ */
+ boolean getAutoPqEnabled();
+
+ /**
+ * Set the auto picture quality enable/disable. Auto picture quality is to adjust the Picture
+ * parameters depends on the current content playing.
+ *
+ * @param enable True to enable, false to disable.
+ */
+ void setAutoPqEnabled(boolean enable);
+
+ /**
+ * Check if auto super resolution feature is supported on the current TV device.
+ *
+ * @return true when the device supports the super resolution feature, false when the device
+ * does not support super resolution.
+ */
+ boolean isAutoSrSupported();
+
+ /**
+ * Get the current state of auto super resolution.
+ *
+ * @return true when auto super resolution is enabled, false when auto super resolution is
+ * disabled.
+ */
+ boolean getAutoSrEnabled();
+
+ /**
+ * Set the auto super resolution enable/disable. Auto super resolution is to analyze the
+ * lower resolution image and invent the missing pixel to make the image looks sharper.
+ *
+ * @param enable True to enable, false to disable.
+ */
+ void setAutoSrEnabled(boolean enable);
+
+ /**
+ * Check if auto sound/audio quality feature is supported on the current TV device.
+ *
+ * @return true when the device supports the auto sound/audio quality, false when
+ * the device does not supports the auto sound/audio quality.
+ */
+ boolean isAutoAqSupported();
+
+ /**
+ * Get the current state of auto sound/audio quality.
+ *
+ * @return true when auto sound/audio quality is enabled, false when auto sound/audio
+ * quality is disabled.
+ */
+ boolean getAutoAqEnabled();
+
+ /**
+ * Set the auto sound/audio quality enable/disable. Auto sound/audio quality is to
+ * adjust the sound parameters depends on the current content playing.
+ *
+ * @param enable True to enable, false to disable.
+ */
+ void setAutoAqEnabled(boolean enable);
+
+ /**
+ * Get picture profile changed listener.
+ *
+ * @return the IPictureProfileChangedListener.
+ */
+ IPictureProfileChangedListener getPictureProfileListener();
+
+ /**
+ * Sets the listener for picture adjustment from the HAL.
+ *
+ * @param IPictureProfileAdjustmentListener listener object to pass picture profile.
+ */
+ void setPictureProfileAdjustmentListener(IPictureProfileAdjustmentListener listener);
+
+ /**
+ * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
+ *
+ * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
+ * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
+ */
+ PictureParameters getPictureParameters(long pictureProfileId);
+
+ /**
+ * Get sound profile changed listener.
+ *
+ * @return the ISoundProfileChangedListener.
+ */
+ ISoundProfileChangedListener getSoundProfileListener();
+
+ /**
+ * Sets the listener for sound adjustment from the HAL.
+ *
+ * @param ISoundProfileAdjustmentListener listener object to pass sound profile.
+ */
+ void setSoundProfileAdjustmentListener(ISoundProfileAdjustmentListener listener);
+
+ /**
+ * Get the sound parameters by SoundProfile id. Check SoundParameters for its' detail.
+ *
+ * @param soundProfileId The SoundProfile id that associate with a SoundProfile.
+ * @return SoundParameters with all the pre-defined parameters and vendor defined parameters.
+ */
+ SoundParameters getSoundParameters(long soundProfileId);
}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.aidl
new file mode 100644
index 0000000..52759f7
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileAdjustmentListener.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.PictureProfile;
+
+@VintfStability
+oneway interface IPictureProfileAdjustmentListener {
+ /**
+ * Notifies Media Quality Manager when the picture profile changed.
+ *
+ * @param pictureProfile Picture profile.
+ */
+ void onPictureProfileAdjusted(in PictureProfile pictureProfile);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileChangedListener.aidl
new file mode 100644
index 0000000..35112e1
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/IPictureProfileChangedListener.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.PictureProfile;
+
+@VintfStability
+oneway interface IPictureProfileChangedListener {
+ /**
+ * Notifies the composer HAL that the picture profile has changed. For picture profile details,
+ * check PictureProfile.
+ *
+ * @param pictureProfile Picture profile passed to the composer HAL.
+ */
+ void onPictureProfileChanged(in PictureProfile pictureProfile);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.aidl
new file mode 100644
index 0000000..fd41352
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileAdjustmentListener.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.SoundProfile;
+
+@VintfStability
+oneway interface ISoundProfileAdjustmentListener {
+ /**
+ * Notifies Media Quality Manager when the sound profile changed.
+ *
+ * @param soundProfile Sound profile.
+ */
+ void onSoundProfileAdjusted(in SoundProfile soundProfile);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileChangedListener.aidl
new file mode 100644
index 0000000..cb2d75e
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/ISoundProfileChangedListener.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.SoundProfile;
+
+@VintfStability
+oneway interface ISoundProfileChangedListener {
+ /**
+ * Notifies the audio HAL that the sound profile has changed. For sound profile details,
+ * check SoundProfile.
+ *
+ * @param soundProfile Sound profile passed to the audio HAL.
+ */
+ void onSoundProfileChanged(in SoundProfile soundProfile);
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
new file mode 100644
index 0000000..342b593
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameter.aidl
@@ -0,0 +1,65 @@
+/*
+ * 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.tv.mediaquality;
+
+/**
+ * The parameters for Picture Profile.
+ */
+@VintfStability
+union PictureParameter {
+ /*
+ * Brightness field represents the brightness level of the TV.
+ * Brightness value range are from 0.0 to 1.0, where 0.0 represents the minimum brightness and
+ * 1.0 represents the maximum brightness. The content-unmodified value is 0.5.
+ *
+ * note: when a picture profile is applied to the entire display, the media quality framework
+ * will synchronize the brightness field.
+ */
+ float brightness;
+
+ /*
+ * This value represents the image contrast on an arbitrary scale from 0 to 100,
+ * where 0 represents the darkest black (black screen) and 100 represents the brightest
+ * white (brighter).
+ * The default/unmodified value for contrast is 50.
+ */
+ int contrast;
+
+ /*
+ * Control that increases edge contrast so that objects become more distinct.
+ * Sharpness value range are from 0 to 100, where 0 represents the minimum sharpness that
+ * makes the image appear softer with less defined edges, 100 represents the maximum
+ * sharpness that makes the image appear halos around objects due to excessive edges.
+ * The default/unmodified value for sharpness is 50.
+ */
+ int sharpness;
+
+ /*
+ * Saturation value controls the intensity or purity of colors.
+ * Saturation values are from 0 to 100, where 0 represents grayscale (no color) and 100
+ * represents the most vivid colors.
+ * The default/unmodified value for saturation is 50.
+ */
+ int saturation;
+
+ /*
+ * Hue affects the balance between red, green and blue primary colors on the screen.
+ * Hue values are from -50 to 50, where -50 represents cooler and 50 represents warmer.
+ * The default/unmodified value for hue is 0.
+ */
+ int hue;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameters.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameters.aidl
new file mode 100644
index 0000000..e5f6b83
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureParameters.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.PictureParameter;
+
+/**
+ * The pre-defined parameters and vendor parameters for Picture Profile.
+ */
+@VintfStability
+parcelable PictureParameters {
+ /* Pre-defined picture parameters. */
+ PictureParameter[] pictureParameters;
+
+ /* Vendor defined picture parameters. */
+ ParcelableHolder vendorPictureParameters;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureProfile.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureProfile.aidl
new file mode 100644
index 0000000..7e02350
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/PictureProfile.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.PictureParameters;
+
+/**
+ * Picture profile that includes all the parameters.
+ */
+@VintfStability
+parcelable PictureProfile {
+ long pictureProfileId;
+
+ /* Picture parameters that associate with the id. */
+ PictureParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/QualityLevel.aidl
similarity index 82%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/QualityLevel.aidl
index f9f608d..e0171ca 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/QualityLevel.aidl
@@ -13,6 +13,13 @@
* 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.tv.mediaquality;
+
+@VintfStability
+enum QualityLevel {
+ OFF,
+ LOW,
+ MEDIUM,
+ HIGH,
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameter.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameter.aidl
new file mode 100644
index 0000000..4714ad2
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameter.aidl
@@ -0,0 +1,95 @@
+/*
+ * 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.DigitalOutput;
+import android.hardware.tv.mediaquality.DolbyAudioProcessing;
+import android.hardware.tv.mediaquality.DownmixMode;
+import android.hardware.tv.mediaquality.DtsVirtualX;
+import android.hardware.tv.mediaquality.EqualizerDetail;
+import android.hardware.tv.mediaquality.QualityLevel;
+
+/**
+ * The parameters for Sound Profile.
+ */
+@VintfStability
+union SoundParameter {
+ /*
+ * This parameter controls the balance between the left and tight speakers.
+ * The valid range is -50 to 50, where:
+ * - Negative values shift the balance towards the left speaker.
+ * - Positive values shift the balance towards the right speaker.
+ * - 0 represents a balanced output.
+ */
+ int balance;
+
+ /*
+ * Bass controls the intensity of low-frequency sounds.
+ * The valid range is 0 - 100.
+ */
+ int bass;
+
+ /*
+ * Treble controls the intensity of high-frequency sounds.
+ * The valid range is 0 - 100.
+ */
+ int treble;
+
+ /* Enable surround sound. */
+ boolean surroundSoundEnabled;
+
+ /*
+ * Equalizer can fine-tune the audio output by adjusting the loudness of different
+ * frequency bands;
+ * The frequency bands are 120Hz, 500Hz, 1.5kHz, 5kHz, 10kHz.
+ * Each band have a value of -50 to 50.
+ */
+ EqualizerDetail equalizerDetail;
+
+ /* Enable speaker output. */
+ boolean speakersEnabled;
+
+ /* Speaker delay in ms. */
+ int speakersDelayMs;
+
+ /* eARC allows for higher bandwidth audio transmission over HDMI */
+ boolean enhancedAudioReturnChannelEnabled;
+
+ /* Enable auto volume control sound effect. */
+ boolean autoVolumeControl;
+
+ /* Enable downmix mode. */
+ DownmixMode downmixMode;
+
+ /* Enable dynamic range compression */
+ boolean dtsDrc;
+
+ /* Sound effects from Dobly */
+ @nullable DolbyAudioProcessing dolbyAudioProcessing;
+
+ /* Sound effect from Dolby. */
+ QualityLevel dolbyDialogueEnhancer;
+
+ /* Sound effect from DTS. */
+ @nullable DtsVirtualX dtsVirtualX;
+
+ /* Digital output mode. */
+ DigitalOutput digitalOutput;
+
+ /* Digital output delay in ms. */
+ int digitalOutputDelayMs;
+}
diff --git a/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameters.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameters.aidl
new file mode 100644
index 0000000..2fe0ce7
--- /dev/null
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundParameters.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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.SoundParameter;
+
+/**
+ * The pre-defined parameters and vendor parameters for Sound Profile.
+ */
+@VintfStability
+parcelable SoundParameters {
+ /* Pre-defined sound parameters. */
+ SoundParameter[] soundParameters;
+
+ /* Vendor defined sound parameters. */
+ ParcelableHolder vendorSoundParameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundProfile.aidl
similarity index 60%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
copy to tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundProfile.aidl
index bfa5daa..27628eb 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
+++ b/tv/mediaquality/aidl/android/hardware/tv/mediaquality/SoundProfile.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,18 @@
* 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.tv.mediaquality;
+
+import android.hardware.tv.mediaquality.SoundParameters;
+
+/**
+ * Sound profile that includes all the parameters.
*/
-parcelable CipherModeParameters {
- byte[16] nonce;
+@VintfStability
+parcelable SoundProfile {
+ long soundProfileId;
+
+ /* Sound parameters that associate with the id. */
+ SoundParameters parameters;
}
diff --git a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
index 8769804..a579e66 100644
--- a/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
+++ b/tv/mediaquality/aidl/default/hal/media_quality_hal_impl.rs
@@ -20,17 +20,36 @@
IMediaQualityCallback::IMediaQualityCallback,
AmbientBacklightEvent::AmbientBacklightEvent,
AmbientBacklightSettings::AmbientBacklightSettings,
+ IPictureProfileAdjustmentListener::IPictureProfileAdjustmentListener,
+ IPictureProfileChangedListener::IPictureProfileChangedListener,
+ PictureParameter::PictureParameter,
+ PictureParameters::PictureParameters,
+ ISoundProfileAdjustmentListener::ISoundProfileAdjustmentListener,
+ ISoundProfileChangedListener::ISoundProfileChangedListener,
+ SoundParameter::SoundParameter,
+ SoundParameters::SoundParameters,
};
-use binder::Interface;
+use binder::{Interface, ParcelableHolder, Strong};
use std::sync::{Arc, Mutex};
use std::thread;
-use binder::Strong;
/// Defined so we can implement the IMediaQuality AIDL interface.
pub struct MediaQualityService {
callback: Arc<Mutex<Option<Strong<dyn IMediaQualityCallback>>>>,
ambient_backlight_enabled: Arc<Mutex<bool>>,
- ambient_backlight_detector_settings: Arc<Mutex<AmbientBacklightSettings>>
+ ambient_backlight_detector_settings: Arc<Mutex<AmbientBacklightSettings>>,
+ auto_pq_supported: Arc<Mutex<bool>>,
+ auto_pq_enabled: Arc<Mutex<bool>>,
+ auto_sr_supported: Arc<Mutex<bool>>,
+ auto_sr_enabled: Arc<Mutex<bool>>,
+ auto_aq_supported: Arc<Mutex<bool>>,
+ auto_aq_enabled: Arc<Mutex<bool>>,
+ picture_profile_adjustment_listener:
+ Arc<Mutex<Option<Strong<dyn IPictureProfileAdjustmentListener>>>>,
+ sound_profile_adjustment_listener:
+ Arc<Mutex<Option<Strong<dyn ISoundProfileAdjustmentListener>>>>,
+ picture_profile_changed_listener: Arc<Mutex<Option<Strong<dyn IPictureProfileChangedListener>>>>,
+ sound_profile_changed_listener: Arc<Mutex<Option<Strong<dyn ISoundProfileChangedListener>>>>,
}
impl MediaQualityService {
@@ -42,6 +61,16 @@
ambient_backlight_enabled: Arc::new(Mutex::new(true)),
ambient_backlight_detector_settings:
Arc::new(Mutex::new(AmbientBacklightSettings::default())),
+ auto_pq_supported: Arc::new(Mutex::new(false)),
+ auto_pq_enabled: Arc::new(Mutex::new(false)),
+ auto_sr_supported: Arc::new(Mutex::new(false)),
+ auto_sr_enabled: Arc::new(Mutex::new(false)),
+ auto_aq_supported: Arc::new(Mutex::new(false)),
+ auto_aq_enabled: Arc::new(Mutex::new(false)),
+ picture_profile_adjustment_listener: Arc::new(Mutex::new(None)),
+ sound_profile_adjustment_listener: Arc::new(Mutex::new(None)),
+ picture_profile_changed_listener: Arc::new(Mutex::new(None)),
+ sound_profile_changed_listener: Arc::new(Mutex::new(None)),
}
}
}
@@ -111,4 +140,137 @@
let ambient_backlight_enabled = self.ambient_backlight_enabled.lock().unwrap();
Ok(*ambient_backlight_enabled)
}
+
+ fn isAutoPqSupported(&self) -> binder::Result<bool> {
+ let auto_pq_supported = self.auto_pq_supported.lock().unwrap();
+ Ok(*auto_pq_supported)
+ }
+
+ fn getAutoPqEnabled(&self) -> binder::Result<bool> {
+ let auto_pq_enabled = self.auto_pq_enabled.lock().unwrap();
+ Ok(*auto_pq_enabled)
+ }
+
+ fn setAutoPqEnabled(&self, enabled: bool) -> binder::Result<()> {
+ let mut auto_pq_enabled = self.auto_pq_enabled.lock().unwrap();
+ *auto_pq_enabled = enabled;
+ if enabled {
+ println!("Enable auto picture quality");
+ } else {
+ println!("Disable auto picture quality");
+ }
+ Ok(())
+ }
+
+ fn isAutoSrSupported(&self) -> binder::Result<bool> {
+ let auto_sr_supported = self.auto_sr_supported.lock().unwrap();
+ Ok(*auto_sr_supported)
+ }
+
+ fn getAutoSrEnabled(&self) -> binder::Result<bool> {
+ let auto_sr_enabled = self.auto_sr_enabled.lock().unwrap();
+ Ok(*auto_sr_enabled)
+ }
+
+ fn setAutoSrEnabled(&self, enabled: bool) -> binder::Result<()> {
+ let mut auto_sr_enabled = self.auto_sr_enabled.lock().unwrap();
+ *auto_sr_enabled = enabled;
+ if enabled {
+ println!("Enable auto super resolution");
+ } else {
+ println!("Disable auto super resolution");
+ }
+ Ok(())
+ }
+
+ fn isAutoAqSupported(&self) -> binder::Result<bool> {
+ let auto_aq_supported = self.auto_aq_supported.lock().unwrap();
+ Ok(*auto_aq_supported)
+ }
+
+ fn getAutoAqEnabled(&self) -> binder::Result<bool> {
+ let auto_aq_enabled = self.auto_aq_enabled.lock().unwrap();
+ Ok(*auto_aq_enabled)
+ }
+
+ fn setAutoAqEnabled(&self, enabled: bool) -> binder::Result<()> {
+ let mut auto_aq_enabled = self.auto_aq_enabled.lock().unwrap();
+ *auto_aq_enabled = enabled;
+ if enabled {
+ println!("Enable auto audio quality");
+ } else {
+ println!("Disable auto audio quality");
+ }
+ Ok(())
+ }
+
+ fn getPictureProfileListener(&self) -> binder::Result<binder::Strong<dyn IPictureProfileChangedListener>> {
+ println!("getPictureProfileListener");
+ let listener = self.picture_profile_changed_listener.lock().unwrap();
+ listener.clone().ok_or(binder::StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn setPictureProfileAdjustmentListener(
+ &self,
+ picture_profile_adjustment_listener: &Strong<dyn IPictureProfileAdjustmentListener>
+ ) -> binder::Result<()> {
+ println!("Received picture profile adjustment");
+ let mut listener = self.picture_profile_adjustment_listener.lock().unwrap();
+ *listener = Some(picture_profile_adjustment_listener.clone());
+ Ok(())
+ }
+
+ fn getPictureParameters(&self, id: i64) -> binder::Result<PictureParameters>{
+ let picture_parameters = match id {
+ 1 => {
+ vec![
+ PictureParameter::Brightness(0.5),
+ PictureParameter::Contrast(50),
+ ]
+ },
+ _ => vec![]
+ };
+
+ let picture_params = PictureParameters {
+ pictureParameters: picture_parameters,
+ vendorPictureParameters: ParcelableHolder::default(),
+ };
+
+ Ok(picture_params)
+ }
+
+ fn getSoundProfileListener(&self) -> binder::Result<binder::Strong<dyn ISoundProfileChangedListener>> {
+ println!("getSoundProfileListener");
+ let listener = self.sound_profile_changed_listener.lock().unwrap();
+ listener.clone().ok_or(binder::StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn setSoundProfileAdjustmentListener(
+ &self,
+ sound_profile_adjustment_listener: &Strong<dyn ISoundProfileAdjustmentListener>
+ ) -> binder::Result<()> {
+ println!("Received sound profile adjustment");
+ let mut listener = self.sound_profile_adjustment_listener.lock().unwrap();
+ *listener = Some(sound_profile_adjustment_listener.clone());
+ Ok(())
+ }
+
+ fn getSoundParameters(&self, id: i64) -> binder::Result<SoundParameters>{
+ let sound_parameters = match id {
+ 1 => {
+ vec![
+ SoundParameter::Balance(50),
+ SoundParameter::Bass(50),
+ ]
+ },
+ _ => vec![]
+ };
+
+ let sound_params = SoundParameters {
+ soundParameters: sound_parameters,
+ vendorSoundParameters: ParcelableHolder::default(),
+ };
+
+ Ok(sound_params)
+ }
}
diff --git a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
index c11ebcb..c1cc898 100644
--- a/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
+++ b/tv/mediaquality/aidl/vts/functional/VtsHalMediaQualityTest.cpp
@@ -20,7 +20,14 @@
#include <aidl/android/hardware/tv/mediaquality/AmbientBacklightEvent.h>
#include <aidl/android/hardware/tv/mediaquality/AmbientBacklightSettings.h>
#include <aidl/android/hardware/tv/mediaquality/BnMediaQualityCallback.h>
+#include <aidl/android/hardware/tv/mediaquality/BnPictureProfileAdjustmentListener.h>
+#include <aidl/android/hardware/tv/mediaquality/BnSoundProfileAdjustmentListener.h>
#include <aidl/android/hardware/tv/mediaquality/IMediaQuality.h>
+#include <aidl/android/hardware/tv/mediaquality/PictureParameters.h>
+#include <aidl/android/hardware/tv/mediaquality/PictureProfile.h>
+#include <aidl/android/hardware/tv/mediaquality/SoundParameters.h>
+#include <aidl/android/hardware/tv/mediaquality/SoundProfile.h>
+
#include <android/binder_auto_utils.h>
#include <android/binder_manager.h>
#include <binder/IServiceManager.h>
@@ -32,7 +39,13 @@
using aidl::android::hardware::tv::mediaquality::AmbientBacklightSettings;
using aidl::android::hardware::tv::mediaquality::AmbientBacklightSource;
using aidl::android::hardware::tv::mediaquality::BnMediaQualityCallback;
+using aidl::android::hardware::tv::mediaquality::BnPictureProfileAdjustmentListener;
+using aidl::android::hardware::tv::mediaquality::BnSoundProfileAdjustmentListener;
using aidl::android::hardware::tv::mediaquality::IMediaQuality;
+using aidl::android::hardware::tv::mediaquality::PictureParameters;
+using aidl::android::hardware::tv::mediaquality::PictureProfile;
+using aidl::android::hardware::tv::mediaquality::SoundParameters;
+using aidl::android::hardware::tv::mediaquality::SoundProfile;
using android::ProcessState;
using android::String16;
using ndk::ScopedAStatus;
@@ -55,6 +68,36 @@
std::function<void(const AmbientBacklightEvent& event)> on_hal_event_cb_;
};
+class PictureProfileAdjustmentListener : public BnPictureProfileAdjustmentListener {
+ public:
+ explicit PictureProfileAdjustmentListener(
+ const std::function<void(const PictureProfile& pictureProfile)>&
+ on_hal_picture_profile_adjust)
+ : on_hal_picture_profile_adjust_(on_hal_picture_profile_adjust) {}
+ ScopedAStatus onPictureProfileAdjusted(const PictureProfile& pictureProfile) override {
+ on_hal_picture_profile_adjust_(pictureProfile);
+ return ScopedAStatus::ok();
+ }
+
+ private:
+ std::function<void(const PictureProfile& pictureProfile)> on_hal_picture_profile_adjust_;
+};
+
+class SoundProfileAdjustmentListener : public BnSoundProfileAdjustmentListener {
+ public:
+ explicit SoundProfileAdjustmentListener(
+ const std::function<void(const SoundProfile& soundProfile)>&
+ on_hal_sound_profile_adjust)
+ : on_hal_sound_profile_adjust_(on_hal_sound_profile_adjust) {}
+ ScopedAStatus onSoundProfileAdjusted(const SoundProfile& soundProfile) override {
+ on_hal_sound_profile_adjust_(soundProfile);
+ return ScopedAStatus::ok();
+ }
+
+ private:
+ std::function<void(const SoundProfile& soundProfile)> on_hal_sound_profile_adjust_;
+};
+
class MediaQualityAidl : public testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
@@ -92,6 +135,34 @@
ASSERT_OK(mediaquality->setCallback(callback));
}
+TEST_P(MediaQualityAidl, TestSetPictureProfileAdjustmentListener) {
+ std::shared_ptr<PictureProfileAdjustmentListener> listener =
+ ndk::SharedRefBase::make<PictureProfileAdjustmentListener>(
+ [](auto /*picture profile*/) { return ScopedAStatus::ok(); });
+ ASSERT_OK(mediaquality->setPictureProfileAdjustmentListener(listener));
+}
+
+TEST_P(MediaQualityAidl, TestGetPictureParameters) {
+ PictureParameters pictureParams;
+ auto result = mediaquality->getPictureParameters(1, &pictureParams);
+ ASSERT_TRUE(result.isOk());
+ ASSERT_EQ(pictureParams.pictureParameters.size(), 2);
+}
+
+TEST_P(MediaQualityAidl, TestSetSoundProfileAdjustmentListener) {
+ std::shared_ptr<SoundProfileAdjustmentListener> listener =
+ ndk::SharedRefBase::make<SoundProfileAdjustmentListener>(
+ [](auto /*sound profile*/) { return ScopedAStatus::ok(); });
+ ASSERT_OK(mediaquality->setSoundProfileAdjustmentListener(listener));
+}
+
+TEST_P(MediaQualityAidl, TestGetSoundParameters) {
+ SoundParameters soundParams;
+ auto result = mediaquality->getSoundParameters(1, &soundParams);
+ ASSERT_TRUE(result.isOk());
+ ASSERT_EQ(soundParams.soundParameters.size(), 2);
+}
+
TEST_P(MediaQualityAidl, TestSetAmbientBacklightDetector) {
AmbientBacklightSettings in_settings = {
.packageName = "com.android.mediaquality",
@@ -105,6 +176,48 @@
ASSERT_OK(mediaquality->setAmbientBacklightDetector(in_settings));
}
+TEST_P(MediaQualityAidl, TestIsAutoPqSupported) {
+ bool supported;
+ ASSERT_OK(mediaquality->isAutoPqSupported(&supported));
+}
+
+TEST_P(MediaQualityAidl, TestGetAutoPqEnabled) {
+ bool enabled;
+ ASSERT_OK(mediaquality->getAutoPqEnabled(&enabled));
+}
+
+TEST_P(MediaQualityAidl, TestSetAutoPqEnabled) {
+ ASSERT_OK(mediaquality->setAutoPqEnabled(true));
+}
+
+TEST_P(MediaQualityAidl, TestIsAutoSrSupported) {
+ bool supported;
+ ASSERT_OK(mediaquality->isAutoSrSupported(&supported));
+}
+
+TEST_P(MediaQualityAidl, TestGetAutoSrEnabled) {
+ bool enabled;
+ ASSERT_OK(mediaquality->getAutoSrEnabled(&enabled));
+}
+
+TEST_P(MediaQualityAidl, TestSetAutoSrEnabled) {
+ ASSERT_OK(mediaquality->setAutoSrEnabled(true));
+}
+
+TEST_P(MediaQualityAidl, TestIsAutoAqSupported) {
+ bool supported;
+ ASSERT_OK(mediaquality->isAutoAqSupported(&supported));
+}
+
+TEST_P(MediaQualityAidl, TestGetAutoAqEnabled) {
+ bool enabled;
+ ASSERT_OK(mediaquality->getAutoAqEnabled(&enabled));
+}
+
+TEST_P(MediaQualityAidl, TestSetAutoAqEnabled) {
+ ASSERT_OK(mediaquality->setAutoAqEnabled(true));
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MediaQualityAidl);
INSTANTIATE_TEST_SUITE_P(
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
index 1af0d65..6482eac 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
@@ -94,7 +94,7 @@
*/
@PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData);
void setVoipMode(in android.hardware.wifi.IWifiChip.VoipMode mode);
- @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIfaceWithParams(in android.hardware.wifi.ApIfaceParams params);
+ @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIfaceWithParams(in android.hardware.wifi.IWifiChip.ApIfaceParams params);
const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
@Backing(type="int") @VintfStability
enum FeatureSetMask {
@@ -191,4 +191,10 @@
HIGH_THROUGHPUT = 2,
LOW_POWER = 3,
}
+ @VintfStability
+ parcelable ApIfaceParams {
+ android.hardware.wifi.IfaceConcurrencyType ifaceType;
+ boolean usesMlo;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+ }
}
diff --git a/wifi/aidl/android/hardware/wifi/ApIfaceParams.aidl b/wifi/aidl/android/hardware/wifi/ApIfaceParams.aidl
deleted file mode 100644
index f075b72..0000000
--- a/wifi/aidl/android/hardware/wifi/ApIfaceParams.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.wifi;
-
-import android.hardware.wifi.IfaceConcurrencyType;
-import android.hardware.wifi.common.OuiKeyedData;
-
-/**
- * Parameters to use for setting up the access point interfaces.
- */
-@VintfStability
-parcelable ApIfaceParams {
- /**
- * IfaceConcurrencyType to be created. Takes one of
- * |IfaceConcurrencyType.AP| or |IfaceConcurrencyType.AP_BRIDGED|
- */
- IfaceConcurrencyType ifaceType;
- /**
- * Whether the current iface will be operated on Multi-links on the one MLD device (MLO).
- */
- boolean usesMlo;
- /**
- * Optional vendor-specific configuration parameters.
- */
- @nullable OuiKeyedData[] vendorData;
-}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index 04f31d2..78508cf 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -17,7 +17,6 @@
package android.hardware.wifi;
import android.hardware.wifi.AfcChannelAllowance;
-import android.hardware.wifi.ApIfaceParams;
import android.hardware.wifi.IWifiApIface;
import android.hardware.wifi.IWifiChipEventCallback;
import android.hardware.wifi.IWifiNanIface;
@@ -1222,6 +1221,26 @@
void setVoipMode(in VoipMode mode);
/**
+ * Parameters for setting up access point (AP) interfaces.
+ */
+ @VintfStability
+ parcelable ApIfaceParams {
+ /**
+ * IfaceConcurrencyType to be created. Takes one of
+ * |IfaceConcurrencyType.AP| or |IfaceConcurrencyType.AP_BRIDGED|
+ */
+ IfaceConcurrencyType ifaceType;
+ /**
+ * Whether the current iface will be operated on Multi-links on the one MLD device (MLO).
+ */
+ boolean usesMlo;
+ /**
+ * Optional vendor-specific configuration parameters.
+ */
+ @nullable OuiKeyedData[] vendorData;
+ }
+
+ /**
* Create an AP or bridged AP iface on the chip based on ApIfaceParamss.
*
* Depending on the mode the chip is configured in, the interface creation
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapd.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapd.aidl
index ff941fd..3898bb8 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapd.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapd.aidl
@@ -40,4 +40,5 @@
void removeAccessPoint(in String ifaceName);
void setDebugParams(in android.hardware.wifi.hostapd.DebugLevel level);
oneway void terminate();
+ void removeLinkFromMultipleLinkBridgedApIface(in String ifaceName, in String linkIdentity);
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapd.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapd.aidl
index d2f4795..cd552ab 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapd.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapd.aidl
@@ -103,4 +103,22 @@
* wait to be restarted.
*/
oneway void terminate();
+
+ /**
+ * Removes an existing link from multiple link device which the current AP resides on.
+ *
+ * The multiple link device is an access point which was added by |IHostapd.addAccessPoint| with
+ * |IfaceParams.usesMlo| set to true.
+ *
+ * @param ifaceName Name of the interface which was added by |IHostapd.addAccessPoint|
+ * @param linkIdentity the identity of the link which associated to the multiple link device
+ * that the current AP resides on. The link identity should be one of the identities provided in
+ * |IfaceParams.instanceIdentities| when this iface was created.
+ * @throws ServiceSpecificException with one of the following values:
+ * |HostapdStatusCode.FAILURE_UNKNOWN|,
+ * |HostapdStatusCode.FAILURE_ARGS_INVALID| when the linkIdentity mis-matches one of the
+ * identities provided in |IfaceParams.instanceIdentities|.
+ * |HostapdStatusCode.FAILURE_IFACE_UNKNOWN| when current existing AP isn't using mlo.
+ */
+ void removeLinkFromMultipleLinkBridgedApIface(in String ifaceName, in String linkIdentity);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 917668e..2704e5c 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -103,5 +103,12 @@
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
void configureMscs(in android.hardware.wifi.supplicant.MscsParams params);
void disableMscs();
+ android.hardware.wifi.supplicant.UsdCapabilities getUsdCapabilities();
+ int startUsdPublish(in int cmdId, in android.hardware.wifi.supplicant.UsdPublishConfig usdPublishConfig);
+ int startUsdSubscribe(in int cmdId, in android.hardware.wifi.supplicant.UsdSubscribeConfig usdSubscribeConfig);
+ void updateUsdPublish(in int publishId, in byte[] serviceSpecificInfo);
+ void cancelUsdPublish(in int publishId);
+ void cancelUsdSubscribe(in int subscribeId);
+ void sendUsdMessage(in android.hardware.wifi.supplicant.UsdMessageInfo messageInfo);
const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index e96b386..1eb07d5 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -82,6 +82,15 @@
oneway void onSupplicantStateChanged(in android.hardware.wifi.supplicant.SupplicantStateChangeData stateChangeData);
oneway void onQosPolicyResponseForScs(in android.hardware.wifi.supplicant.QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus);
oneway void onPmkSaCacheAdded(in android.hardware.wifi.supplicant.PmkSaCacheData pmkSaData);
+ oneway void onUsdPublishStarted(in int cmdId, in int publishId);
+ oneway void onUsdSubscribeStarted(in int cmdId, in int subscribeId);
+ oneway void onUsdPublishConfigFailed(in int cmdId);
+ oneway void onUsdSubscribeConfigFailed(in int cmdId);
+ oneway void onUsdPublishTerminated(in int publishId, in android.hardware.wifi.supplicant.UsdReasonCode reasonCode);
+ oneway void onUsdSubscribeTerminated(in int subscribeId, in android.hardware.wifi.supplicant.UsdReasonCode reasonCode);
+ oneway void onUsdPublishReplied(in android.hardware.wifi.supplicant.UsdServiceDiscoveryInfo info);
+ oneway void onUsdServiceDiscovered(in android.hardware.wifi.supplicant.UsdServiceDiscoveryInfo info);
+ oneway void onUsdMessageReceived(in android.hardware.wifi.supplicant.UsdMessageInfo messageInfo);
@Backing(type="int") @VintfStability
enum MloLinkInfoChangeReason {
TID_TO_LINK_MAP = 0,
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
index 8bda324..05226c8 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MloLink.aidl
@@ -40,4 +40,5 @@
byte tidsDownlinkMap;
@nullable byte[6] apLinkMacAddress;
int frequencyMHz;
+ android.hardware.wifi.supplicant.WifiChannelWidthInMhz channelBandwidth;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdBaseConfig.aidl
similarity index 83%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdBaseConfig.aidl
index 50e1bbb..8d23922 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdBaseConfig.aidl
@@ -31,10 +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.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdBaseConfig {
+ @utf8InCpp String serviceName;
+ android.hardware.wifi.supplicant.UsdServiceProtoType serviceProtoType;
+ byte[] serviceSpecificInfo;
+ @nullable byte[] txMatchFilter;
+ @nullable byte[] rxMatchfilter;
+ int ttlSec;
+ int defaultFreqMhz;
+ int[] freqsMhz;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdCapabilities.aidl
similarity index 84%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdCapabilities.aidl
index 50e1bbb..1c5ad67 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdCapabilities.aidl
@@ -31,10 +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.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdCapabilities {
+ boolean isUsdPublisherSupported;
+ boolean isUsdSubscriberSupported;
+ int maxLocalSsiLengthBytes;
+ int maxServiceNameLengthBytes;
+ int maxMatchFilterLengthBytes;
+ int maxNumPublishSessions;
+ int maxNumSubscribeSessions;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdMessageInfo.aidl
similarity index 88%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdMessageInfo.aidl
index 50e1bbb..40468bd 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdMessageInfo.aidl
@@ -31,10 +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.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdMessageInfo {
+ int ownId;
+ int peerId;
+ byte[6] peerMacAddress;
+ byte[] message;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishConfig.aidl
similarity index 78%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishConfig.aidl
index 50e1bbb..791de52 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishConfig.aidl
@@ -31,10 +31,17 @@
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
-package android.hardware.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdPublishConfig {
+ android.hardware.wifi.supplicant.UsdBaseConfig usdBaseConfig;
+ android.hardware.wifi.supplicant.UsdPublishConfig.PublishType publishType;
+ boolean isFsd;
+ int announcementPeriodMillis;
+ android.hardware.wifi.supplicant.UsdPublishTransmissionType transmissionType;
+ enum PublishType {
+ SOLICITED_ONLY = 0,
+ UNSOLICITED_ONLY = 1,
+ SOLICITED_AND_UNSOLICITED = 2,
+ }
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishTransmissionType.aidl
similarity index 88%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishTransmissionType.aidl
index 1e304ab..9486cd0 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdPublishTransmissionType.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.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum UsdPublishTransmissionType {
+ UNICAST = 0,
+ MULTICAST = 1,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdReasonCode.aidl
similarity index 87%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdReasonCode.aidl
index 50e1bbb..0600def 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdReasonCode.aidl
@@ -31,10 +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.wifi;
-@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+package android.hardware.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum UsdReasonCode {
+ FAILURE_UNKNOWN = 0,
+ TIMEOUT = 1,
+ USER_REQUESTED = 2,
+ INVALID_ARGS = 3,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl
similarity index 85%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl
index 50e1bbb..3940ece 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl
@@ -31,10 +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.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdServiceDiscoveryInfo {
+ int ownId;
+ int peerId;
+ byte[6] peerMacAddress;
+ byte[] matchFilter;
+ android.hardware.wifi.supplicant.UsdServiceProtoType protoType;
+ byte[] serviceSpecificInfo;
+ boolean isFsd;
}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceProtoType.aidl
similarity index 88%
copy from staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceProtoType.aidl
index 1e304ab..4d4a4f5 100644
--- a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/ProtectionId.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdServiceProtoType.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.types;
-enum ProtectionId {
- WIDEVINE_OUTPUT_BUFFER = 1,
+package android.hardware.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum UsdServiceProtoType {
+ UNKNOWN = 0,
+ GENERIC = 1,
+ CSA_MATTER = 2,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl
similarity index 83%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl
index 50e1bbb..6aede8c 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl
@@ -31,10 +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.wifi;
+package android.hardware.wifi.supplicant;
@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+parcelable UsdSubscribeConfig {
+ android.hardware.wifi.supplicant.UsdBaseConfig usdBaseConfig;
+ android.hardware.wifi.supplicant.UsdSubscribeConfig.SubscribeType subscribeType;
+ int queryPeriodMillis;
+ enum SubscribeType {
+ PASSIVE_MODE = 0,
+ ACTIVE_MODE = 1,
+ }
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.aidl
similarity index 85%
copy from wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
copy to wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.aidl
index 50e1bbb..e36c4f2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/ApIfaceParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.aidl
@@ -31,10 +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.wifi;
-@VintfStability
-parcelable ApIfaceParams {
- android.hardware.wifi.IfaceConcurrencyType ifaceType;
- boolean usesMlo;
- @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+package android.hardware.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum WifiChannelWidthInMhz {
+ WIDTH_INVALID = (-1) /* -1 */,
+ WIDTH_20 = 0,
+ WIDTH_40 = 1,
+ WIDTH_80 = 2,
+ WIDTH_160 = 3,
+ WIDTH_80P80 = 4,
+ WIDTH_5 = 5,
+ WIDTH_10 = 6,
+ WIDTH_320 = 7,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index fb1673e..f3703e8 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -35,6 +35,10 @@
import android.hardware.wifi.supplicant.QosPolicyStatus;
import android.hardware.wifi.supplicant.RxFilterType;
import android.hardware.wifi.supplicant.SignalPollResult;
+import android.hardware.wifi.supplicant.UsdCapabilities;
+import android.hardware.wifi.supplicant.UsdMessageInfo;
+import android.hardware.wifi.supplicant.UsdPublishConfig;
+import android.hardware.wifi.supplicant.UsdSubscribeConfig;
import android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -877,4 +881,87 @@
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
void disableMscs();
+
+ /**
+ * Retrieve capabilities related to Unsynchronized Service Discovery (USD).
+ *
+ * @return Instance of |UsdCapabilities| containing the capability info.
+ */
+ UsdCapabilities getUsdCapabilities();
+
+ /**
+ * Start a USD publish session. Triggers a response via
+ * |ISupplicantStaIfaceCallback.onUsdPublishStarted| if successful, or
+ * |ISupplicantStaIfaceCallback.onUsdPublishConfigFailed| if failed.
+ *
+ * @param cmdId Identifier for this request. Will be returned in the callback to identify
+ * the request.
+ * @param usdPublishConfig Parameters for the requested publish session.
+ * @return Publish ID identifying the publish session. This ID will also be returned in the
+ onStarted callback when the session setup is completed successfully.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ int startUsdPublish(in int cmdId, in UsdPublishConfig usdPublishConfig);
+
+ /**
+ * Start a USD subscribe session. Triggers a response via
+ * |ISupplicantStaIfaceCallback.onUsdSubscribeStarted| if successful, or
+ * |ISupplicantStaIfaceCallback.onUsdSubscribeConfigFailed| if failed.
+ *
+ * @param cmdId Identifier for this request. Will be returned in the callback to identify
+ * the request.
+ * @param usdSubscribeConfig Parameters for the requested subscribe session.
+ * @return Subscribe ID identifying the subscribe session. This ID will also be returned in the
+ onStarted callback when the session setup is completed successfully.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ int startUsdSubscribe(in int cmdId, in UsdSubscribeConfig usdSubscribeConfig);
+
+ /**
+ * Update the service-specific info for an active publish session.
+ *
+ * @param publishId Identifier for the active publish session.
+ * @param serviceSpecificInfo Byte array containing the service-specific info. Note that the
+ * maximum info length is |UsdCapabilities.maxLocalSsiLengthBytes|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void updateUsdPublish(in int publishId, in byte[] serviceSpecificInfo);
+
+ /**
+ * Cancel an existing USD publish session. |ISupplicantStaIfaceCallback.onUsdPublishTerminated|
+ * will be called upon completion.
+ *
+ * @param publishId Identifier for the publish session to cancel.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void cancelUsdPublish(in int publishId);
+
+ /**
+ * Cancel an existing USD subscribe session.
+ * |ISupplicantStaIfaceCallback.onUsdSubscribeTerminated| will be called upon completion.
+ *
+ * @param subscribeId Identifier for the subscribe session to cancel.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void cancelUsdSubscribe(in int subscribeId);
+
+ /**
+ * Send a message to a peer device across an active USD link.
+ *
+ * @param messageInfo Information for the message to be sent.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ * |SupplicantStatusCode.FAILURE_UNSUPPORTED|
+ */
+ void sendUsdMessage(in UsdMessageInfo messageInfo);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index e5e2e84..6a3f299 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -36,6 +36,9 @@
import android.hardware.wifi.supplicant.StaIfaceCallbackState;
import android.hardware.wifi.supplicant.StaIfaceReasonCode;
import android.hardware.wifi.supplicant.SupplicantStateChangeData;
+import android.hardware.wifi.supplicant.UsdMessageInfo;
+import android.hardware.wifi.supplicant.UsdReasonCode;
+import android.hardware.wifi.supplicant.UsdServiceDiscoveryInfo;
import android.hardware.wifi.supplicant.WpsConfigError;
import android.hardware.wifi.supplicant.WpsErrorIndication;
@@ -416,4 +419,80 @@
*
*/
void onPmkSaCacheAdded(in PmkSaCacheData pmkSaData);
+
+ /**
+ * Called in response to |ISupplicantStaIface.startUsdPublish| to indicate that the
+ * publish session was started successfully.
+ *
+ * @param cmdId Identifier for the original request.
+ * @param publishId Identifier for the publish session.
+ */
+ void onUsdPublishStarted(in int cmdId, in int publishId);
+
+ /**
+ * Called in response to |ISupplicantStaIface.startUsdSubscribe| to indicate that the
+ * subscribe session was started successfully.
+ *
+ * @param cmdId Identifier for the original request.
+ * @param subscribeId Identifier for the subscribe session.
+ */
+ void onUsdSubscribeStarted(in int cmdId, in int subscribeId);
+
+ /**
+ * Called in response to |ISupplicantStaIface.startUsdPublish| to indicate that the
+ * publish session could not be configured.
+ *
+ * @param cmdId Identifier for the original request.
+ */
+ void onUsdPublishConfigFailed(in int cmdId);
+
+ /**
+ * Called in response to |ISupplicantStaIface.startUsdSubscribe| to indicate that the
+ * subscribe session could not be configured.
+ *
+ * @param cmdId Identifier for the original request.
+ */
+ void onUsdSubscribeConfigFailed(in int cmdId);
+
+ /**
+ * Called in response to |ISupplicantStaIface.cancelUsdPublish| to indicate that the session
+ * was cancelled successfully. May also be called unsolicited if the session terminated
+ * by supplicant.
+ *
+ * @param publishId Identifier for the publish session.
+ * @param reasonCode Code indicating the reason for the session cancellation.
+ */
+ void onUsdPublishTerminated(in int publishId, in UsdReasonCode reasonCode);
+
+ /**
+ * Called in response to |ISupplicantStaIface.cancelUsdSubscribe| to indicate that the session
+ * was cancelled successfully. May also be called unsolicited if the session terminated
+ * by supplicant.
+ *
+ * @param subscribeId Identifier for the subscribe session.
+ * @param reasonCode Code indicating the reason for the session cancellation.
+ */
+ void onUsdSubscribeTerminated(in int subscribeId, in UsdReasonCode reasonCode);
+
+ /**
+ * Indicates that the publisher sent solicited publish message to the subscriber.
+ *
+ * @param info Instance of |UsdServiceDiscoveryInfo| containing information about the reply.
+ */
+ void onUsdPublishReplied(in UsdServiceDiscoveryInfo info);
+
+ /**
+ * Indicates that a publisher was discovered. Only called if this device is acting as a
+ * subscriber.
+ *
+ * @param info Instance of |UsdServiceDiscoveryInfo| containing information about the service.
+ */
+ void onUsdServiceDiscovered(in UsdServiceDiscoveryInfo info);
+
+ /**
+ * Indicates that a message was received on an active USD link.
+ *
+ * @param messageInfo Information about the message that was received.
+ */
+ void onUsdMessageReceived(in UsdMessageInfo messageInfo);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
index 0b4d66e..6215263 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MloLink.aidl
@@ -16,6 +16,8 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.supplicant.WifiChannelWidthInMhz;
+
/**
* Multi-Link Operation (MLO) Link IEEE Std 802.11-be.
* The information for MLO link needed by 802.11be standard.
@@ -66,4 +68,8 @@
* Frequency on which the link operates in MHz.
*/
int frequencyMHz;
+ /**
+ * Channel bandwidth
+ */
+ WifiChannelWidthInMhz channelBandwidth;
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceAdvertisementConfig.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceAdvertisementConfig.aidl
index 1920f1a..c657d03 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceAdvertisementConfig.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceAdvertisementConfig.aidl
@@ -27,7 +27,10 @@
/** UTF-8 string defining the service */
String serviceName;
- /** Service Protocol Type */
+ /**
+ * Service Protocol Type. See defined values in the Wi-Fi Direct R2 Spec, Table 129,
+ * although any value between 0-255 may be defined by the service layer and is considered valid.
+ */
int serviceProtocolType;
/** Service specific information content determined by the application */
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryConfig.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryConfig.aidl
index c7d6f0e..9d6bf72 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryConfig.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryConfig.aidl
@@ -29,7 +29,10 @@
/** UTF-8 string defining the service */
String serviceName;
- /** Service Protocol Type */
+ /**
+ * Service Protocol Type. See defined values in the Wi-Fi Direct R2 Spec, Table 129,
+ * although any value between 0-255 may be defined by the service layer and is considered valid.
+ */
int serviceProtocolType;
/** Service specific information content determined by the application */
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryResultParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryResultParams.aidl
index becc437..6b60d68 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryResultParams.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pUsdBasedServiceDiscoveryResultParams.aidl
@@ -35,7 +35,10 @@
/** Identifier to identify the peer service advertisement instance */
int peerSessionId;
- /** Service Protocol Type */
+ /**
+ * Service Protocol Type. See defined values in the Wi-Fi Direct R2 Spec, Table 129,
+ * although any value between 0-255 may be defined by the service layer and is considered valid.
+ */
int serviceProtocolType;
/** Service specific information content determined by the application */
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdBaseConfig.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdBaseConfig.aidl
new file mode 100644
index 0000000..f43f27b
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdBaseConfig.aidl
@@ -0,0 +1,92 @@
+/*
+ * 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.UsdServiceProtoType;
+
+/**
+ * USD data used in both publish and subscribe configurations.
+ */
+@VintfStability
+parcelable UsdBaseConfig {
+ /**
+ * Service name of the USD session. A UTF-8 encoded string from 1 to 255 bytes in length.
+ * The only acceptable single-byte UTF-8 symbols for a Service Name are alphanumeric
+ * values (A-Z, a-z, 0-9), hyphen ('-'), period ('.'), and underscore ('_'). All
+ * valid multi-byte UTF-8 characters are acceptable in a Service Name.
+ */
+ @utf8InCpp String serviceName;
+
+ /**
+ * Service protocol type for the USD session (ex. Generic, CSA Matter).
+ */
+ UsdServiceProtoType serviceProtoType;
+
+ /**
+ * Details about the service being offered or being looked for. This information is transmitted
+ * within Service Discovery frames, and is used to help devices find each other and establish
+ * connections. The format and content of the service specific information are flexible and
+ * can be determined by the application.
+ */
+ byte[] serviceSpecificInfo;
+
+ /**
+ * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
+ * bytes in the |value| field) which specify further match criteria (beyond the service name).
+ *
+ * The match behavior is specified in details in the NAN spec.
+ * Publisher: used if provided.
+ * Subscriber: used (if provided) only in ACTIVE sessions.
+ *
+ * Max length: |UsdCapabilities.maxMatchFilterLength|.
+ * NAN Spec: matching_filter_tx and Service Descriptor Attribute (SDA) / Matching Filter
+ */
+ @nullable byte[] txMatchFilter;
+
+ /**
+ * Ordered sequence of <length, value> pairs (|length| uses 1 byte and contains the number of
+ * bytes in the |value| field) which specify further match criteria (beyond the service name).
+ *
+ * The match behavior is specified in details in the NAN spec.
+ * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
+ * Subscriber: used in ACTIVE or PASSIVE sessions.
+ *
+ * Max length: |UsdCapabilities.maxMatchFilterLength|.
+ * NAN Spec: matching_filter_rx
+ */
+ @nullable byte[] rxMatchfilter;
+
+ /**
+ * Time interval (in seconds) that a USD session will be alive.
+ * The session will be terminated when the time to live (TTL) is reached, triggering either
+ * |ISupplicantStaIfaceCallback.onUsdPublishTerminated| for Publish, or
+ * |ISupplicantStaIfaceCallback.onUsdSubscribeTerminated| for Subscribe.
+ */
+ int ttlSec;
+
+ /**
+ * Frequency where the device should begin to dwell. Default value is channel 6 (2.437 GHz),
+ * but other values may be selected per regulation in the geographical location.
+ */
+ int defaultFreqMhz;
+
+ /**
+ * Channels which can be switched to. May contain any of the 20 MHz channels in the
+ * 2.4 Ghz and/or 5 Ghz bands, per regulation in the geographical location.
+ */
+ int[] freqsMhz;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdCapabilities.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdCapabilities.aidl
new file mode 100644
index 0000000..ffec893
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdCapabilities.aidl
@@ -0,0 +1,59 @@
+/*
+ * 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.wifi.supplicant;
+
+/**
+ * Capabilities supported by USD. Values are only valid if |isUsdPublisherSupported|
+ * and/or |isUsdSubscriberSupported| are true.
+ */
+@VintfStability
+parcelable UsdCapabilities {
+ /**
+ * Whether USD Publisher is supported on this device.
+ */
+ boolean isUsdPublisherSupported;
+
+ /**
+ * Whether USD Subscriber is supported on this device.
+ */
+ boolean isUsdSubscriberSupported;
+
+ /**
+ * Maximum allowed length (in bytes) for the Service Specific Info (SSI).
+ */
+ int maxLocalSsiLengthBytes;
+
+ /**
+ * Maximum allowed length (in bytes) for the service name.
+ */
+ int maxServiceNameLengthBytes;
+
+ /**
+ * Maximum allowed length (in bytes) for a match filter.
+ */
+ int maxMatchFilterLengthBytes;
+
+ /**
+ * Maximum number of allowed publish sessions.
+ */
+ int maxNumPublishSessions;
+
+ /**
+ * Maximum number of allowed subscribe sessions.
+ */
+ int maxNumSubscribeSessions;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdMessageInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdMessageInfo.aidl
new file mode 100644
index 0000000..fa7cc0e
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdMessageInfo.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.wifi.supplicant;
+
+/**
+ * Information for sending a USD message.
+ */
+@VintfStability
+parcelable UsdMessageInfo {
+ /**
+ * Identifier for this device, retrieved from |UsdServiceDiscoveryInfo|.
+ */
+ int ownId;
+
+ /**
+ * Identifier for the peer device, retrieved from |UsdServiceDiscoveryInfo|.
+ */
+ int peerId;
+
+ /**
+ * MAC address for the peer device.
+ */
+ byte[6] peerMacAddress;
+
+ /**
+ * Message contents. Note that the maximum message length is
+ * |UsdCapabilities.maxLocalSsiLengthBytes|.
+ */
+ byte[] message;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishConfig.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishConfig.aidl
new file mode 100644
index 0000000..e04974b
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishConfig.aidl
@@ -0,0 +1,71 @@
+/*
+ * 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.UsdBaseConfig;
+import android.hardware.wifi.supplicant.UsdPublishTransmissionType;
+
+/**
+ * Parameters for configuring a USD publish session.
+ */
+@VintfStability
+parcelable UsdPublishConfig {
+ /**
+ * Type of USD publishing.
+ */
+ enum PublishType {
+ /**
+ * Only transmissions that are triggered by a specific event.
+ */
+ SOLICITED_ONLY = 0,
+
+ /**
+ * Only transmissions that are not requested.
+ */
+ UNSOLICITED_ONLY = 1,
+
+ /**
+ * Both solicited and unsolicited transmissions.
+ */
+ SOLICITED_AND_UNSOLICITED = 2,
+ }
+
+ /**
+ * Base USD session parameters.
+ */
+ UsdBaseConfig usdBaseConfig;
+
+ /**
+ * Types of transmissions (solicited vs. unsolicited) which should be generated.
+ */
+ PublishType publishType;
+
+ /**
+ * Whether Further Service Discovery (FSD) is enabled.
+ */
+ boolean isFsd;
+
+ /**
+ * Interval (in milliseconds) for sending unsolicited publish transmissions.
+ */
+ int announcementPeriodMillis;
+
+ /**
+ * Type of the publish transmission (ex. unicast, multicast).
+ */
+ UsdPublishTransmissionType transmissionType;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishTransmissionType.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishTransmissionType.aidl
new file mode 100644
index 0000000..45a3cf4
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdPublishTransmissionType.aidl
@@ -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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+/**
+ * Types of USD publish transmissions.
+ */
+@VintfStability
+@Backing(type="int")
+enum UsdPublishTransmissionType {
+ /**
+ * Sends data from one device to a single, specific destination device.
+ */
+ UNICAST = 0,
+
+ /**
+ * Sends data from one device to a group of devices on the network simultaneously.
+ */
+ MULTICAST = 1,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdReasonCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdReasonCode.aidl
new file mode 100644
index 0000000..4b1aab0
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdReasonCode.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.wifi.supplicant;
+
+/**
+ * Codes indicating the status of USD operations.
+ */
+@VintfStability
+@Backing(type="int")
+enum UsdReasonCode {
+ /**
+ * Unknown failure occurred.
+ */
+ FAILURE_UNKNOWN = 0,
+
+ /**
+ * The operation timed out.
+ */
+ TIMEOUT = 1,
+
+ /**
+ * The operation was requested by the user.
+ */
+ USER_REQUESTED = 2,
+
+ /**
+ * Invalid arguments were provided.
+ */
+ INVALID_ARGS = 3
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl
new file mode 100644
index 0000000..4f6eaf1
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceDiscoveryInfo.aidl
@@ -0,0 +1,62 @@
+/*
+ * 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.UsdServiceProtoType;
+
+/**
+ * Information about a USD discovery session with a specific peer.
+ */
+@VintfStability
+parcelable UsdServiceDiscoveryInfo {
+ /**
+ * Identifier for this device.
+ */
+ int ownId;
+
+ /**
+ * Identifier for the discovered peer device.
+ */
+ int peerId;
+
+ /**
+ * MAC address of the discovered peer device.
+ */
+ byte[6] peerMacAddress;
+
+ /**
+ * Match filter from the discovery packet (publish or subscribe) which caused service discovery.
+ */
+ byte[] matchFilter;
+
+ /**
+ * Service protocol that is being used (ex. Generic, CSA Matter).
+ */
+ UsdServiceProtoType protoType;
+
+ /**
+ * Arbitrary service specific information communicated in discovery packets.
+ * There is no semantic meaning to these bytes. They are passed-through from publisher to
+ * subscriber as-is with no parsing.
+ */
+ byte[] serviceSpecificInfo;
+
+ /**
+ * Whether Further Service Discovery (FSD) is enabled.
+ */
+ boolean isFsd;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceProtoType.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceProtoType.aidl
new file mode 100644
index 0000000..de9beb5
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdServiceProtoType.aidl
@@ -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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+/**
+ * Service protocols that use USD.
+ */
+@VintfStability
+@Backing(type="int")
+enum UsdServiceProtoType {
+ /**
+ * Unknown service type.
+ */
+ UNKNOWN = 0,
+
+ /**
+ * Generic service.
+ */
+ GENERIC = 1,
+
+ /**
+ * CSA (Connectivity Standards Alliance) Matter.
+ *
+ * Note: CSA Matter is an open-source, royalty-free standard for smart home technology that
+ * allows devices to work with any Matter-certified ecosystem.
+ */
+ CSA_MATTER = 2,
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl
new file mode 100644
index 0000000..4e8893e
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/UsdSubscribeConfig.aidl
@@ -0,0 +1,56 @@
+/*
+ * 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.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.UsdBaseConfig;
+
+/**
+ * Parameters for configuring a USD subscribe session.
+ */
+@VintfStability
+parcelable UsdSubscribeConfig {
+ /**
+ * Subscribe modes that this session can be configured in.
+ */
+ enum SubscribeType {
+ /**
+ * Subscribe function does not request transmission of any Subscribe messages, but checks
+ * for matches in received Publish messages.
+ */
+ PASSIVE_MODE = 0,
+ /**
+ * Subscribe function additionally requests transmission of Subscribe messages and processes
+ * Publish messages.
+ */
+ ACTIVE_MODE = 1,
+ }
+
+ /**
+ * Base USD session parameters.
+ */
+ UsdBaseConfig usdBaseConfig;
+
+ /**
+ * Subscribe mode that this session should be configured in.
+ */
+ SubscribeType subscribeType;
+
+ /**
+ * Recommended periodicity (in milliseconds) of query transmissions for the session.
+ */
+ int queryPeriodMillis;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.aidl
similarity index 60%
copy from staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.aidl
index 76bfd62..39c7eba 100644
--- a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/WifiChannelWidthInMhz.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.
@@ -13,17 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package android.hardware.security.see.hwcrypto.types;
-/*
- * Enum describing the allowed operations that can be performed with the given key.
+package android.hardware.wifi.supplicant;
+
+/**
+ * Channel operating width in Mhz.
*/
+@VintfStability
@Backing(type="int")
-enum KeyUse {
- ENCRYPT = 1,
- DECRYPT = 2,
- ENCRYPT_DECRYPT = ENCRYPT | DECRYPT,
- SIGN = 4,
- DERIVE = 8,
- WRAP = 16,
+enum WifiChannelWidthInMhz {
+ WIDTH_INVALID = -1,
+ WIDTH_20 = 0,
+ WIDTH_40 = 1,
+ WIDTH_80 = 2,
+ WIDTH_160 = 3,
+ WIDTH_80P80 = 4,
+ WIDTH_5 = 5,
+ WIDTH_10 = 6,
+ /**
+ * 320 MHz
+ */
+ WIDTH_320 = 7,
}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index 6b04aa9..c9ad498 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -47,6 +47,9 @@
using aidl::android::hardware::wifi::supplicant::QosCharacteristics;
using aidl::android::hardware::wifi::supplicant::QosPolicyScsData;
using aidl::android::hardware::wifi::supplicant::QosPolicyScsRequestStatus;
+using aidl::android::hardware::wifi::supplicant::UsdMessageInfo;
+using aidl::android::hardware::wifi::supplicant::UsdReasonCode;
+using aidl::android::hardware::wifi::supplicant::UsdServiceDiscoveryInfo;
using aidl::android::hardware::wifi::supplicant::WpaDriverCapabilitiesMask;
using aidl::android::hardware::wifi::supplicant::WpsConfigMethods;
using android::ProcessState;
@@ -243,6 +246,38 @@
override {
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus onUsdPublishStarted(int32_t /* cmdId */,
+ int32_t /* publishId */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdSubscribeStarted(int32_t /* cmdId */,
+ int32_t /* subscribeId */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdPublishConfigFailed(int32_t /* cmdId */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdSubscribeConfigFailed(int32_t /* cmdId */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdPublishTerminated(int32_t /* publishId */,
+ UsdReasonCode /* reasonCode */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdSubscribeTerminated(int32_t /* subscribeId */,
+ UsdReasonCode /* reasonCode */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdPublishReplied(const UsdServiceDiscoveryInfo& /* info */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdServiceDiscovered(
+ const UsdServiceDiscoveryInfo& /* info */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onUsdMessageReceived(const UsdMessageInfo& /* messageInfo */) override {
+ return ndk::ScopedAStatus::ok();
+ }
};
class SupplicantStaIfaceAidlTest : public testing::TestWithParam<std::string> {