diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-01-26 02:07:56 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-01-26 02:07:56 +0000 |
commit | 4d2548cfa7b86b79a516be9b60f6b666cc9af682 (patch) | |
tree | 6c9253d57c3bc9b79064aa27363bf94d5dfbf1db | |
parent | 53b5eb81de44712397a4b4a807f72887f65e4779 (diff) | |
parent | 208491d2821010c6a03d5e98dd352834270b8679 (diff) |
Snap for 8115127 from 208491d2821010c6a03d5e98dd352834270b8679 to tm-release
Change-Id: I387b99141134fbfd9442edbb3c0508f01ebab082
26 files changed, 497 insertions, 185 deletions
diff --git a/bluetooth/audio/aidl/default/Android.bp b/bluetooth/audio/aidl/default/Android.bp index 846702fa0e..fc882d4cef 100644 --- a/bluetooth/audio/aidl/default/Android.bp +++ b/bluetooth/audio/aidl/default/Android.bp @@ -8,7 +8,7 @@ package { } cc_library_shared { - name: "android.hardware.bluetooth.audio-V1-impl", + name: "android.hardware.bluetooth.audio-impl", vendor: true, vintf_fragments: ["bluetooth_audio.xml"], srcs: [ diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp index 1c75749f21..0a12f1a592 100644 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp +++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp @@ -191,6 +191,14 @@ class GraphicsComposerAidlTest : public ::testing::TestWithParam<std::string> { resourceIt->second.layers.erase(layer); } + bool hasCapability(Capability capability) { + std::vector<Capability> capabilities; + EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); + return std::any_of( + capabilities.begin(), capabilities.end(), + [&](const Capability& activeCapability) { return activeCapability == capability; }); + } + // returns an invalid display id (one that has not been registered to a // display. Currently assuming that a device will never have close to // std::numeric_limit<uint64_t>::max() displays registered while running tests @@ -1477,6 +1485,11 @@ class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest { } void Test_expectedPresentTime(std::optional<int> framesDelay) { + if (hasCapability(Capability::PRESENT_FENCE_IS_NOT_RELIABLE)) { + GTEST_SUCCEED() << "Device has unreliable present fences capability, skipping"; + return; + } + ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk()); const auto vsyncPeriod = getVsyncPeriod(); @@ -1653,10 +1666,7 @@ TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) { */ // TODO(b/208441745) fix the test failure TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) { - std::vector<Capability> capabilities; - EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); - if (none_of(capabilities.begin(), capabilities.end(), - [&](auto item) { return item == Capability::SKIP_VALIDATE; })) { + if (!hasCapability(Capability::SKIP_VALIDATE)) { GTEST_SUCCEED() << "Device does not have skip validate capability, skipping"; return; } @@ -1884,10 +1894,7 @@ TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_PLANE_ALPHA) { } TEST_P(GraphicsComposerAidlCommandTest, SET_LAYER_SIDEBAND_STREAM) { - std::vector<Capability> capabilities; - EXPECT_TRUE(mComposer->getCapabilities(&capabilities).isOk()); - if (none_of(capabilities.begin(), capabilities.end(), - [&](auto& item) { return item == Capability::SIDEBAND_STREAM; })) { + if (!hasCapability(Capability::SIDEBAND_STREAM)) { GTEST_SUCCEED() << "no sideband stream support"; return; } 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 34a87a66ec..97d9e845db 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 @@ -37,6 +37,7 @@ parcelable HealthInfo { boolean chargerAcOnline; boolean chargerUsbOnline; boolean chargerWirelessOnline; + boolean chargerDockOnline; int maxChargingCurrentMicroamps; int maxChargingVoltageMicrovolts; android.hardware.health.BatteryStatus batteryStatus; diff --git a/health/aidl/android/hardware/health/HealthInfo.aidl b/health/aidl/android/hardware/health/HealthInfo.aidl index 504e218b83..5b98baf13f 100644 --- a/health/aidl/android/hardware/health/HealthInfo.aidl +++ b/health/aidl/android/hardware/health/HealthInfo.aidl @@ -40,6 +40,10 @@ parcelable HealthInfo { */ boolean chargerWirelessOnline; /** + * Dock charger state - 'true' if online + */ + boolean chargerDockOnline; + /** * Maximum charging current supported by charger in µA */ int maxChargingCurrentMicroamps; diff --git a/health/aidl/default/HalHealthLoop.cpp b/health/aidl/default/HalHealthLoop.cpp index c9a081e0f2..ec23c10bc0 100644 --- a/health/aidl/default/HalHealthLoop.cpp +++ b/health/aidl/default/HalHealthLoop.cpp @@ -61,7 +61,7 @@ void HalHealthLoop::OnHealthInfoChanged(const HealthInfo& health_info) { void HalHealthLoop::set_charger_online(const HealthInfo& health_info) { charger_online_ = health_info.chargerAcOnline || health_info.chargerUsbOnline || - health_info.chargerWirelessOnline; + health_info.chargerWirelessOnline || health_info.chargerDockOnline; } } // namespace aidl::android::hardware::health diff --git a/health/aidl/default/health-convert.cpp b/health/aidl/default/health-convert.cpp index b5251f4bb5..6118865001 100644 --- a/health/aidl/default/health-convert.cpp +++ b/health/aidl/default/health-convert.cpp @@ -22,6 +22,7 @@ void convert(const HealthInfo& info, struct ::android::BatteryProperties* p) { p->chargerAcOnline = info.chargerAcOnline; p->chargerUsbOnline = info.chargerUsbOnline; p->chargerWirelessOnline = info.chargerWirelessOnline; + p->chargerDockOnline = info.chargerDockOnline; p->maxChargingCurrent = info.maxChargingCurrentMicroamps; p->maxChargingVoltage = info.maxChargingVoltageMicrovolts; p->batteryStatus = static_cast<int>(info.batteryStatus); diff --git a/nfc/aidl/TEST_MAPPING b/nfc/aidl/TEST_MAPPING new file mode 100644 index 0000000000..3a1008487b --- /dev/null +++ b/nfc/aidl/TEST_MAPPING @@ -0,0 +1,7 @@ +{ + "presubmit": [ + { + "name": "VtsAidlHalNfcTargetTest" + } + ] +} diff --git a/nfc/aidl/default/Nfc.cpp b/nfc/aidl/default/Nfc.cpp index a31ac5ec8e..4685b59236 100644 --- a/nfc/aidl/default/Nfc.cpp +++ b/nfc/aidl/default/Nfc.cpp @@ -42,24 +42,21 @@ void OnDeath(void* cookie) { LOG(INFO) << "Nfc::open null callback"; return ndk::ScopedAStatus::fromServiceSpecificError( static_cast<int32_t>(NfcStatus::FAILED)); - } else { - Nfc::mCallback = clientCallback; - - clientDeathRecipient = AIBinder_DeathRecipient_new(OnDeath); - auto linkRet = AIBinder_linkToDeath(clientCallback->asBinder().get(), clientDeathRecipient, - this /* cookie */); - if (linkRet != STATUS_OK) { - LOG(ERROR) << __func__ << ": linkToDeath failed: " << linkRet; - // Just ignore the error. - } - - int ret = Vendor_hal_open(eventCallback, dataCallback); - return ret == 0 ? ndk::ScopedAStatus::ok() - : ndk::ScopedAStatus::fromServiceSpecificError( - static_cast<int32_t>(NfcStatus::FAILED)); - return ndk::ScopedAStatus::ok(); } - return ndk::ScopedAStatus::ok(); + Nfc::mCallback = clientCallback; + + clientDeathRecipient = AIBinder_DeathRecipient_new(OnDeath); + auto linkRet = AIBinder_linkToDeath(clientCallback->asBinder().get(), clientDeathRecipient, + this /* cookie */); + if (linkRet != STATUS_OK) { + LOG(ERROR) << __func__ << ": linkToDeath failed: " << linkRet; + // Just ignore the error. + } + + int ret = Vendor_hal_open(eventCallback, dataCallback); + return ret == 0 ? ndk::ScopedAStatus::ok() + : ndk::ScopedAStatus::fromServiceSpecificError( + static_cast<int32_t>(NfcStatus::FAILED)); } ::ndk::ScopedAStatus Nfc::close(NfcCloseType type) { diff --git a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/RpcHardwareInfo.aidl b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/RpcHardwareInfo.aidl index 06bce19c82..5ff45f8a94 100644 --- a/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/RpcHardwareInfo.aidl +++ b/security/keymint/aidl/aidl_api/android.hardware.security.keymint/current/android/hardware/security/keymint/RpcHardwareInfo.aidl @@ -38,6 +38,7 @@ parcelable RpcHardwareInfo { int versionNumber; @utf8InCpp String rpcAuthorName; int supportedEekCurve = 0; + @nullable @utf8InCpp String uniqueId; const int CURVE_NONE = 0; const int CURVE_P256 = 1; const int CURVE_25519 = 2; diff --git a/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl b/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl index d297f871fb..3a4c233cf5 100644 --- a/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl +++ b/security/keymint/aidl/android/hardware/security/keymint/RpcHardwareInfo.aidl @@ -53,4 +53,21 @@ parcelable RpcHardwareInfo { * a passing implementation does not provide CURVE_NONE. */ int supportedEekCurve = CURVE_NONE; + + /** + * uniqueId is an opaque identifier for this IRemotelyProvisionedComponent implementation. The + * client should NOT interpret the content of the identifier in any way. The client can only + * compare identifiers to determine if two IRemotelyProvisionedComponents share the same + * implementation. Each IRemotelyProvisionedComponent implementation must have a distinct + * identifier from all other implementations on the same device. + * + * This identifier must be consistent across reboots, as it is used to store and track + * provisioned keys in a persistent, on-device database. + * + * uniqueId may not be empty, and must not be any longer than 32 characters. + * + * This field was added in API version 2. + * + */ + @nullable @utf8InCpp String uniqueId; } diff --git a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp index c9d506f788..829780d442 100644 --- a/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp +++ b/security/keymint/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp @@ -20,6 +20,7 @@ #include <aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h> #include <aidl/android/hardware/security/keymint/SecurityLevel.h> #include <android/binder_manager.h> +#include <binder/IServiceManager.h> #include <cppbor_parse.h> #include <gmock/gmock.h> #include <keymaster/cppcose/cppcose.h> @@ -29,6 +30,7 @@ #include <openssl/ec_key.h> #include <openssl/x509.h> #include <remote_prov/remote_prov_utils.h> +#include <set> #include <vector> #include "KeyMintAidlTestBase.h" @@ -40,6 +42,8 @@ using ::std::vector; namespace { +constexpr int32_t VERSION_WITH_UNIQUE_ID_SUPPORT = 2; + #define INSTANTIATE_REM_PROV_AIDL_TEST(name) \ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(name); \ INSTANTIATE_TEST_SUITE_P( \ @@ -47,6 +51,7 @@ namespace { testing::ValuesIn(VtsRemotelyProvisionedComponentTests::build_params()), \ ::android::PrintInstanceNameToString) +using ::android::sp; using bytevec = std::vector<uint8_t>; using testing::MatchesRegex; using namespace remote_prov; @@ -175,6 +180,67 @@ class VtsRemotelyProvisionedComponentTests : public testing::TestWithParam<std:: std::shared_ptr<IRemotelyProvisionedComponent> provisionable_; }; +/** + * Verify that every implementation reports a different unique id. + */ +TEST(NonParameterizedTests, eachRpcHasAUniqueId) { + std::set<std::string> uniqueIds; + for (auto hal : ::android::getAidlHalInstanceNames(IRemotelyProvisionedComponent::descriptor)) { + ASSERT_TRUE(AServiceManager_isDeclared(hal.c_str())); + ::ndk::SpAIBinder binder(AServiceManager_waitForService(hal.c_str())); + std::shared_ptr<IRemotelyProvisionedComponent> rpc = + IRemotelyProvisionedComponent::fromBinder(binder); + ASSERT_NE(rpc, nullptr); + + RpcHardwareInfo hwInfo; + ASSERT_TRUE(rpc->getHardwareInfo(&hwInfo).isOk()); + + int32_t version; + ASSERT_TRUE(rpc->getInterfaceVersion(&version).isOk()); + if (version >= VERSION_WITH_UNIQUE_ID_SUPPORT) { + ASSERT_TRUE(hwInfo.uniqueId); + auto [_, wasInserted] = uniqueIds.insert(*hwInfo.uniqueId); + EXPECT_TRUE(wasInserted); + } else { + ASSERT_FALSE(hwInfo.uniqueId); + } + } +} + +using GetHardwareInfoTests = VtsRemotelyProvisionedComponentTests; + +INSTANTIATE_REM_PROV_AIDL_TEST(GetHardwareInfoTests); + +/** + * Verify that a valid curve is reported by the implementation. + */ +TEST_P(GetHardwareInfoTests, supportsValidCurve) { + RpcHardwareInfo hwInfo; + ASSERT_TRUE(provisionable_->getHardwareInfo(&hwInfo).isOk()); + + const std::set<int> validCurves = {RpcHardwareInfo::CURVE_P256, RpcHardwareInfo::CURVE_25519}; + ASSERT_EQ(validCurves.count(hwInfo.supportedEekCurve), 1) + << "Invalid curve: " << hwInfo.supportedEekCurve; +} + +/** + * Verify that the unique id is within the length limits as described in RpcHardwareInfo.aidl. + */ +TEST_P(GetHardwareInfoTests, uniqueId) { + int32_t version; + ASSERT_TRUE(provisionable_->getInterfaceVersion(&version).isOk()); + + if (version < VERSION_WITH_UNIQUE_ID_SUPPORT) { + return; + } + + RpcHardwareInfo hwInfo; + ASSERT_TRUE(provisionable_->getHardwareInfo(&hwInfo).isOk()); + ASSERT_TRUE(hwInfo.uniqueId); + EXPECT_GE(hwInfo.uniqueId->size(), 1); + EXPECT_LE(hwInfo.uniqueId->size(), 32); +} + using GenerateKeyTests = VtsRemotelyProvisionedComponentTests; INSTANTIATE_REM_PROV_AIDL_TEST(GenerateKeyTests); diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp index fcccc27722..28e809047a 100644 --- a/soundtrigger/aidl/Android.bp +++ b/soundtrigger/aidl/Android.bp @@ -10,6 +10,7 @@ package { aidl_interface { name: "android.hardware.soundtrigger3", vendor_available: true, + host_supported: true, flags: ["-Werror", "-Weverything", ], srcs: [ "android/hardware/soundtrigger3/ISoundTriggerHw.aidl", diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..41944ce440 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,43 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m <name>-update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.hardware.tv.tuner; +/* @hide */ +@Backing(type="int") @VintfStability +enum FrontendStatusReadiness { + UNDEFINED = 0, + UNAVAILABLE = 1, + UNSTABLE = 2, + STABLE = 3, + UNSUPPORTED = 4, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl index e240e40666..3e3ff4fad6 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl @@ -47,4 +47,5 @@ interface IFrontend { void unlinkCiCam(in int ciCamId); String getHardwareInfo(); void removeOutputPid(int pid); + android.hardware.tv.tuner.FrontendStatusReadiness[] getFrontendStatusReadiness(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes); } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl new file mode 100644 index 0000000000..a9e3080c69 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusReadiness.aidl @@ -0,0 +1,54 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.hardware.tv.tuner; + +/** + * FrontendStatus readiness status. + * @hide + */ +@VintfStability +@Backing(type="int") +enum FrontendStatusReadiness { + /** + * The FrontendStatus’ readiness status for the given FrontendStatusType is + * undefined. + */ + UNDEFINED, + + /** + * The FrontendStatus for the given FrontendStatusType is currently + * unavailable. + */ + UNAVAILABLE, + + /** + * The FrontendStatus for the given FrontendStatusType can be read, but it’s + * unstable. + */ + UNSTABLE, + + /** + * The FrontendStatus for the given FrontendStatusType can be ready, and it’s + * stable. + */ + STABLE, + + /** + * The FrontendStatus for the given FrontendStatusType is not supported. + */ + UNSUPPORTED, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl index f8248e660b..12f2692992 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl @@ -19,6 +19,7 @@ package android.hardware.tv.tuner; import android.hardware.tv.tuner.FrontendScanType; import android.hardware.tv.tuner.FrontendSettings; import android.hardware.tv.tuner.FrontendStatus; +import android.hardware.tv.tuner.FrontendStatusReadiness; import android.hardware.tv.tuner.FrontendStatusType; import android.hardware.tv.tuner.IFrontendCallback; @@ -155,4 +156,14 @@ interface IFrontend { * @return UNAVAILABLE if the frontend doesn’t support PID filtering out. */ void removeOutputPid(int pid); + + /** + * Gets FrontendStatus’ readiness statuses for given status types. + * + * @param statusTypes an array of status types. + * + * @return an array of current readiness statuses. The ith readiness status in + * the array presents fronted type statusTypes[i]’s readiness status. + */ + FrontendStatusReadiness[] getFrontendStatusReadiness(in FrontendStatusType[] statusTypes); } diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp index f0bf0011ed..056d01468a 100644 --- a/tv/tuner/aidl/default/Frontend.cpp +++ b/tv/tuner/aidl/default/Frontend.cpp @@ -34,6 +34,140 @@ Frontend::Frontend(FrontendType type, int32_t id, std::shared_ptr<Tuner> tuner) mTuner = tuner; // Init callback to nullptr mCallback = nullptr; + + switch (mType) { + case FrontendType::ISDBS: { + mFrontendCaps.set<FrontendCapabilities::Tag::isdbsCaps>(FrontendIsdbsCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::DEMOD_LOCK, + FrontendStatusType::SNR, + FrontendStatusType::FEC, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, + FrontendStatusType::STREAM_ID_LIST, + }; + break; + } + case FrontendType::ATSC3: { + mFrontendCaps.set<FrontendCapabilities::Tag::atsc3Caps>(FrontendAtsc3Capabilities()); + mFrontendStatusCaps = { + FrontendStatusType::BER, + FrontendStatusType::PER, + FrontendStatusType::ATSC3_PLP_INFO, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BERS, + FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::ATSC3_ALL_PLP_INFO, + }; + break; + } + case FrontendType::DVBC: { + mFrontendCaps.set<FrontendCapabilities::Tag::dvbcCaps>(FrontendDvbcCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::PRE_BER, FrontendStatusType::SIGNAL_QUALITY, + FrontendStatusType::MODULATION, FrontendStatusType::SPECTRAL, + FrontendStatusType::MODULATIONS, FrontendStatusType::CODERATES, + FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, + }; + break; + } + case FrontendType::DVBS: { + mFrontendCaps.set<FrontendCapabilities::Tag::dvbsCaps>(FrontendDvbsCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::SIGNAL_STRENGTH, FrontendStatusType::SYMBOL_RATE, + FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, + FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, + }; + break; + } + case FrontendType::DVBT: { + mFrontendCaps.set<FrontendCapabilities::Tag::dvbtCaps>(FrontendDvbtCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::EWBS, + FrontendStatusType::PLP_ID, + FrontendStatusType::HIERARCHY, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::T2_SYSTEM_ID, + FrontendStatusType::DVBT_CELL_IDS, + }; + break; + } + case FrontendType::ISDBT: { + FrontendIsdbtCapabilities isdbtCaps{ + .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, + .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, + .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, + .coderateCap = (int)FrontendIsdbtCoderate::CODERATE_4_5 | + (int)FrontendIsdbtCoderate::CODERATE_6_7, + .guardIntervalCap = (int)FrontendIsdbtGuardInterval::INTERVAL_1_128, + .timeInterleaveCap = (int)FrontendIsdbtTimeInterleaveMode::AUTO | + (int)FrontendIsdbtTimeInterleaveMode::INTERLEAVE_1_0, + .isSegmentAuto = true, + .isFullSegment = true, + }; + mFrontendCaps.set<FrontendCapabilities::Tag::isdbtCaps>(isdbtCaps); + mFrontendStatusCaps = { + FrontendStatusType::AGC, + FrontendStatusType::LNA, + FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, + FrontendStatusType::BANDWIDTH, + FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + FrontendStatusType::ISDBT_SEGMENTS, + FrontendStatusType::ISDBT_MODE, + FrontendStatusType::ISDBT_PARTIAL_RECEPTION_FLAG, + FrontendStatusType::INTERLEAVINGS, + }; + break; + } + case FrontendType::ANALOG: { + mFrontendCaps.set<FrontendCapabilities::Tag::analogCaps>(FrontendAnalogCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::LAYER_ERROR, + FrontendStatusType::MER, + FrontendStatusType::UEC, + FrontendStatusType::TS_DATA_RATES, + }; + break; + } + case FrontendType::ATSC: { + mFrontendCaps.set<FrontendCapabilities::Tag::atscCaps>(FrontendAtscCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::FREQ_OFFSET, + FrontendStatusType::RF_LOCK, + FrontendStatusType::MODULATIONS, + FrontendStatusType::IS_LINEAR, + }; + break; + } + case FrontendType::ISDBS3: { + mFrontendCaps.set<FrontendCapabilities::Tag::isdbs3Caps>(FrontendIsdbs3Capabilities()); + mFrontendStatusCaps = { + FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, + FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, + FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, + }; + break; + } + case FrontendType::DTMB: { + mFrontendCaps.set<FrontendCapabilities::Tag::dtmbCaps>(FrontendDtmbCapabilities()); + mFrontendStatusCaps = { + FrontendStatusType::MODULATIONS, FrontendStatusType::INTERLEAVINGS, + FrontendStatusType::BANDWIDTH, FrontendStatusType::GUARD_INTERVAL, + FrontendStatusType::TRANSMISSION_MODE, + }; + break; + } + default: { + break; + } + } } Frontend::~Frontend() {} @@ -763,6 +897,10 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA dprintf(fd, " mType: %d\n", mType); dprintf(fd, " mIsLocked: %d\n", mIsLocked); dprintf(fd, " mCiCamId: %d\n", mCiCamId); + dprintf(fd, " mFrontendStatusCaps:"); + for (int i = 0; i < mFrontendStatusCaps.size(); i++) { + dprintf(fd, " %d\n", mFrontendStatusCaps[i]); + } return STATUS_OK; } @@ -780,6 +918,29 @@ binder_status_t Frontend::dump(int fd, const char** /* args */, uint32_t /* numA static_cast<int32_t>(Result::UNAVAILABLE)); } +::ndk::ScopedAStatus Frontend::getFrontendStatusReadiness( + const std::vector<FrontendStatusType>& in_statusTypes, + std::vector<FrontendStatusReadiness>* _aidl_return) { + ALOGV("%s", __FUNCTION__); + + _aidl_return->resize(in_statusTypes.size()); + for (int i = 0; i < in_statusTypes.size(); i++) { + int j = 0; + while (j < mFrontendStatusCaps.size()) { + if (in_statusTypes[i] == mFrontendStatusCaps[j]) { + (*_aidl_return)[i] = FrontendStatusReadiness::STABLE; + break; + } + j++; + } + if (j >= mFrontendStatusCaps.size()) { + (*_aidl_return)[i] = FrontendStatusReadiness::UNSUPPORTED; + } + } + + return ::ndk::ScopedAStatus::ok(); +} + FrontendType Frontend::getFrontendType() { return mType; } @@ -797,6 +958,21 @@ bool Frontend::isLocked() { return mIsLocked; } +void Frontend::getFrontendInfo(FrontendInfo* _aidl_return) { + // assign randomly selected values for testing. + *_aidl_return = { + .type = mType, + .minFrequency = 139000000, + .maxFrequency = 1139000000, + .minSymbolRate = 45, + .maxSymbolRate = 1145, + .acquireRange = 30, + .exclusiveGroupId = 57, + .statusCaps = mFrontendStatusCaps, + .frontendCaps = mFrontendCaps, + }; +} + } // namespace tuner } // namespace tv } // namespace hardware diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h index 3df1aa1d78..1d9ab53a61 100644 --- a/tv/tuner/aidl/default/Frontend.h +++ b/tv/tuner/aidl/default/Frontend.h @@ -51,6 +51,9 @@ class Frontend : public BnFrontend { ::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override; ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override; ::ndk::ScopedAStatus removeOutputPid(int32_t in_pid) override; + ::ndk::ScopedAStatus getFrontendStatusReadiness( + const std::vector<FrontendStatusType>& in_statusTypes, + std::vector<FrontendStatusReadiness>* _aidl_return) override; binder_status_t dump(int fd, const char** args, uint32_t numArgs) override; @@ -58,6 +61,7 @@ class Frontend : public BnFrontend { int32_t getFrontendId(); string getSourceFile(); bool isLocked(); + void getFrontendInfo(FrontendInfo* _aidl_return); private: virtual ~Frontend(); @@ -74,6 +78,8 @@ class Frontend : public BnFrontend { FrontendSettings mFrontendSettings; FrontendScanType mFrontendScanType; std::ifstream mFrontendData; + FrontendCapabilities mFrontendCaps; + vector<FrontendStatusType> mFrontendStatusCaps; }; } // namespace tuner diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp index 7a5fa6ecad..fa74288b09 100644 --- a/tv/tuner/aidl/default/Tuner.cpp +++ b/tv/tuner/aidl/default/Tuner.cpp @@ -49,154 +49,15 @@ void Tuner::init() { mFrontends[8] = ndk::SharedRefBase::make<Frontend>(FrontendType::ISDBS3, 8, this->ref<Tuner>()); mFrontends[9] = ndk::SharedRefBase::make<Frontend>(FrontendType::DTMB, 9, this->ref<Tuner>()); - vector<FrontendStatusType> statusCaps; - - FrontendCapabilities capsIsdbs; - capsIsdbs.set<FrontendCapabilities::Tag::isdbsCaps>(FrontendIsdbsCapabilities()); - mFrontendCaps[0] = capsIsdbs; - statusCaps = { - FrontendStatusType::DEMOD_LOCK, - FrontendStatusType::SNR, - FrontendStatusType::FEC, - FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, - FrontendStatusType::ROLL_OFF, - FrontendStatusType::STREAM_ID_LIST, - }; - mFrontendStatusCaps[0] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBS] = 1; - - FrontendCapabilities capsAtsc3; - capsAtsc3.set<FrontendCapabilities::Tag::atsc3Caps>(FrontendAtsc3Capabilities()); - mFrontendCaps[1] = capsAtsc3; - statusCaps = { - FrontendStatusType::BER, - FrontendStatusType::PER, - FrontendStatusType::ATSC3_PLP_INFO, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BERS, - FrontendStatusType::INTERLEAVINGS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::ATSC3_ALL_PLP_INFO, - }; - mFrontendStatusCaps[1] = statusCaps; mMaxUsableFrontends[FrontendType::ATSC3] = 1; - - FrontendCapabilities capsDvbc; - capsDvbc.set<FrontendCapabilities::Tag::dvbcCaps>(FrontendDvbcCapabilities()); - mFrontendCaps[2] = capsDvbc; - statusCaps = { - FrontendStatusType::PRE_BER, FrontendStatusType::SIGNAL_QUALITY, - FrontendStatusType::MODULATION, FrontendStatusType::SPECTRAL, - FrontendStatusType::MODULATIONS, FrontendStatusType::CODERATES, - FrontendStatusType::INTERLEAVINGS, FrontendStatusType::BANDWIDTH, - }; - mFrontendStatusCaps[2] = statusCaps; mMaxUsableFrontends[FrontendType::DVBC] = 1; - - FrontendCapabilities capsDvbs; - capsDvbs.set<FrontendCapabilities::Tag::dvbsCaps>(FrontendDvbsCapabilities()); - mFrontendCaps[3] = capsDvbs; - statusCaps = { - FrontendStatusType::SIGNAL_STRENGTH, FrontendStatusType::SYMBOL_RATE, - FrontendStatusType::MODULATION, FrontendStatusType::MODULATIONS, - FrontendStatusType::ROLL_OFF, FrontendStatusType::IS_MISO, - }; - mFrontendStatusCaps[3] = statusCaps; mMaxUsableFrontends[FrontendType::DVBS] = 1; - - FrontendCapabilities capsDvbt; - capsDvbt.set<FrontendCapabilities::Tag::dvbtCaps>(FrontendDvbtCapabilities()); - mFrontendCaps[4] = capsDvbt; - statusCaps = { - FrontendStatusType::EWBS, - FrontendStatusType::PLP_ID, - FrontendStatusType::HIERARCHY, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - FrontendStatusType::T2_SYSTEM_ID, - FrontendStatusType::DVBT_CELL_IDS, - }; - mFrontendStatusCaps[4] = statusCaps; mMaxUsableFrontends[FrontendType::DVBT] = 1; - - FrontendCapabilities capsIsdbt; - FrontendIsdbtCapabilities isdbtCaps{ - .modeCap = (int)FrontendIsdbtMode::MODE_1 | (int)FrontendIsdbtMode::MODE_2, - .bandwidthCap = (int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, - .modulationCap = (int)FrontendIsdbtModulation::MOD_16QAM, - .coderateCap = (int)FrontendIsdbtCoderate::CODERATE_4_5 | - (int)FrontendIsdbtCoderate::CODERATE_6_7, - .guardIntervalCap = (int)FrontendIsdbtGuardInterval::INTERVAL_1_128, - .timeInterleaveCap = (int)FrontendIsdbtTimeInterleaveMode::AUTO | - (int)FrontendIsdbtTimeInterleaveMode::INTERLEAVE_1_0, - .isSegmentAuto = true, - .isFullSegment = true, - }; - capsIsdbt.set<FrontendCapabilities::Tag::isdbtCaps>(isdbtCaps); - mFrontendCaps[5] = capsIsdbt; - statusCaps = { - FrontendStatusType::AGC, - FrontendStatusType::LNA, - FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, - FrontendStatusType::BANDWIDTH, - FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - FrontendStatusType::ISDBT_SEGMENTS, - FrontendStatusType::ISDBT_MODE, - FrontendStatusType::ISDBT_PARTIAL_RECEPTION_FLAG, - FrontendStatusType::INTERLEAVINGS, - }; - mFrontendStatusCaps[5] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBT] = 1; - - FrontendCapabilities capsAnalog; - capsAnalog.set<FrontendCapabilities::Tag::analogCaps>(FrontendAnalogCapabilities()); - mFrontendCaps[6] = capsAnalog; - statusCaps = { - FrontendStatusType::LAYER_ERROR, - FrontendStatusType::MER, - FrontendStatusType::UEC, - FrontendStatusType::TS_DATA_RATES, - }; - mFrontendStatusCaps[6] = statusCaps; mMaxUsableFrontends[FrontendType::ANALOG] = 1; - - FrontendCapabilities capsAtsc; - capsAtsc.set<FrontendCapabilities::Tag::atscCaps>(FrontendAtscCapabilities()); - mFrontendCaps[7] = capsAtsc; - statusCaps = { - FrontendStatusType::FREQ_OFFSET, - FrontendStatusType::RF_LOCK, - FrontendStatusType::MODULATIONS, - FrontendStatusType::IS_LINEAR, - }; - mFrontendStatusCaps[7] = statusCaps; mMaxUsableFrontends[FrontendType::ATSC] = 1; - - FrontendCapabilities capsIsdbs3; - capsIsdbs3.set<FrontendCapabilities::Tag::isdbs3Caps>(FrontendIsdbs3Capabilities()); - mFrontendCaps[8] = capsIsdbs3; - statusCaps = { - FrontendStatusType::DEMOD_LOCK, FrontendStatusType::MODULATION, - FrontendStatusType::MODULATIONS, FrontendStatusType::ROLL_OFF, - FrontendStatusType::IS_SHORT_FRAMES, FrontendStatusType::STREAM_ID_LIST, - }; - mFrontendStatusCaps[8] = statusCaps; mMaxUsableFrontends[FrontendType::ISDBS3] = 1; - - FrontendCapabilities capsDtmb; - capsDtmb.set<FrontendCapabilities::Tag::dtmbCaps>(FrontendDtmbCapabilities()); - mFrontendCaps[9] = capsDtmb; - statusCaps = { - FrontendStatusType::MODULATIONS, FrontendStatusType::INTERLEAVINGS, - FrontendStatusType::BANDWIDTH, FrontendStatusType::GUARD_INTERVAL, - FrontendStatusType::TRANSMISSION_MODE, - }; - mFrontendStatusCaps[9] = statusCaps; mMaxUsableFrontends[FrontendType::DTMB] = 1; mLnbs.resize(2); @@ -267,24 +128,12 @@ Tuner::~Tuner() {} ::ndk::ScopedAStatus Tuner::getFrontendInfo(int32_t in_frontendId, FrontendInfo* _aidl_return) { ALOGV("%s", __FUNCTION__); - if (in_frontendId >= mFrontendSize) { + if (in_frontendId < 0 || in_frontendId >= mFrontendSize) { return ::ndk::ScopedAStatus::fromServiceSpecificError( static_cast<int32_t>(Result::INVALID_ARGUMENT)); } - // assign randomly selected values for testing. - *_aidl_return = { - .type = mFrontends[in_frontendId]->getFrontendType(), - .minFrequency = 139000000, - .maxFrequency = 1139000000, - .minSymbolRate = 45, - .maxSymbolRate = 1145, - .acquireRange = 30, - .exclusiveGroupId = 57, - .statusCaps = mFrontendStatusCaps[in_frontendId], - .frontendCaps = mFrontendCaps[in_frontendId], - }; - + mFrontends[in_frontendId]->getFrontendInfo(_aidl_return); return ::ndk::ScopedAStatus::ok(); } @@ -360,9 +209,6 @@ binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) { dprintf(fd, "Frontends:\n"); for (int i = 0; i < mFrontendSize; i++) { mFrontends[i]->dump(fd, args, numArgs); - for (int j = 0; j < mFrontendStatusCaps[i].size(); j++) { - dprintf(fd, " statusCap: %d\n", mFrontendStatusCaps[i][j]); - } } } { diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h index 216a2b6280..ad73003eeb 100644 --- a/tv/tuner/aidl/default/Tuner.h +++ b/tv/tuner/aidl/default/Tuner.h @@ -75,8 +75,6 @@ class Tuner : public BnTuner { private: // Static mFrontends array to maintain local frontends information map<int32_t, std::shared_ptr<Frontend>> mFrontends; - map<int32_t, FrontendCapabilities> mFrontendCaps; - map<int32_t, vector<FrontendStatusType>> mFrontendStatusCaps; map<int32_t, int32_t> mFrontendToDemux; map<int32_t, std::shared_ptr<Demux>> mDemuxes; // To maintain how many Frontends we have diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp index 62d9b744b5..a1f51dfe1a 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp +++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp @@ -581,3 +581,47 @@ void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanT ASSERT_TRUE(stopScanFrontend()); ASSERT_TRUE(closeFrontend()); } + +void FrontendTests::statusReadinessTest(FrontendConfig frontendConf) { + int32_t feId; + vector<FrontendStatusType> allTypes; + vector<FrontendStatusReadiness> readiness; + getFrontendIdByType(frontendConf.type, feId); + ASSERT_TRUE(feId != INVALID_ID); + ASSERT_TRUE(openFrontendById(feId)); + ASSERT_TRUE(setFrontendCallback()); + if (frontendConf.canConnectToCiCam) { + ASSERT_TRUE(linkCiCam(frontendConf.ciCamId)); + ASSERT_TRUE(removeOutputPid(frontendConf.removePid)); + ASSERT_TRUE(unlinkCiCam(frontendConf.ciCamId)); + } + ASSERT_TRUE(getFrontendInfo(feId)); + ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/)); + + // TODO: find a better way to push all frontend status types + for (int32_t i = 0; i < static_cast<int32_t>(FrontendStatusType::ATSC3_ALL_PLP_INFO); i++) { + allTypes.push_back(static_cast<FrontendStatusType>(i)); + } + ndk::ScopedAStatus status = mFrontend->getFrontendStatusReadiness(allTypes, &readiness); + ASSERT_TRUE(status.isOk()); + ASSERT_TRUE(readiness.size() == allTypes.size()); + for (int32_t i = 0; i < readiness.size(); i++) { + int32_t j = 0; + while (j < mFrontendInfo.statusCaps.size()) { + if (allTypes[i] == mFrontendInfo.statusCaps[j]) { + ASSERT_TRUE(readiness[i] == FrontendStatusReadiness::UNAVAILABLE || + readiness[i] == FrontendStatusReadiness::UNSTABLE || + readiness[i] == FrontendStatusReadiness::STABLE); + break; + } + j++; + } + + if (j >= mFrontendInfo.statusCaps.size()) { + ASSERT_TRUE(readiness[i] == FrontendStatusReadiness::UNSUPPORTED); + } + } + + ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/)); + ASSERT_TRUE(closeFrontend()); +} diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h index 537c419256..1746c8efcc 100644 --- a/tv/tuner/aidl/vts/functional/FrontendTests.h +++ b/tv/tuner/aidl/vts/functional/FrontendTests.h @@ -102,6 +102,7 @@ class FrontendTests { void scanTest(FrontendConfig frontend, FrontendScanType type); void debugInfoTest(FrontendConfig frontendConf); void maxNumberOfFrontendsTest(); + void statusReadinessTest(FrontendConfig frontendConf); void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; } void setDemux(std::shared_ptr<IDemux> demux) { getDvrTests()->setDemux(demux); } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 0566089833..c99da419ed 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -907,6 +907,14 @@ TEST_P(TunerFrontendAidlTest, maxNumberOfFrontends) { mFrontendTests.maxNumberOfFrontendsTest(); } +TEST_P(TunerFrontendAidlTest, statusReadinessTest) { + description("Test Max Frontend status readiness"); + if (!live.hasFrontendConnection) { + return; + } + mFrontendTests.statusReadinessTest(frontendMap[live.frontendId]); +} + TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast use case."); if (!live.hasFrontendConnection) { diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 18baea6961..bdc5f3483c 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -125,6 +125,7 @@ interface ISupplicantStaNetwork { void setWapiCertSuite(in String suite); void setWepKey(in int keyIdx, in byte[] wepKey); void setWepTxKeyIdx(in int keyIdx); + void setRoamingConsortiumSelection(in byte[] selectedRcoi); const int SSID_MAX_LEN_IN_BYTES = 32; const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8; const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63; diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl index 603e2add6e..1a2087dbe1 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl @@ -1092,4 +1092,17 @@ interface ISupplicantStaNetwork { * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| */ void setWepTxKeyIdx(in int keyIdx); + + /** + * Set the roaming consortium selection. + * + * @param selectedRcoi Indicates the roaming consortium selection. This is a + * 3 or 5-octet long byte array that indicates the selected RCOI + * used for a Passpoint connection. + * @throws ServiceSpecificException with one of the following values: + * |SupplicantStatusCode.FAILURE_ARGS_INVALID|, + * |SupplicantStatusCode.FAILURE_UNKNOWN|, + * |SupplicantStatusCode.FAILURE_NETWORK_INVALID| + */ + void setRoamingConsortiumSelection(in byte[] selectedRcoi); } diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp index 0a35f666f4..c6dd98152d 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp @@ -784,6 +784,14 @@ TEST_P(SupplicantStaNetworkAidlTest, GetWpsNfcConfigurationToken) { EXPECT_NE(retrievedToken.size(), 0); } +/* + * SetRoamingConsortiumSelection + */ +TEST_P(SupplicantStaNetworkAidlTest, SetRoamingConsortiumSelection) { + const std::vector<uint8_t> testSelection = std::vector<uint8_t>({0x11, 0x21, 0x33, 0x44}); + EXPECT_TRUE(sta_network_->setRoamingConsortiumSelection(testSelection).isOk()); +} + GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaNetworkAidlTest); INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames( |