Merge "wifi: Add Mobile Hotspot(MHS) info callback"
diff --git a/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp b/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
index b079a4b..7d733ff 100644
--- a/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
+++ b/graphics/mapper/2.0/vts/functional/VtsHalGraphicsMapperV2_0TargetTest.cpp
@@ -410,6 +410,7 @@
#endif
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsMapperHidlTest);
INSTANTIATE_TEST_CASE_P(
PerInstance, GraphicsMapperHidlTest,
testing::Combine(
diff --git a/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp b/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp
index 3d792f9..9f927e5 100644
--- a/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp
+++ b/graphics/mapper/2.1/vts/functional/VtsHalGraphicsMapperV2_1TargetTest.cpp
@@ -204,6 +204,7 @@
});
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsMapperHidlTest);
INSTANTIATE_TEST_CASE_P(
PerInstance, GraphicsMapperHidlTest,
testing::Combine(
@@ -218,4 +219,4 @@
} // namespace mapper
} // namespace graphics
} // namespace hardware
-} // namespace android
\ No newline at end of file
+} // namespace android
diff --git a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp
index 92b5994..4187dd1 100644
--- a/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp
+++ b/graphics/mapper/3.0/vts/functional/VtsHalGraphicsMapperV3_0TargetTest.cpp
@@ -458,6 +458,7 @@
ASSERT_NO_FATAL_FAILURE(supported = mGralloc->isSupported(info));
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsMapperHidlTest);
INSTANTIATE_TEST_CASE_P(
PerInstance, GraphicsMapperHidlTest,
testing::Combine(
diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
index bb775dc..f55a6b7 100644
--- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
+++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
@@ -2592,6 +2592,7 @@
ASSERT_EQ(0, reservedSize);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsMapperHidlTest);
INSTANTIATE_TEST_CASE_P(
PerInstance, GraphicsMapperHidlTest,
testing::Combine(
diff --git a/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h b/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
index ff08066..3e29206 100644
--- a/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
+++ b/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
@@ -17,6 +17,7 @@
#ifndef SYSTEM_SECURITY_KEYSTORE_KM4_AUTHORIZATION_SET_H_
#define SYSTEM_SECURITY_KEYSTORE_KM4_AUTHORIZATION_SET_H_
+#include <functional>
#include <vector>
#include <keymasterV4_0/keymaster_tags.h>
@@ -165,11 +166,12 @@
*/
bool Contains(Tag tag) const { return find(tag) != -1; }
- template <TagType tag_type, Tag tag, typename ValueT>
- bool Contains(TypedTag<tag_type, tag> ttag, const ValueT& value) const {
+ template <TagType tag_type, Tag tag, typename ValueT, typename Comparator = std::equal_to<>>
+ bool Contains(TypedTag<tag_type, tag> ttag, const ValueT& value,
+ Comparator cmp = Comparator()) const {
for (const auto& param : data_) {
auto entry = authorizationValue(ttag, param);
- if (entry.isOk() && static_cast<ValueT>(entry.value()) == value) return true;
+ if (entry.isOk() && cmp(static_cast<ValueT>(entry.value()), value)) return true;
}
return false;
}
diff --git a/keymaster/4.0/vts/functional/VerificationTokenTest.cpp b/keymaster/4.0/vts/functional/VerificationTokenTest.cpp
index bab1439..4f0a7a3 100644
--- a/keymaster/4.0/vts/functional/VerificationTokenTest.cpp
+++ b/keymaster/4.0/vts/functional/VerificationTokenTest.cpp
@@ -111,19 +111,19 @@
EXPECT_GE(host_time_delta, time_to_sleep)
<< "We slept for " << time_to_sleep << " ms, the clock must have advanced by that much";
- EXPECT_LE(host_time_delta, time_to_sleep + 20)
+ EXPECT_LE(host_time_delta, time_to_sleep + 100)
<< "The verifyAuthorization call took " << (host_time_delta - time_to_sleep)
<< " ms? That's awful!";
auto km_time_delta = result2.token.timestamp - result1.token.timestamp;
// If not too much else is going on on the system, the time delta should be quite close. Allow
- // 2 ms of slop just to avoid test flakiness.
+ // 20 ms of slop just to avoid test flakiness.
//
// TODO(swillden): see if we can output values so they can be gathered across many runs and
// report if times aren't nearly always <1ms apart.
- EXPECT_LE(host_time_delta, km_time_delta + 2);
- EXPECT_LE(km_time_delta, host_time_delta + 2);
+ EXPECT_LE(host_time_delta, km_time_delta + 20);
+ EXPECT_LE(km_time_delta, host_time_delta + 20);
ASSERT_EQ(result1.token.mac.size(), result2.token.mac.size());
ASSERT_NE(0,
memcmp(result1.token.mac.data(), result2.token.mac.data(), result1.token.mac.size()));
@@ -172,14 +172,14 @@
EXPECT_GE(host_time_delta, time_to_sleep)
<< "We slept for " << time_to_sleep << " ms, the clock must have advanced by that much";
- EXPECT_LE(host_time_delta, time_to_sleep + 20)
+ EXPECT_LE(host_time_delta, time_to_sleep + 100)
<< "The verifyAuthorization call took " << (host_time_delta - time_to_sleep)
<< " ms? That's awful!";
auto km_time_delta = result2.token.timestamp - result1.token.timestamp;
- EXPECT_LE(host_time_delta, km_time_delta + 2);
- EXPECT_LE(km_time_delta, host_time_delta + 2);
+ EXPECT_LE(host_time_delta, km_time_delta + 20);
+ EXPECT_LE(km_time_delta, host_time_delta + 20);
ASSERT_EQ(result1.token.mac.size(), result2.token.mac.size());
ASSERT_NE(0,
memcmp(result1.token.mac.data(), result2.token.mac.data(), result1.token.mac.size()));
diff --git a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
index ecc5fce..f196928 100644
--- a/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
+++ b/keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp
@@ -17,9 +17,12 @@
#define LOG_TAG "keymaster_hidl_hal_test"
#include <cutils/log.h>
-#include <iostream>
#include <signal.h>
+#include <functional>
+#include <iostream>
+#include <string>
+
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <openssl/x509.h>
@@ -32,6 +35,8 @@
#include "KeymasterHidlTest.h"
+using namespace std::string_literals;
+
static bool arm_deleteAllKeys = false;
static bool dump_Attestations = false;
@@ -315,6 +320,12 @@
return property_get("ro.boot.vbmeta.device_state", value, "") != 0;
}
+bool is_gsi() {
+ char property_value[PROPERTY_VALUE_MAX] = {};
+ EXPECT_NE(property_get("ro.product.system.name", property_value, ""), 0);
+ return "mainline"s == property_value;
+}
+
} // namespace
bool verify_attestation_record(const string& challenge, const string& app_id,
@@ -512,9 +523,25 @@
EXPECT_TRUE(auths.Contains(TAG_OS_VERSION, os_version()))
<< "OS version is " << os_version() << " key reported "
<< auths.GetTagValue(TAG_OS_VERSION);
- EXPECT_TRUE(auths.Contains(TAG_OS_PATCHLEVEL, os_patch_level()))
- << "OS patch level is " << os_patch_level() << " key reported "
- << auths.GetTagValue(TAG_OS_PATCHLEVEL);
+
+ if (is_gsi()) {
+ // In general, TAG_OS_PATCHLEVEL should be equal to os_patch_level()
+ // reported from the system.img in use. But it is allowed to boot a
+ // GSI system.img with newer patch level, which means TAG_OS_PATCHLEVEL
+ // might be less than or equal to os_patch_level() in this case.
+ EXPECT_TRUE(auths.Contains(TAG_OS_PATCHLEVEL, // vbmeta.img patch level
+ os_patch_level(), // system.img patch level
+ std::less_equal<>()))
+ << "OS patch level is " << os_patch_level()
+ << ", which is less than key reported " << auths.GetTagValue(TAG_OS_PATCHLEVEL);
+ } else {
+ EXPECT_TRUE(auths.Contains(TAG_OS_PATCHLEVEL, // vbmeta.img patch level
+ os_patch_level(), // system.img patch level
+ std::equal_to<>()))
+ << "OS patch level is " << os_patch_level()
+ << ", which is not equal to key reported "
+ << auths.GetTagValue(TAG_OS_PATCHLEVEL);
+ }
}
void CheckCharacteristics(const HidlBuf& key_blob,
diff --git a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/IPowerStats.aidl b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/IPowerStats.aidl
index b13f0c7..6772f6f 100644
--- a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/IPowerStats.aidl
+++ b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/IPowerStats.aidl
@@ -20,12 +20,6 @@
interface IPowerStats {
android.hardware.powerstats.EnergyData[] getEnergyData(in int[] railIndices);
android.hardware.powerstats.PowerEntityInfo[] getPowerEntityInfo();
- android.hardware.powerstats.PowerEntityStateSpace[] getPowerEntityStateInfo(in int[] powerEntityIds);
android.hardware.powerstats.PowerEntityStateResidencyResult[] getPowerEntityStateResidencyData(in int[] powerEntityIds);
android.hardware.powerstats.RailInfo[] getRailInfo();
- const int SUCCESS = 0;
- const int NOT_SUPPORTED = 1;
- const int INVALID_INPUT = 2;
- const int FILESYSTEM_ERROR = 3;
- const int INSUFFICIENT_RESOURCES = 4;
}
diff --git a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityInfo.aidl b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityInfo.aidl
index 8cacd55..016af91 100644
--- a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityInfo.aidl
+++ b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityInfo.aidl
@@ -20,5 +20,5 @@
parcelable PowerEntityInfo {
int powerEntityId;
String powerEntityName;
- android.hardware.powerstats.PowerEntityType type;
+ android.hardware.powerstats.PowerEntityStateInfo[] states;
}
diff --git a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityStateSpace.aidl b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityStateSpace.aidl
deleted file mode 100644
index 0508fea..0000000
--- a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityStateSpace.aidl
+++ /dev/null
@@ -1,23 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.powerstats;
-@VintfStability
-parcelable PowerEntityStateSpace {
- int powerEntityId;
- android.hardware.powerstats.PowerEntityStateInfo[] states;
-}
diff --git a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityType.aidl b/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityType.aidl
deleted file mode 100644
index 5deefa9..0000000
--- a/powerstats/aidl/aidl_api/android.hardware.powerstats/current/android/hardware/powerstats/PowerEntityType.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
-// edit this file. It looks like you are doing that because you have modified
-// an AIDL interface in a backward-incompatible way, e.g., deleting a function
-// from an interface or a field from a parcelable and it broke the build. That
-// breakage is intended.
-//
-// You must not make a backward incompatible changes to the AIDL files built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package android.hardware.powerstats;
-@Backing(type="int") @VintfStability
-enum PowerEntityType {
- SUBSYSTEM = 0,
- PERIPHERAL = 1,
- POWER_DOMAIN = 2,
-}
diff --git a/powerstats/aidl/android/hardware/powerstats/IPowerStats.aidl b/powerstats/aidl/android/hardware/powerstats/IPowerStats.aidl
index f8f69e0..93d1448 100644
--- a/powerstats/aidl/android/hardware/powerstats/IPowerStats.aidl
+++ b/powerstats/aidl/android/hardware/powerstats/IPowerStats.aidl
@@ -19,17 +19,10 @@
import android.hardware.powerstats.EnergyData;
import android.hardware.powerstats.PowerEntityInfo;
import android.hardware.powerstats.PowerEntityStateResidencyResult;
-import android.hardware.powerstats.PowerEntityStateSpace;
import android.hardware.powerstats.RailInfo;
@VintfStability
interface IPowerStats {
- const int SUCCESS = 0;
- const int NOT_SUPPORTED = 1;
- const int INVALID_INPUT = 2;
- const int FILESYSTEM_ERROR = 3;
- const int INSUFFICIENT_RESOURCES = 4;
-
/**
* Rail level energy measurements for low frequency clients:
* Reports accumulated energy since boot on each rail.
@@ -53,21 +46,6 @@
PowerEntityInfo[] getPowerEntityInfo();
/**
- * PowerEntity state information:
- * Reports the set of power states for which the specified
- * PowerEntity(s) provide residency data.
- *
- * @param powerEntityIds collection of IDs of PowerEntity(s) for which
- * state information is requested. PowerEntity name to ID mapping may
- * be queried from getPowerEntityInfo(). To get state space
- * information for all PowerEntity(s) pass an empty vector.
- *
- * @return PowerEntity state space information for
- * each specified PowerEntity that provides state space information.
- */
- PowerEntityStateSpace[] getPowerEntityStateInfo(in int[] powerEntityIds);
-
- /**
* PowerEntity residencies for low frequency clients:
* Reports accumulated residency data for each specified PowerEntity.
* Each PowerEntity may reside in one of multiple states. It may also
diff --git a/powerstats/aidl/android/hardware/powerstats/PowerEntityInfo.aidl b/powerstats/aidl/android/hardware/powerstats/PowerEntityInfo.aidl
index 2b5b352..72222a6 100644
--- a/powerstats/aidl/android/hardware/powerstats/PowerEntityInfo.aidl
+++ b/powerstats/aidl/android/hardware/powerstats/PowerEntityInfo.aidl
@@ -16,7 +16,7 @@
package android.hardware.powerstats;
-import android.hardware.powerstats.PowerEntityType;
+import android.hardware.powerstats.PowerEntityStateInfo;
/**
* PowerEntityInfo contains information, such as the ID, name, and type of a
@@ -33,7 +33,7 @@
*/
String powerEntityName;
/**
- * Type of the PowerEntity
+ * List of states that the PowerEntity may reside in
*/
- PowerEntityType type;
+ PowerEntityStateInfo[] states;
}
\ No newline at end of file
diff --git a/powerstats/aidl/android/hardware/powerstats/PowerEntityStateSpace.aidl b/powerstats/aidl/android/hardware/powerstats/PowerEntityStateSpace.aidl
deleted file mode 100644
index 8e30665..0000000
--- a/powerstats/aidl/android/hardware/powerstats/PowerEntityStateSpace.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.powerstats;
-
-import android.hardware.powerstats.PowerEntityStateInfo;
-
-/**
- * PowerEntityStateSpace contains the state space information of a given
- * PowerEntity. The state space, is the set of possible states that a given
- * PowerEntity provides residency data for.
- */
-@VintfStability
-parcelable PowerEntityStateSpace {
- /**
- * Unique ID of the corresponding PowerEntity
- */
- int powerEntityId;
- /**
- * List of states that the PowerEntity may reside in
- */
- PowerEntityStateInfo[] states;
-}
-
diff --git a/powerstats/aidl/android/hardware/powerstats/PowerEntityType.aidl b/powerstats/aidl/android/hardware/powerstats/PowerEntityType.aidl
deleted file mode 100644
index a8cd0b7..0000000
--- a/powerstats/aidl/android/hardware/powerstats/PowerEntityType.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.powerstats;
-
-@VintfStability
-@Backing(type="int")
-enum PowerEntityType {
- /**
- * A subsystem is a self-contained compute unit. Some examples include
- * application processor, DSP, GPU.
- */
- SUBSYSTEM = 0,
- /**
- * A peripheral is an auxiliary device that connects to and works with a
- * compute unit. Some examples include simple sensors, camera, display.
- */
- PERIPHERAL = 1,
- /**
- * A power domain is a single subsystem or a collection of subsystems
- * that is controlled by a single voltage rail.
- */
- POWER_DOMAIN = 2,
-}
\ No newline at end of file
diff --git a/powerstats/aidl/default/PowerStats.cpp b/powerstats/aidl/default/PowerStats.cpp
index 50a829e..8d6a0ee 100644
--- a/powerstats/aidl/default/PowerStats.cpp
+++ b/powerstats/aidl/default/PowerStats.cpp
@@ -34,13 +34,7 @@
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus PowerStats::getPowerEntityStateInfo(
- const std::vector<int32_t>& in_powerEntityIds,
- std::vector<PowerEntityStateSpace>* _aidl_return) {
- (void)in_powerEntityIds;
- (void)_aidl_return;
- return ndk::ScopedAStatus::ok();
-}
+
ndk::ScopedAStatus PowerStats::getPowerEntityStateResidencyData(
const std::vector<int32_t>& in_powerEntityIds,
std::vector<PowerEntityStateResidencyResult>* _aidl_return) {
@@ -48,6 +42,7 @@
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
}
+
ndk::ScopedAStatus PowerStats::getRailInfo(std::vector<RailInfo>* _aidl_return) {
(void)_aidl_return;
return ndk::ScopedAStatus::ok();
diff --git a/powerstats/aidl/default/PowerStats.h b/powerstats/aidl/default/PowerStats.h
index 392d1e6..49240cb 100644
--- a/powerstats/aidl/default/PowerStats.h
+++ b/powerstats/aidl/default/PowerStats.h
@@ -29,9 +29,6 @@
ndk::ScopedAStatus getEnergyData(const std::vector<int32_t>& in_railIndices,
std::vector<EnergyData>* _aidl_return) override;
ndk::ScopedAStatus getPowerEntityInfo(std::vector<PowerEntityInfo>* _aidl_return) override;
- ndk::ScopedAStatus getPowerEntityStateInfo(
- const std::vector<int32_t>& in_powerEntityIds,
- std::vector<PowerEntityStateSpace>* _aidl_return) override;
ndk::ScopedAStatus getPowerEntityStateResidencyData(
const std::vector<int32_t>& in_powerEntityIds,
std::vector<PowerEntityStateResidencyResult>* _aidl_return) override;
diff --git a/powerstats/aidl/vts/Android.bp b/powerstats/aidl/vts/Android.bp
new file mode 100644
index 0000000..c61022e
--- /dev/null
+++ b/powerstats/aidl/vts/Android.bp
@@ -0,0 +1,32 @@
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_test {
+ name: "VtsHalPowerStatsTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalPowerStatsTargetTest.cpp"],
+ shared_libs: [
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.powerstats-ndk_platform",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/powerstats/aidl/vts/VtsHalPowerStatsTargetTest.cpp b/powerstats/aidl/vts/VtsHalPowerStatsTargetTest.cpp
new file mode 100644
index 0000000..b3cd233
--- /dev/null
+++ b/powerstats/aidl/vts/VtsHalPowerStatsTargetTest.cpp
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+
+#include <aidl/android/hardware/powerstats/IPowerStats.h>
+#include <android-base/properties.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+using aidl::android::hardware::powerstats::EnergyData;
+using aidl::android::hardware::powerstats::IPowerStats;
+using aidl::android::hardware::powerstats::PowerEntityInfo;
+using aidl::android::hardware::powerstats::PowerEntityStateResidencyResult;
+using aidl::android::hardware::powerstats::RailInfo;
+using ndk::SpAIBinder;
+
+class PowerStatsAidl : public testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ powerstats = IPowerStats::fromBinder(
+ SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(nullptr, powerstats.get());
+ }
+
+ std::shared_ptr<IPowerStats> powerstats;
+};
+
+TEST_P(PowerStatsAidl, TestGetEnergyData) {
+ std::vector<EnergyData> data;
+ ASSERT_TRUE(powerstats->getEnergyData({}, &data).isOk());
+}
+
+// Each PowerEntity must have a valid name
+TEST_P(PowerStatsAidl, ValidatePowerEntityNames) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ for (auto info : infos) {
+ EXPECT_NE(info.powerEntityName, "");
+ }
+}
+
+// Each power entity must have a unique name
+TEST_P(PowerStatsAidl, ValidatePowerEntityUniqueNames) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ std::set<std::string> names;
+ for (auto info : infos) {
+ EXPECT_TRUE(names.insert(info.powerEntityName).second);
+ }
+}
+
+// Each PowerEntity must have a unique ID
+TEST_P(PowerStatsAidl, ValidatePowerEntityIds) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ std::set<int32_t> ids;
+ for (auto info : infos) {
+ EXPECT_TRUE(ids.insert(info.powerEntityId).second);
+ }
+}
+
+// Each state must have a valid name
+TEST_P(PowerStatsAidl, ValidateStateNames) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ for (auto info : infos) {
+ for (auto state : info.states) {
+ EXPECT_NE(state.powerEntityStateName, "");
+ }
+ }
+}
+
+// Each state must have a name that is unique to the given PowerEntity
+TEST_P(PowerStatsAidl, ValidateStateUniqueNames) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ for (auto info : infos) {
+ std::set<std::string> stateNames;
+ for (auto state : info.states) {
+ EXPECT_TRUE(stateNames.insert(state.powerEntityStateName).second);
+ }
+ }
+}
+
+// Each state must have an ID that is unique to the given PowerEntity
+TEST_P(PowerStatsAidl, ValidateStateUniqueIds) {
+ std::vector<PowerEntityInfo> infos;
+ ASSERT_TRUE(powerstats->getPowerEntityInfo(&infos).isOk());
+
+ for (auto info : infos) {
+ std::set<uint32_t> stateIds;
+ for (auto state : info.states) {
+ EXPECT_TRUE(stateIds.insert(state.powerEntityStateId).second);
+ }
+ }
+}
+
+TEST_P(PowerStatsAidl, TestGetPowerEntityStateResidencyData) {
+ std::vector<PowerEntityStateResidencyResult> data;
+ ASSERT_TRUE(powerstats->getPowerEntityStateResidencyData({}, &data).isOk());
+}
+
+TEST_P(PowerStatsAidl, TestGetRailInfo) {
+ std::vector<RailInfo> info;
+ ASSERT_TRUE(powerstats->getRailInfo(&info).isOk());
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerStatsAidl);
+INSTANTIATE_TEST_SUITE_P(
+ PowerStats, PowerStatsAidl,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IPowerStats::descriptor)),
+ android::PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_setThreadPoolMaxThreadCount(1);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/tests/msgq/1.0/default/Android.bp b/tests/msgq/1.0/default/Android.bp
index 47b8df1..a5ba23d 100644
--- a/tests/msgq/1.0/default/Android.bp
+++ b/tests/msgq/1.0/default/Android.bp
@@ -70,6 +70,17 @@
"libbinder_ndk",
],
+ compile_multilib: "both",
+ multilib: {
+ lib32: {
+ suffix: "32",
+ },
+ lib64: {
+ suffix: "64",
+ },
+ },
+ test_suites: ["device-tests"],
+
// Allow dlsym'ing self for statically linked passthrough implementations
ldflags: ["-rdynamic"],
@@ -84,5 +95,4 @@
"android.hardware.tests.msgq@1.0-impl",
"android.fmq.test-impl",
],
- test_suites: ["general-tests"],
}
diff --git a/tv/tuner/1.1/IFrontend.hal b/tv/tuner/1.1/IFrontend.hal
index b570549..0b0ce39 100644
--- a/tv/tuner/1.1/IFrontend.hal
+++ b/tv/tuner/1.1/IFrontend.hal
@@ -67,4 +67,18 @@
*/
scan_1_1(FrontendSettings settings, FrontendScanType type, FrontendSettingsExt settingsExt)
generates (Result result);
+
+ /**
+ * Link Conditional Access Modules (CAM) to Frontend support Common Interface (CI) bypass mode.
+ *
+ * The client may use this to link CI-CAM to a frontend. CI bypass mode requires that the
+ * CICAM also receives the TS concurrently from the frontend when the Demux is receiving the TS
+ * directly from the frontend.
+ *
+ * @param ciCamId specify CI-CAM Id to link.
+ * @return result Result status of the operation.
+ * SUCCESS if successful,
+ * UNKNOWN_ERROR if failed for other reasons.
+ */
+ linkCiCam(uint32_t ciCamId) generates (Result result);
};
diff --git a/tv/tuner/1.1/default/Frontend.cpp b/tv/tuner/1.1/default/Frontend.cpp
index 1e9435b..467d547 100644
--- a/tv/tuner/1.1/default/Frontend.cpp
+++ b/tv/tuner/1.1/default/Frontend.cpp
@@ -273,6 +273,14 @@
return Result::SUCCESS;
}
+Return<Result> Frontend::linkCiCam(uint32_t ciCamId) {
+ ALOGV("%s", __FUNCTION__);
+
+ mCiCamId = ciCamId;
+
+ return Result::SUCCESS;
+}
+
FrontendType Frontend::getFrontendType() {
return mType;
}
diff --git a/tv/tuner/1.1/default/Frontend.h b/tv/tuner/1.1/default/Frontend.h
index d44f4ae..6a80232 100644
--- a/tv/tuner/1.1/default/Frontend.h
+++ b/tv/tuner/1.1/default/Frontend.h
@@ -62,6 +62,8 @@
virtual Return<Result> setLnb(uint32_t lnb) override;
+ virtual Return<Result> linkCiCam(uint32_t ciCamId) override;
+
FrontendType getFrontendType();
FrontendId getFrontendId();
@@ -78,6 +80,7 @@
FrontendType mType = FrontendType::UNDEFINED;
FrontendId mId = 0;
bool mIsLocked = false;
+ uint32_t mCiCamId;
std::ifstream mFrontendData;
};
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index 14a8509..cad54fe 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -30,6 +30,8 @@
],
static_libs: [
"android.hardware.wifi@1.0",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.5",
"libwifi-system-iface",
],
}
@@ -49,6 +51,8 @@
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
"libwifi-system-iface",
],
test_suites: [
diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
index b17d2ad..6c8f560 100644
--- a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp
@@ -18,7 +18,6 @@
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/1.0/IWifiChip.h>
-#include <android/hardware/wifi/1.3/IWifiChip.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -94,23 +93,7 @@
uint32_t configureChipForStaIfaceAndGetCapabilities() {
configureChipForIfaceType(IfaceType::STA, true);
- sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
- ::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
-
- std::pair<WifiStatus, uint32_t> status_and_caps;
-
- if (chip_converted != nullptr) {
- // Call the newer HAL version
- status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
- } else {
- status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
- }
-
- if (status_and_caps.first.code != WifiStatusCode::SUCCESS) {
- EXPECT_EQ(WifiStatusCode::ERROR_NOT_SUPPORTED, status_and_caps.first.code);
- return 0;
- }
- return status_and_caps.second;
+ return getChipCapabilitiesLatest(wifi_chip_);
}
std::string getIfaceName(const sp<IWifiIface>& iface) {
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
index 092822f..e6e61cf 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
@@ -16,6 +16,8 @@
#include <android/log.h>
+#include <android/hardware/wifi/1.3/IWifiChip.h>
+#include <android/hardware/wifi/1.5/IWifiChip.h>
#include <wifi_system/interface_tool.h>
#include "wifi_hidl_call_util.h"
@@ -208,3 +210,24 @@
ASSERT_NE(wifi, nullptr);
HIDL_INVOKE(wifi, stop);
}
+
+uint32_t getChipCapabilitiesLatest(const sp<IWifiChip>& wifi_chip) {
+ sp<::android::hardware::wifi::V1_5::IWifiChip> chip_converted15 =
+ ::android::hardware::wifi::V1_5::IWifiChip::castFrom(wifi_chip);
+ sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted13 =
+ ::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip);
+ std::pair<WifiStatus, uint32_t> status_and_caps;
+
+ if (chip_converted15 != nullptr) {
+ // Call the newer HAL 1.5 version
+ status_and_caps = HIDL_INVOKE(chip_converted15, getCapabilities_1_5);
+ } else if (chip_converted13 != nullptr) {
+ // Call the newer HAL 1.3 version
+ status_and_caps = HIDL_INVOKE(chip_converted13, getCapabilities_1_3);
+ } else {
+ status_and_caps = HIDL_INVOKE(wifi_chip, getCapabilities);
+ }
+
+ EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
+ return status_and_caps.second;
+}
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
index 5c78637..62c015c 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
@@ -51,3 +51,5 @@
android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
// Used to trigger IWifi.stop() at the end of every test.
void stopWifi(const std::string& instance_name);
+uint32_t getChipCapabilitiesLatest(
+ const android::sp<android::hardware::wifi::V1_0::IWifiChip>& wifi_chip);
diff --git a/wifi/1.1/vts/functional/Android.bp b/wifi/1.1/vts/functional/Android.bp
index 7dc78e4..9893137 100644
--- a/wifi/1.1/vts/functional/Android.bp
+++ b/wifi/1.1/vts/functional/Android.bp
@@ -26,6 +26,8 @@
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
"libwifi-system-iface",
],
test_suites: [
diff --git a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
index 68c2965..874aa83 100644
--- a/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.1/vts/functional/wifi_chip_hidl_test.cpp
@@ -18,7 +18,6 @@
#include <android/hardware/wifi/1.1/IWifi.h>
#include <android/hardware/wifi/1.1/IWifiChip.h>
-#include <android/hardware/wifi/1.3/IWifiChip.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -64,20 +63,7 @@
EXPECT_TRUE(configureChipToSupportIfaceType(
wifi_chip_, IfaceType::STA, &mode_id));
- sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
- ::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
-
- std::pair<WifiStatus, uint32_t> status_and_caps;
-
- if (chip_converted != nullptr) {
- // Call the newer HAL version
- status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
- } else {
- status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
- }
-
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
- return status_and_caps.second;
+ return getChipCapabilitiesLatest(wifi_chip_);
}
sp<IWifiChip> wifi_chip_;
diff --git a/wifi/1.2/vts/functional/Android.bp b/wifi/1.2/vts/functional/Android.bp
index 159ba94..21d8388 100644
--- a/wifi/1.2/vts/functional/Android.bp
+++ b/wifi/1.2/vts/functional/Android.bp
@@ -27,6 +27,8 @@
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
"libwifi-system-iface",
],
disable_framework: true,
@@ -47,6 +49,9 @@
"android.hardware.wifi@1.0",
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
"libwifi-system-iface",
],
test_suites: [
diff --git a/wifi/1.2/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.2/vts/functional/wifi_chip_hidl_test.cpp
index 8d91a23..6113fbf 100644
--- a/wifi/1.2/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.2/vts/functional/wifi_chip_hidl_test.cpp
@@ -111,20 +111,7 @@
EXPECT_TRUE(
configureChipToSupportIfaceType(wifi_chip_, IfaceType::STA, &mode_id));
- sp<::android::hardware::wifi::V1_3::IWifiChip> chip_converted =
- ::android::hardware::wifi::V1_3::IWifiChip::castFrom(wifi_chip_);
-
- std::pair<WifiStatus, uint32_t> status_and_caps;
-
- if (chip_converted != nullptr) {
- // Call the newer HAL version
- status_and_caps = HIDL_INVOKE(chip_converted, getCapabilities_1_3);
- } else {
- status_and_caps = HIDL_INVOKE(wifi_chip_, getCapabilities);
- }
-
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
- return status_and_caps.second;
+ return getChipCapabilitiesLatest(wifi_chip_);
}
sp<IWifiChip> wifi_chip_;
diff --git a/wifi/1.3/vts/functional/Android.bp b/wifi/1.3/vts/functional/Android.bp
index 3568330..7ee69c9 100644
--- a/wifi/1.3/vts/functional/Android.bp
+++ b/wifi/1.3/vts/functional/Android.bp
@@ -27,8 +27,13 @@
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
- "libwifi-system-iface"
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
+ "libwifi-system-iface",
],
disable_framework: true,
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp
index 361a870..f2c2bea 100644
--- a/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp
+++ b/wifi/1.3/vts/functional/wifi_chip_hidl_test.cpp
@@ -68,10 +68,7 @@
ChipModeId mode_id;
EXPECT_TRUE(configureChipToSupportIfaceType(wifi_chip_, IfaceType::STA,
&mode_id));
- const auto& status_and_caps =
- HIDL_INVOKE(wifi_chip_, getCapabilities_1_3);
- EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_caps.first.code);
- return status_and_caps.second;
+ return getChipCapabilitiesLatest(wifi_chip_);
}
sp<IWifiChip> wifi_chip_;
diff --git a/wifi/1.5/Android.bp b/wifi/1.5/Android.bp
index 1714ef8..5304760 100644
--- a/wifi/1.5/Android.bp
+++ b/wifi/1.5/Android.bp
@@ -4,7 +4,9 @@
name: "android.hardware.wifi@1.5",
root: "android.hardware",
srcs: [
+ "types.hal",
"IWifi.hal",
+ "IWifiChip.hal",
],
interfaces: [
"android.hardware.wifi@1.0",
diff --git a/wifi/1.5/IWifiChip.hal b/wifi/1.5/IWifiChip.hal
new file mode 100644
index 0000000..5243baf
--- /dev/null
+++ b/wifi/1.5/IWifiChip.hal
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi@1.5;
+
+import @1.0::WifiStatus;
+import @1.0::IWifiIface;
+import @1.3::IWifiChip;
+import @1.4::IWifiChip;
+
+/**
+ * Interface that represents a chip that must be configured as a single unit.
+ */
+interface IWifiChip extends @1.4::IWifiChip {
+ /**
+ * Capabilities exposed by this chip.
+ */
+ enum ChipCapabilityMask : @1.3::IWifiChip.ChipCapabilityMask {
+ /**
+ * chip can operate in the 60GHz band(WiGig chip)
+ */
+ WIGIG = 1 << 14,
+ };
+
+ /**
+ * Get the capabilities supported by this chip.
+ *
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ * @return capabilities Bitset of |ChipCapabilityMask| values.
+ */
+ getCapabilities_1_5()
+ generates (WifiStatus status, bitfield<ChipCapabilityMask> capabilities);
+};
diff --git a/wifi/1.5/default/hidl_struct_util.cpp b/wifi/1.5/default/hidl_struct_util.cpp
index a155ff8..91a82a7 100644
--- a/wifi/1.5/default/hidl_struct_util.cpp
+++ b/wifi/1.5/default/hidl_struct_util.cpp
@@ -69,9 +69,9 @@
return {};
}
-V1_3::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(
- uint32_t feature) {
- using HidlChipCaps = V1_3::IWifiChip::ChipCapabilityMask;
+V1_5::IWifiChip::ChipCapabilityMask convertLegacyFeatureToHidlChipCapability(
+ uint64_t feature) {
+ using HidlChipCaps = V1_5::IWifiChip::ChipCapabilityMask;
switch (feature) {
case WIFI_FEATURE_SET_TX_POWER_LIMIT:
return HidlChipCaps::SET_TX_POWER_LIMIT;
@@ -81,6 +81,8 @@
return HidlChipCaps::D2D_RTT;
case WIFI_FEATURE_D2AP_RTT:
return HidlChipCaps::D2AP_RTT;
+ case WIFI_FEATURE_INFRA_60G:
+ return HidlChipCaps::WIGIG;
case WIFI_FEATURE_SET_LATENCY_MODE:
return HidlChipCaps::SET_LATENCY_MODE;
case WIFI_FEATURE_P2P_RAND_MAC:
@@ -126,7 +128,7 @@
}
bool convertLegacyFeaturesToHidlChipCapabilities(
- uint32_t legacy_feature_set, uint32_t legacy_logger_feature_set,
+ uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set,
uint32_t* hidl_caps) {
if (!hidl_caps) {
return false;
@@ -143,10 +145,11 @@
convertLegacyLoggerFeatureToHidlChipCapability(feature);
}
}
- std::vector<uint32_t> features = {WIFI_FEATURE_SET_TX_POWER_LIMIT,
+ std::vector<uint64_t> features = {WIFI_FEATURE_SET_TX_POWER_LIMIT,
WIFI_FEATURE_USE_BODY_HEAD_SAR,
WIFI_FEATURE_D2D_RTT,
WIFI_FEATURE_D2AP_RTT,
+ WIFI_FEATURE_INFRA_60G,
WIFI_FEATURE_SET_LATENCY_MODE,
WIFI_FEATURE_P2P_RAND_MAC};
for (const auto feature : features) {
diff --git a/wifi/1.5/default/hidl_struct_util.h b/wifi/1.5/default/hidl_struct_util.h
index b6567ff..c6dc692 100644
--- a/wifi/1.5/default/hidl_struct_util.h
+++ b/wifi/1.5/default/hidl_struct_util.h
@@ -22,10 +22,10 @@
#include <android/hardware/wifi/1.0/IWifiChip.h>
#include <android/hardware/wifi/1.0/types.h>
#include <android/hardware/wifi/1.2/types.h>
-#include <android/hardware/wifi/1.3/IWifiChip.h>
#include <android/hardware/wifi/1.3/types.h>
#include <android/hardware/wifi/1.4/IWifiChipEventCallback.h>
#include <android/hardware/wifi/1.4/types.h>
+#include <android/hardware/wifi/1.5/IWifiChip.h>
#include "wifi_legacy_hal.h"
@@ -45,7 +45,7 @@
// Chip conversion methods.
bool convertLegacyFeaturesToHidlChipCapabilities(
- uint32_t legacy_feature_set, uint32_t legacy_logger_feature_set,
+ uint64_t legacy_feature_set, uint32_t legacy_logger_feature_set,
uint32_t* hidl_caps);
bool convertLegacyDebugRingBufferStatusToHidl(
const legacy_hal::wifi_ring_buffer_status& legacy_status,
diff --git a/wifi/1.5/default/wifi_chip.cpp b/wifi/1.5/default/wifi_chip.cpp
index ecf170a..ebff722 100644
--- a/wifi/1.5/default/wifi_chip.cpp
+++ b/wifi/1.5/default/wifi_chip.cpp
@@ -628,6 +628,13 @@
hidl_status_cb);
}
+Return<void> WifiChip::getCapabilities_1_5(
+ getCapabilities_1_5_cb hidl_status_cb) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::getCapabilitiesInternal_1_5,
+ hidl_status_cb);
+}
+
Return<void> WifiChip::debug(const hidl_handle& handle,
const hidl_vec<hidl_string>&) {
if (handle != nullptr && handle->numFds >= 1) {
@@ -1237,8 +1244,13 @@
}
std::pair<WifiStatus, uint32_t> WifiChip::getCapabilitiesInternal_1_3() {
+ // Deprecated support for this callback.
+ return {createWifiStatus(WifiStatusCode::ERROR_NOT_SUPPORTED), 0};
+}
+
+std::pair<WifiStatus, uint32_t> WifiChip::getCapabilitiesInternal_1_5() {
legacy_hal::wifi_error legacy_status;
- uint32_t legacy_feature_set;
+ uint64_t legacy_feature_set;
uint32_t legacy_logger_feature_set;
const auto ifname = getFirstActiveWlanIfaceName();
std::tie(legacy_status, legacy_feature_set) =
diff --git a/wifi/1.5/default/wifi_chip.h b/wifi/1.5/default/wifi_chip.h
index 5f1d9e8..8cc0452 100644
--- a/wifi/1.5/default/wifi_chip.h
+++ b/wifi/1.5/default/wifi_chip.h
@@ -22,8 +22,8 @@
#include <mutex>
#include <android-base/macros.h>
-#include <android/hardware/wifi/1.4/IWifiChip.h>
#include <android/hardware/wifi/1.4/IWifiRttController.h>
+#include <android/hardware/wifi/1.5/IWifiChip.h>
#include "hidl_callback_util.h"
#include "ringbuffer.h"
@@ -48,7 +48,7 @@
* Since there is only a single chip instance used today, there is no
* identifying handle information stored here.
*/
-class WifiChip : public V1_4::IWifiChip {
+class WifiChip : public V1_5::IWifiChip {
public:
WifiChip(ChipId chip_id, bool is_primary,
const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
@@ -153,6 +153,8 @@
selectTxPowerScenario_cb hidl_status_cb) override;
Return<void> getCapabilities_1_3(
getCapabilities_cb hidl_status_cb) override;
+ Return<void> getCapabilities_1_5(
+ getCapabilities_1_5_cb hidl_status_cb) override;
Return<void> debug(const hidl_handle& handle,
const hidl_vec<hidl_string>& options) override;
Return<void> createRttController_1_4(
@@ -226,6 +228,7 @@
const sp<V1_2::IWifiChipEventCallback>& event_callback);
WifiStatus selectTxPowerScenarioInternal_1_2(TxPowerScenario scenario);
std::pair<WifiStatus, uint32_t> getCapabilitiesInternal_1_3();
+ std::pair<WifiStatus, uint32_t> getCapabilitiesInternal_1_5();
std::pair<WifiStatus, sp<V1_4::IWifiRttController>>
createRttControllerInternal_1_4(const sp<IWifiIface>& bound_iface);
WifiStatus registerEventCallbackInternal_1_4(
diff --git a/wifi/1.5/default/wifi_legacy_hal.cpp b/wifi/1.5/default/wifi_legacy_hal.cpp
index 7d14e9d..398bfac 100644
--- a/wifi/1.5/default/wifi_legacy_hal.cpp
+++ b/wifi/1.5/default/wifi_legacy_hal.cpp
@@ -486,7 +486,7 @@
return {status, std::move(firmware_dump)};
}
-std::pair<wifi_error, uint32_t> WifiLegacyHal::getSupportedFeatureSet(
+std::pair<wifi_error, uint64_t> WifiLegacyHal::getSupportedFeatureSet(
const std::string& iface_name) {
feature_set set = 0, chip_set = 0;
wifi_error status = WIFI_SUCCESS;
@@ -502,7 +502,7 @@
status = global_func_table_.wifi_get_supported_feature_set(iface_handle,
&set);
}
- return {status, static_cast<uint32_t>(set | chip_set)};
+ return {status, static_cast<uint64_t>(set | chip_set)};
}
std::pair<wifi_error, PacketFilterCapabilities>
diff --git a/wifi/1.5/default/wifi_legacy_hal.h b/wifi/1.5/default/wifi_legacy_hal.h
index 2984a00..9a06efd 100644
--- a/wifi/1.5/default/wifi_legacy_hal.h
+++ b/wifi/1.5/default/wifi_legacy_hal.h
@@ -196,7 +196,7 @@
const std::string& iface_name);
std::pair<wifi_error, std::vector<uint8_t>> requestFirmwareMemoryDump(
const std::string& iface_name);
- std::pair<wifi_error, uint32_t> getSupportedFeatureSet(
+ std::pair<wifi_error, uint64_t> getSupportedFeatureSet(
const std::string& iface_name);
// APF functions.
std::pair<wifi_error, PacketFilterCapabilities> getPacketFilterCapabilities(
diff --git a/wifi/1.5/types.hal b/wifi/1.5/types.hal
new file mode 100644
index 0000000..71f0679
--- /dev/null
+++ b/wifi/1.5/types.hal
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.wifi@1.5;
+
+import @1.0::WifiBand;
+
+/**
+ * Wifi bands defined in 80211 spec.
+ */
+enum WifiBand : @1.0::WifiBand {
+ /**
+ * 60 GHz.
+ */
+ BAND_60GHZ = 16,
+ /**
+ * 2.4 GHz + 5 GHz no DFS + 6 GHz + 60 GHz.
+ */
+ BAND_24GHZ_5GHZ_6GHZ_60GHZ = 27,
+ /**
+ * 2.4 GHz + 5 GHz with DFS + 6 GHz + 60 GHz.
+ */
+ BAND_24GHZ_5GHZ_WITH_DFS_6GHZ_60GHZ = 31,
+};