Snap for 8730993 from 0f42a3ef2a2a8d58ca05f941e362deb815e3d5ed to mainline-tzdata3-release
Change-Id: Ib646aeb54523621190fbcdd44eb4a9094dcc6ed8
diff --git a/Android.bp b/Android.bp
index 235be50..3bee8ab 100644
--- a/Android.bp
+++ b/Android.bp
@@ -15,6 +15,7 @@
"-Wall",
"-Werror",
],
+ group_static_libs: true,
}
cc_defaults {
diff --git a/neuralnetworks/V1_0/target/AndroidTest.xml b/neuralnetworks/V1_0/target/AndroidTest.xml
new file mode 100644
index 0000000..1ef1af9
--- /dev/null
+++ b/neuralnetworks/V1_0/target/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for VTS VtsHalNeuralnetworksV1_0Target test cases">
+ <option name="config-descriptor:metadata" key="plan" value="vts-hal" />
+ <option name="config-descriptor:metadata" key="plan" value="vts10" />
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false"/>
+ <option name="push-group" value="HalHidlTargetTest.push"/>
+ <option name="push" value="DATA/nativetest/VtsHalNeuralnetworksV1_0TargetTest/VtsHalNeuralnetworksV1_0TargetTest->/data/nativetest/VtsHalNeuralnetworksV1_0TargetTest/VtsHalNeuralnetworksV1_0TargetTest"/>
+ <option name="push" value="DATA/nativetest64/VtsHalNeuralnetworksV1_0TargetTest/VtsHalNeuralnetworksV1_0TargetTest->/data/nativetest64/VtsHalNeuralnetworksV1_0TargetTest/VtsHalNeuralnetworksV1_0TargetTest"/>
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.GTest">
+ <option name="module-name" value="VtsHalNeuralnetworksV1_0TargetTest"/>
+ <option name="native-test-timeout" value="30m"/>
+ </test>
+</configuration>
diff --git a/neuralnetworks/V1_1/target/AndroidTest.xml b/neuralnetworks/V1_1/target/AndroidTest.xml
new file mode 100644
index 0000000..a8c825d
--- /dev/null
+++ b/neuralnetworks/V1_1/target/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for VTS VtsHalNeuralnetworksV1_1Target test cases">
+ <option name="config-descriptor:metadata" key="plan" value="vts-hal" />
+ <option name="config-descriptor:metadata" key="plan" value="vts10" />
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false"/>
+ <option name="push-group" value="HalHidlTargetTest.push"/>
+ <option name="push" value="DATA/nativetest/VtsHalNeuralnetworksV1_1TargetTest/VtsHalNeuralnetworksV1_1TargetTest->/data/nativetest/VtsHalNeuralnetworksV1_1TargetTest/VtsHalNeuralnetworksV1_1TargetTest"/>
+ <option name="push" value="DATA/nativetest64/VtsHalNeuralnetworksV1_1TargetTest/VtsHalNeuralnetworksV1_1TargetTest->/data/nativetest64/VtsHalNeuralnetworksV1_1TargetTest/VtsHalNeuralnetworksV1_1TargetTest"/>
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.GTest">
+ <option name="module-name" value="VtsHalNeuralnetworksV1_1TargetTest"/>
+ <option name="native-test-timeout" value="1h"/>
+ </test>
+</configuration>
diff --git a/neuralnetworks/V1_2/benchmark/java/AndroidTest.xml b/neuralnetworks/V1_2/benchmark/java/AndroidTest.xml
index 2e80c83..681bed8 100644
--- a/neuralnetworks/V1_2/benchmark/java/AndroidTest.xml
+++ b/neuralnetworks/V1_2/benchmark/java/AndroidTest.xml
@@ -27,6 +27,5 @@
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="package" value="com.android.nn.benchmark.vts.v1_2" />
<option name="test-timeout" value="2h"/>
- <option name="shell-timeout" value="1h" />
</test>
</configuration>
diff --git a/neuralnetworks/V1_2/benchmark/java/OWNERS b/neuralnetworks/V1_2/benchmark/java/OWNERS
deleted file mode 100644
index a48301d..0000000
--- a/neuralnetworks/V1_2/benchmark/java/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# Bug component: 195575
-jeanluc@google.com
-miaowang@google.com
-pszczepaniak@google.com
diff --git a/neuralnetworks/V1_2/target/AndroidTest.xml b/neuralnetworks/V1_2/target/AndroidTest.xml
new file mode 100644
index 0000000..f24ef59
--- /dev/null
+++ b/neuralnetworks/V1_2/target/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for VTS VtsHalNeuralnetworksV1_2Target test cases">
+ <option name="config-descriptor:metadata" key="plan" value="vts-hal" />
+ <option name="config-descriptor:metadata" key="plan" value="vts10" />
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false"/>
+ <option name="push-group" value="HalHidlTargetTest.push"/>
+ <option name="push" value="DATA/nativetest/VtsHalNeuralnetworksV1_2TargetTest/VtsHalNeuralnetworksV1_2TargetTest->/data/nativetest/VtsHalNeuralnetworksV1_2TargetTest/VtsHalNeuralnetworksV1_2TargetTest"/>
+ <option name="push" value="DATA/nativetest64/VtsHalNeuralnetworksV1_2TargetTest/VtsHalNeuralnetworksV1_2TargetTest->/data/nativetest64/VtsHalNeuralnetworksV1_2TargetTest/VtsHalNeuralnetworksV1_2TargetTest"/>
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.GTest">
+ <option name="module-name" value="VtsHalNeuralnetworksV1_2TargetTest"/>
+ <option name="native-test-timeout" value="10h"/>
+ </test>
+</configuration>
diff --git a/neuralnetworks/V1_3/benchmark/java/AndroidTest.xml b/neuralnetworks/V1_3/benchmark/java/AndroidTest.xml
index 501a2c1..e558005 100644
--- a/neuralnetworks/V1_3/benchmark/java/AndroidTest.xml
+++ b/neuralnetworks/V1_3/benchmark/java/AndroidTest.xml
@@ -27,6 +27,5 @@
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="package" value="com.android.nn.benchmark.vts.v1_3" />
<option name="test-timeout" value="2h"/>
- <option name="shell-timeout" value="1h" />
</test>
</configuration>
diff --git a/neuralnetworks/V1_3/benchmark/java/OWNERS b/neuralnetworks/V1_3/benchmark/java/OWNERS
deleted file mode 100644
index a48301d..0000000
--- a/neuralnetworks/V1_3/benchmark/java/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-# Bug component: 195575
-jeanluc@google.com
-miaowang@google.com
-pszczepaniak@google.com
diff --git a/neuralnetworks/V1_3/target/AndroidTest.xml b/neuralnetworks/V1_3/target/AndroidTest.xml
new file mode 100644
index 0000000..1cfccd7
--- /dev/null
+++ b/neuralnetworks/V1_3/target/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Config for VTS VtsHalNeuralnetworksV1_3Target test cases">
+ <option name="config-descriptor:metadata" key="plan" value="vts-hal" />
+ <option name="config-descriptor:metadata" key="plan" value="vts10" />
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false"/>
+ <option name="push-group" value="HalHidlTargetTest.push"/>
+ <option name="push" value="DATA/nativetest/VtsHalNeuralnetworksV1_3TargetTest/VtsHalNeuralnetworksV1_3TargetTest->/data/nativetest/VtsHalNeuralnetworksV1_3TargetTest/VtsHalNeuralnetworksV1_3TargetTest"/>
+ <option name="push" value="DATA/nativetest64/VtsHalNeuralnetworksV1_3TargetTest/VtsHalNeuralnetworksV1_3TargetTest->/data/nativetest64/VtsHalNeuralnetworksV1_3TargetTest/VtsHalNeuralnetworksV1_3TargetTest"/>
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.GTest">
+ <option name="module-name" value="VtsHalNeuralnetworksV1_3TargetTest"/>
+ <option name="native-test-timeout" value="10h"/>
+ </test>
+</configuration>
diff --git a/treble/OWNERS b/treble/OWNERS
index f32487d..2c6bc15 100644
--- a/treble/OWNERS
+++ b/treble/OWNERS
@@ -1,4 +1,5 @@
elsk@google.com
+hridya@google.com
malchev@google.com
smoreland@google.com
trong@google.com
diff --git a/treble/platform_version/OWNERS b/treble/platform_version/OWNERS
deleted file mode 100644
index d5b3a2f..0000000
--- a/treble/platform_version/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# Bug component: 151862
-smoreland@google.com
-elsk@google.com
diff --git a/treble/vintf/Android.bp b/treble/vintf/Android.bp
index 51ce8e6..55824a9 100644
--- a/treble/vintf/Android.bp
+++ b/treble/vintf/Android.bp
@@ -44,6 +44,7 @@
"libvintf",
"libvts_vintf_test_common",
],
+ group_static_libs: true,
srcs: [
"VtsTrebleVintfTestBase.cpp",
"utils.cpp",
diff --git a/treble/vintf/DeviceManifestTest.cpp b/treble/vintf/DeviceManifestTest.cpp
index 9a655fe..48c2e05 100644
--- a/treble/vintf/DeviceManifestTest.cpp
+++ b/treble/vintf/DeviceManifestTest.cpp
@@ -45,24 +45,21 @@
}
TEST_F(DeviceManifestTest, KernelFcmVersion) {
- const char* kHeader =
- "Kernel FCM version (specified in VINTF manifests with <kernel "
- "target-level=\"[0-9]+\"/> if not by /proc/version) ";
Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
if (shipping_fcm_version == Level::UNSPECIFIED ||
shipping_fcm_version < Level::R) {
- GTEST_SKIP() << kHeader << " not enforced on target FCM version "
+ GTEST_SKIP() << "Kernel FCM version not enforced on target FCM version "
<< shipping_fcm_version;
}
std::string error;
Level kernel_fcm_version = VintfObject::GetInstance()->getKernelLevel(&error);
ASSERT_NE(Level::UNSPECIFIED, kernel_fcm_version)
- << kHeader << " must be specified for target FCM version '"
+ << "Kernel FCM version must be specified for target FCM version '"
<< shipping_fcm_version << "': " << error;
ASSERT_GE(kernel_fcm_version, shipping_fcm_version)
- << kHeader << " is " << kernel_fcm_version
- << ", but it must be greater or equal to target FCM version "
+ << "Kernel FCM version " << kernel_fcm_version
+ << " must be greater or equal to target FCM version "
<< shipping_fcm_version;
}
@@ -79,13 +76,13 @@
// Tests that devices launching R support mapper@4.0. Go devices are exempt
// from this requirement, so we use this test to enforce instead of the
// compatibility matrix.
-TEST_F(DeviceManifestTest, GraphicsMapperHalVersionCompatibility) {
+TEST_F(DeviceManifestTest, GrallocHalVersionCompatibility) {
Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
bool is_go_device =
android::base::GetBoolProperty("ro.config.low_ram", false);
if (shipping_fcm_version == Level::UNSPECIFIED ||
shipping_fcm_version < Level::R || is_go_device) {
- GTEST_SKIP() << "Graphics mapper 4 is only required on launching R devices";
+ GTEST_SKIP() << "Gralloc4 is only required on launching R devices";
}
ASSERT_TRUE(vendor_manifest_->hasHidlInstance(
@@ -96,81 +93,6 @@
"android.hardware.graphics.mapper", {2, 1}, "IMapper", "default"));
}
-// Devices with Shipping FCM version 3~6 must have either the HIDL or the
-// AIDL health HAL. Because compatibility matrices cannot express OR condition
-// between <hal>'s, add a test here.
-//
-// There's no need to enforce minimum HAL versions because
-// NoDeprecatedHalsOnManifest already checks it.
-TEST_F(DeviceManifestTest, HealthHal) {
- bool has_hidl = vendor_manifest_->hasHidlInstance(
- "android.hardware.health", {2, 0}, "IHealth", "default");
- bool has_aidl = vendor_manifest_->hasAidlInstance("android.hardware.health",
- 1, "IHealth", "default");
- ASSERT_TRUE(has_hidl || has_aidl)
- << "Device must have either health HIDL HAL or AIDL HAL";
-}
-
-// Devices with Shipping FCM version 7 must have either the HIDL or the
-// AIDL composer HAL. Because compatibility matrices cannot express OR condition
-// between <hal>'s, add a test here.
-//
-// There's no need to enforce minimum HAL versions because
-// NoDeprecatedHalsOnManifest already checks it.
-TEST_F(DeviceManifestTest, ComposerHal) {
- bool has_hidl = vendor_manifest_->hasHidlInstance(
- "android.hardware.graphics.composer", {2, 1}, "IComposer", "default");
- bool has_aidl = vendor_manifest_->hasAidlInstance(
- "android.hardware.graphics.composer3", 1, "IComposer", "default");
- ASSERT_TRUE(has_hidl || has_aidl)
- << "Device must have either composer HIDL HAL or AIDL HAL";
-}
-
-// Devices with Shipping FCM version 7 must have either the HIDL or the
-// AIDL gralloc HAL. Because compatibility matrices cannot express OR condition
-// between <hal>'s, add a test here.
-//
-// There's no need to enforce minimum HAL versions because
-// NoDeprecatedHalsOnManifest already checks it.
-TEST_F(DeviceManifestTest, GrallocHal) {
- bool has_hidl = false;
- for (size_t hidl_major = 2; hidl_major <= 4; hidl_major++)
- has_hidl = has_hidl || vendor_manifest_->hasHidlInstance(
- "android.hardware.graphics.allocator",
- {hidl_major, 0}, "IAllocator", "default");
-
- bool has_aidl = vendor_manifest_->hasAidlInstance(
- "android.hardware.graphics.allocator", 1, "IAllocator", "default");
-
- ASSERT_TRUE(has_hidl || has_aidl)
- << "Device must have either graphics allocator HIDL HAL or AIDL HAL";
-}
-
-// Tests that devices launching T support allocator@4.0 or AIDL.
-// Go devices are exempt
-// from this requirement, so we use this test to enforce instead of the
-// compatibility matrix.
-TEST_F(DeviceManifestTest, GrallocHalVersionCompatibility) {
- Level shipping_fcm_version = VintfObject::GetDeviceHalManifest()->level();
- bool is_go_device =
- android::base::GetBoolProperty("ro.config.low_ram", false);
- if (shipping_fcm_version == Level::UNSPECIFIED ||
- shipping_fcm_version < Level::T || is_go_device) {
- GTEST_SKIP() << "Gralloc 4.0/AIDL is only required on launching T devices";
- }
-
- bool has_aidl = vendor_manifest_->hasAidlInstance(
- "android.hardware.graphics.allocator", 1, "IAllocator", "default");
- bool has_hidl_4_0 = vendor_manifest_->hasHidlInstance(
- "android.hardware.graphics.allocator", {4, 0}, "IAllocator", "default");
- ASSERT_TRUE(has_aidl || has_hidl_4_0);
-
- ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
- "android.hardware.graphics.allocator", {2, 0}, "IAllocator", "default"));
- ASSERT_FALSE(vendor_manifest_->hasHidlInstance(
- "android.hardware.graphics.allocator", {3, 0}, "IAllocator", "default"));
-}
-
static std::vector<HalManifestPtr> GetTestManifests() {
return {
VintfObject::GetDeviceHalManifest(),
diff --git a/treble/vintf/OWNERS b/treble/vintf/OWNERS
deleted file mode 100644
index 8d7d421..0000000
--- a/treble/vintf/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# Bug component: 192869
-smoreland@google.com
-elsk@google.com
diff --git a/treble/vintf/SingleManifestTest.cpp b/treble/vintf/SingleManifestTest.cpp
index 3a9d552..c1a3a54 100644
--- a/treble/vintf/SingleManifestTest.cpp
+++ b/treble/vintf/SingleManifestTest.cpp
@@ -17,7 +17,6 @@
#include "SingleManifestTest.h"
#include <aidl/metadata.h>
-#include <android-base/hex.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <android/apex/ApexInfo.h>
@@ -134,7 +133,7 @@
return nullptr;
}
- auto hal_service = VtsTrebleVintfTestBase::GetHidlService(
+ auto hal_service = VtsTrebleVintfTestBase::GetHalService(
interface.string(), fq_instance.getInstance(), Transport::PASSTHROUGH);
if (hal_service != nullptr) {
@@ -272,8 +271,7 @@
std::inserter(passthrough_not_allowed, passthrough_not_allowed.begin()));
EXPECT_TRUE(passthrough_not_allowed.empty())
- << "The following HALs can't be passthrough under Treble rules (or they "
- "can't be retrieved): ["
+ << "The following HALs can't be passthrough under Treble rules: ["
<< InstancesToString(passthrough_not_allowed) << "].";
}
@@ -314,12 +312,12 @@
const FQName lowest_name =
fq_name.withVersion(fq_name.getPackageMajorVersion(), 0);
- hal_service = GetHidlService(lowest_name, instance_name, transport);
+ hal_service = GetHalService(lowest_name, instance_name, transport);
EXPECT_TRUE(
canCastInterface(hal_service.get(), fq_name.string().c_str()))
<< fq_name.string() << " is not on the device.";
} else {
- hal_service = GetHidlService(fq_name, instance_name, transport);
+ hal_service = GetHalService(fq_name, instance_name, transport);
}
if (hal_service == nullptr) {
@@ -364,10 +362,10 @@
EXPECT_TRUE(fqInstanceName.setTo(name));
auto service =
- GetHidlService(toFQNameString(fqInstanceName.getPackage(),
- fqInstanceName.getVersion(),
- fqInstanceName.getInterface()),
- fqInstanceName.getInstance(), Transport::HWBINDER);
+ GetHalService(toFQNameString(fqInstanceName.getPackage(),
+ fqInstanceName.getVersion(),
+ fqInstanceName.getInterface()),
+ fqInstanceName.getInstance(), Transport::HWBINDER);
ASSERT_NE(service, nullptr);
Partition partition = GetPartition(service);
@@ -405,7 +403,7 @@
const FQName lowest_name =
fq_name.withVersion(fq_name.getPackageMajorVersion(), 0);
sp<IBase> hal_service =
- GetHidlService(lowest_name, instance_name, transport);
+ GetHalService(lowest_name, instance_name, transport);
if (hal_service == nullptr) {
ADD_FAILURE() << "Could not get service " << fq_name.string() << "/"
<< instance_name;
@@ -445,7 +443,7 @@
return;
}
- sp<IBase> hal_service = GetHidlService(fq_name, instance_name, transport);
+ sp<IBase> hal_service = GetHalService(fq_name, instance_name, transport);
if (hal_service == nullptr) {
FailureHalMissing(fq_name, instance_name);
@@ -457,9 +455,10 @@
vector<string> hash_chain{};
hal_service->getHashChain(
[&hash_chain](const hidl_vec<HashCharArray> &chain) {
- for (const HashCharArray &hash : chain) {
- hash_chain.push_back(
- android::base::HexString(hash.data(), hash.size()));
+ for (const HashCharArray &hash_array : chain) {
+ vector<uint8_t> hash{hash_array.data(),
+ hash_array.data() + hash_array.size()};
+ hash_chain.push_back(Hash::hexString(hash));
}
});
@@ -472,8 +471,7 @@
return;
}
string hash = hash_chain[i];
- if (hash == android::base::HexString(Hash::kEmptyHash.data(),
- Hash::kEmptyHash.size())) {
+ if (hash == Hash::hexString(Hash::kEmptyHash)) {
FailureHashMissing(fq_iface_name);
} else if (IsAndroidPlatformInterface(fq_iface_name)) {
set<string> released_hashes = ReleasedHashes(fq_iface_name);
@@ -488,15 +486,14 @@
ForEachHidlHalInstance(GetParam(), is_released);
}
-static std::optional<AidlInterfaceMetadata> metadataForInterface(
- const std::string &name) {
+static std::vector<std::string> hashesForInterface(const std::string &name) {
for (const auto &module : AidlInterfaceMetadata::all()) {
if (std::find(module.types.begin(), module.types.end(), name) !=
module.types.end()) {
- return module;
+ return module.hashes;
}
}
- return std::nullopt;
+ return {};
}
// TODO(b/150155678): using standard code to do this
@@ -576,13 +573,9 @@
return;
}
- ADD_FAILURE()
- << "For " << name << ", manifest (" << shipping_fcm_version
- << ") declares version " << declared_version
- << ", but the actual version is " << actual_version << std::endl
- << "Either the VINTF manifest <hal> entry needs to be updated with a "
- "version tag for the actual version, or the implementation should be "
- "changed to use the declared version";
+ ADD_FAILURE() << "For " << name << ", manifest (" << shipping_fcm_version
+ << ") declares version " << declared_version
+ << ", but the actual version is " << actual_version;
}
// An AIDL HAL with VINTF stability can only be registered if it is in the
@@ -596,9 +589,8 @@
&updatable_via_apex) {
const std::string type = package + "." + interface;
const std::string name = type + "/" + instance;
-
- sp<IBinder> binder = GetAidlService(name);
-
+ sp<IBinder> binder =
+ defaultServiceManager()->waitForService(String16(name.c_str()));
ASSERT_NE(binder, nullptr) << "Failed to get " << name;
// allow upgrade if updatable HAL's declared APEX is actually updated.
@@ -607,30 +599,17 @@
CheckAidlVersionMatchesDeclared(binder, name, version, allow_upgrade);
const std::string hash = getInterfaceHash(binder);
- const std::optional<AidlInterfaceMetadata> metadata =
- metadataForInterface(type);
+ const std::vector<std::string> hashes = hashesForInterface(type);
const bool is_aosp = base::StartsWith(package, "android.");
- ASSERT_TRUE(!is_aosp || metadata)
- << "AOSP interface must have metadata: " << package;
-
const bool is_release =
base::GetProperty("ro.build.version.codename", "") == "REL";
-
- const bool is_existing =
- metadata
- ? std::find(metadata->versions.begin(), metadata->versions.end(),
- version) != metadata->versions.end()
- : false;
-
- const std::vector<std::string> hashes =
- metadata ? metadata->hashes : std::vector<std::string>();
const bool found_hash =
std::find(hashes.begin(), hashes.end(), hash) != hashes.end();
if (is_aosp) {
if (!found_hash) {
- if (is_release || is_existing) {
+ if (is_release) {
ADD_FAILURE() << "Interface " << name
<< " has an unrecognized hash: '" << hash
<< "'. The following hashes are known:\n"
diff --git a/treble/vintf/TEST_MAPPING b/treble/vintf/TEST_MAPPING
index aa61969..53804f9 100644
--- a/treble/vintf/TEST_MAPPING
+++ b/treble/vintf/TEST_MAPPING
@@ -6,13 +6,5 @@
{
"name": "vts_treble_vintf_vendor_test"
}
- ],
- "hwasan-postsubmit": [
- {
- "name": "vts_treble_vintf_framework_test"
- },
- {
- "name": "vts_treble_vintf_vendor_test"
- }
]
}
diff --git a/treble/vintf/VtsTrebleVintfTestBase.cpp b/treble/vintf/VtsTrebleVintfTestBase.cpp
index 68f9687..ddc358f 100644
--- a/treble/vintf/VtsTrebleVintfTestBase.cpp
+++ b/treble/vintf/VtsTrebleVintfTestBase.cpp
@@ -16,22 +16,6 @@
#include "VtsTrebleVintfTestBase.h"
-#include <android-base/logging.h>
-#include <android-base/properties.h>
-#include <android-base/strings.h>
-#include <android/hidl/manager/1.0/IServiceManager.h>
-#include <binder/IServiceManager.h>
-#include <gtest/gtest.h>
-#include <hidl-hash/Hash.h>
-#include <hidl-util/FQName.h>
-#include <hidl-util/FqInstance.h>
-#include <hidl/HidlTransportUtils.h>
-#include <hidl/ServiceManagement.h>
-#include <procpartition/procpartition.h>
-#include <vintf/HalManifest.h>
-#include <vintf/VintfObject.h>
-#include <vintf/parse_string.h>
-
#include <chrono>
#include <condition_variable>
#include <functional>
@@ -45,6 +29,20 @@
#include <thread>
#include <vector>
+#include <android-base/logging.h>
+#include <android-base/strings.h>
+#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <gtest/gtest.h>
+#include <hidl-hash/Hash.h>
+#include <hidl-util/FQName.h>
+#include <hidl-util/FqInstance.h>
+#include <hidl/HidlTransportUtils.h>
+#include <hidl/ServiceManagement.h>
+#include <procpartition/procpartition.h>
+#include <vintf/HalManifest.h>
+#include <vintf/VintfObject.h>
+#include <vintf/parse_string.h>
+
#include "SingleManifestTest.h"
#include "utils.h"
@@ -100,8 +98,7 @@
auto future_result =
std::async([&]() { fn(fq_name, instance_name, transport); });
- int timeout_multiplier = base::GetIntProperty("ro.hw_timeout_multiplier", 1);
- auto timeout = timeout_multiplier * std::chrono::seconds(1);
+ auto timeout = std::chrono::seconds(1);
std::future_status status = future_result.wait_for(timeout);
if (status != std::future_status::ready) {
cout << "Timed out on: " << fq_name.string() << " " << instance_name
@@ -127,8 +124,7 @@
auto future_result = std::async([&]() {
fn(package, version, interface, instance, updatable_via_apex);
});
- int timeout_multiplier = base::GetIntProperty("ro.hw_timeout_multiplier", 1);
- auto timeout = timeout_multiplier * std::chrono::seconds(1);
+ auto timeout = std::chrono::seconds(1);
std::future_status status = future_result.wait_for(timeout);
if (status != std::future_status::ready) {
cout << "Timed out on: " << package << "." << interface << "/" << instance
@@ -138,17 +134,15 @@
});
}
-sp<IBase> VtsTrebleVintfTestBase::GetHidlService(const FQName &fq_name,
- const string &instance_name,
- Transport transport,
- bool log) {
- return GetHidlService(fq_name.string(), instance_name, transport, log);
+sp<IBase> VtsTrebleVintfTestBase::GetHalService(const FQName &fq_name,
+ const string &instance_name,
+ Transport transport, bool log) {
+ return GetHalService(fq_name.string(), instance_name, transport, log);
}
-sp<IBase> VtsTrebleVintfTestBase::GetHidlService(const string &fq_name,
- const string &instance_name,
- Transport transport,
- bool log) {
+sp<IBase> VtsTrebleVintfTestBase::GetHalService(const string &fq_name,
+ const string &instance_name,
+ Transport transport, bool log) {
using android::hardware::details::getRawServiceInternal;
if (log) {
@@ -165,8 +159,7 @@
return getRawServiceInternal(fq_name, instance_name, true /* retry */,
false /* getStub */);
});
- int timeout_multiplier = base::GetIntProperty("ro.hw_timeout_multiplier", 1);
- auto max_time = timeout_multiplier * std::chrono::seconds(1);
+ auto max_time = std::chrono::seconds(1);
std::future<sp<IBase>> future = task.get_future();
std::thread(std::move(task)).detach();
@@ -183,21 +176,6 @@
return base;
}
-sp<IBinder> VtsTrebleVintfTestBase::GetAidlService(const string &name) {
- auto task = std::packaged_task<sp<IBinder>()>([name]() {
- return defaultServiceManager()->waitForService(String16(name.c_str()));
- });
-
- int timeout_multiplier = base::GetIntProperty("ro.hw_timeout_multiplier", 1);
- // TODO(b/205347235)
- auto max_time = timeout_multiplier * std::chrono::seconds(2);
- auto future = task.get_future();
- std::thread(std::move(task)).detach();
- auto status = future.wait_for(max_time);
-
- return status == std::future_status::ready ? future.get() : nullptr;
-}
-
vector<string> VtsTrebleVintfTestBase::GetInstanceNames(
const sp<IServiceManager> &manager, const FQName &fq_name) {
vector<string> ret;
diff --git a/treble/vintf/VtsTrebleVintfTestBase.h b/treble/vintf/VtsTrebleVintfTestBase.h
index 64d3ff9..779e898 100644
--- a/treble/vintf/VtsTrebleVintfTestBase.h
+++ b/treble/vintf/VtsTrebleVintfTestBase.h
@@ -17,14 +17,13 @@
#ifndef VTS_TREBLE_VINTF_TEST_BASE_H_
#define VTS_TREBLE_VINTF_TEST_BASE_H_
-#include <android/hidl/manager/1.0/IServiceManager.h>
-#include <binder/IBinder.h>
-#include <gtest/gtest.h>
-#include <vintf/VintfObject.h>
-
#include <string>
#include <vector>
+#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <gtest/gtest.h>
+#include <vintf/VintfObject.h>
+
#include "utils.h"
namespace android {
@@ -46,13 +45,12 @@
static void ForEachHidlHalInstance(const HalManifestPtr &, HidlVerifyFn);
// Retrieves an existing HAL service.
- static sp<IBase> GetHidlService(const string &fq_name,
- const string &instance_name, Transport,
- bool log = true);
- static sp<IBase> GetHidlService(const FQName &fq_name,
- const string &instance_name, Transport,
- bool log = true);
- static sp<IBinder> GetAidlService(const std::string &name);
+ static sp<IBase> GetHalService(const string &fq_name,
+ const string &instance_name, Transport,
+ bool log = true);
+ static sp<IBase> GetHalService(const FQName &fq_name,
+ const string &instance_name, Transport,
+ bool log = true);
static vector<string> GetInstanceNames(const sp<IServiceManager> &manager,
const FQName &fq_name);
diff --git a/treble/vintf/libvts_vintf_test_common/common.cpp b/treble/vintf/libvts_vintf_test_common/common.cpp
index 0791ac4..1813aaf 100644
--- a/treble/vintf/libvts_vintf_test_common/common.cpp
+++ b/treble/vintf/libvts_vintf_test_common/common.cpp
@@ -46,8 +46,6 @@
{29, Level::Q},
{30, Level::R},
{31, Level::S},
- {32, Level::S}, // subject to change, placeholder value
- {33, Level::T}, // subject to change, placeholder value
}};
android::base::Result<void> TestTargetFcmVersion(Level shipping_fcm_version,
diff --git a/treble/vintf/utils.cpp b/treble/vintf/utils.cpp
index 2ec51ed..9c8e48e 100644
--- a/treble/vintf/utils.cpp
+++ b/treble/vintf/utils.cpp
@@ -50,8 +50,31 @@
"android.hidl.memory",
};
+const uint64_t kCurrentApiLevel = 10000;
+
+uint64_t ReadApiLevelProps(vector<string> api_level_props) {
+ uint64_t api_level = kCurrentApiLevel;
+ for (const auto &api_level_prop : api_level_props) {
+ api_level = GetUintProperty<uint64_t>(api_level_prop, kCurrentApiLevel);
+ if (api_level != kCurrentApiLevel) {
+ break;
+ }
+ }
+ return api_level;
+}
+
uint64_t GetBoardApiLevel() {
- return GetUintProperty<uint64_t>("ro.vendor.api_level", 0);
+ uint64_t device_api_level =
+ ReadApiLevelProps({"ro.product.first_api_level", "ro.build.version.sdk"});
+ uint64_t board_api_level =
+ ReadApiLevelProps({"ro.board.api_level", "ro.board.first_api_level",
+ "ro.vendor.build.version.sdk"});
+ uint64_t api_level =
+ board_api_level < device_api_level ? board_api_level : device_api_level;
+ if (api_level == kCurrentApiLevel) {
+ return 0;
+ }
+ return api_level;
}
// For a given interface returns package root if known. Returns empty string
diff --git a/treble/vintf/utils.h b/treble/vintf/utils.h
index 814c19d..1f434e3 100644
--- a/treble/vintf/utils.h
+++ b/treble/vintf/utils.h
@@ -84,17 +84,16 @@
// HALs that are allowed to be passthrough under Treble rules.
extern const set<string> kPassthroughHals;
-// Read ro.vendor.api_level, that shows the minimum of the following two
-// values:
-// * First non-empty value for the board api level from the following
+// Read the first non-empty value for the board api level from the following
// properties:
-// -- ro.board.api_level
-// -- ro.board.first_api_level
-// -- ro.vendor.build.version.sdk
-// * First non-empty value for the device api level from the following
-// properties:
-// -- ro.product.first_api_level
-// -- ro.build.version.sdk
+// - ro.board.api_level
+// - ro.board.first_api_level
+// - ro.vendor.build.version.sdk
+// Also read the first non-empty value for the device api level from the
+// following properties:
+// - ro.product.first_api_level
+// - ro.build.version.sdk
+// Use the minimum of the two values.
uint64_t GetBoardApiLevel();
// For a given interface returns package root if known. Returns empty string
diff --git a/usb/usb/aidl/host/Android.bp b/usb/usb/aidl/host/Android.bp
deleted file mode 100644
index 02ebf29..0000000
--- a/usb/usb/aidl/host/Android.bp
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-java_test_host {
- name: "VtsAidlUsbHostTest",
- libs: [
- "compatibility-host-util",
- "tradefed",
- ],
-
- static_libs: [
- "platform-test-annotations-host",
- ],
-
- srcs: ["src/**/*.java"],
- test_suites: [
- "general-tests",
- "vts",
- ],
-}
diff --git a/usb/usb/aidl/host/AndroidTest.xml b/usb/usb/aidl/host/AndroidTest.xml
deleted file mode 100644
index c6de571..0000000
--- a/usb/usb/aidl/host/AndroidTest.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2022 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Config for VtsAidlUsbHost test cases">
- <option name="config-descriptor:metadata" key="plan" value="vts-staging-default" />
- <option name="config-descriptor:metadata" key="plan" value="vts-hal-host" />
- <option name="config-descriptor:metadata" key="plan" value="vts-hal" />
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
-
- <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest">
- <option name="jar" value="VtsAidlUsbHostTest.jar" />
- </test>
-</configuration>
diff --git a/usb/usb/aidl/host/src/com/android/usb/vts/VtsAidlUsbHostTest.java b/usb/usb/aidl/host/src/com/android/usb/vts/VtsAidlUsbHostTest.java
deleted file mode 100644
index d62ff6c..0000000
--- a/usb/usb/aidl/host/src/com/android/usb/vts/VtsAidlUsbHostTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.tests.usbport;
-
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.log.LogUtil.CLog;
-import com.android.tradefed.invoker.TestInformation;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
-import com.android.tradefed.testtype.junit4.BeforeClassWithInfo;
-import com.google.common.base.Strings;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public final class VtsAidlUsbHostTest extends BaseHostJUnit4Test {
- public static final String TAG = VtsAidlUsbHostTest.class.getSimpleName();
-
- private static final String HAL_SERVICE = "android.hardware.usb-service";
- private static final long CONN_TIMEOUT = 5000;
-
- private static boolean mHasService;
-
- private ITestDevice mDevice;
- private AtomicBoolean mReconnected = new AtomicBoolean(false);
-
- @Before
- public void setUp() {
- mDevice = getDevice();
- }
-
- @BeforeClassWithInfo
- public static void beforeClassWithDevice(TestInformation testInfo) throws Exception {
- String serviceFound =
- testInfo.getDevice()
- .executeShellCommand(String.format("ps -A | grep \"%s\"", HAL_SERVICE))
- .trim();
- mHasService = !Strings.isNullOrEmpty(serviceFound);
- }
-
- @Test
- public void testResetUsbPort() throws Exception {
- Assume.assumeTrue(
- String.format("The device doesn't have service %s", HAL_SERVICE), mHasService);
- Assert.assertNotNull("Target device does not exist", mDevice);
-
- String portResult, content;
- String deviceSerialNumber = mDevice.getSerialNumber();
- HashSet<String> noSupportCases =
- new HashSet<>(Arrays.asList("No USB ports",
- "There is no available reset USB port"));
-
- CLog.i("testResetUsbPort on device [%s]", deviceSerialNumber);
-
- new Thread(new Runnable() {
- public void run() {
- try {
- mDevice.waitForDeviceNotAvailable(CONN_TIMEOUT);
- Thread.sleep(500);
- mDevice.waitForDeviceAvailable(CONN_TIMEOUT);
- mReconnected.set(true);
- } catch (DeviceNotAvailableException dnae) {
- CLog.e("Device is not available");
- } catch (InterruptedException ie) {
- CLog.w("Thread.sleep interrupted");
- }
- }
- }).start();
-
- Thread.sleep(100);
- String cmd = "svc usb resetUsbPort";
- CLog.i("Invoke shell command [" + cmd + "]");
- long startTime = System.currentTimeMillis();
- portResult = mDevice.executeShellCommand(cmd);
- content = portResult.trim();
-
- if (portResult != null && (noSupportCases.contains(content))) {
- CLog.i("portResult: %s", portResult);
- return;
- }
-
- Thread.sleep(100);
- while (!mReconnected.get() && System.currentTimeMillis() - startTime < CONN_TIMEOUT) {
- Thread.sleep(300);
- }
-
- Assert.assertTrue("usb not reconnect", mReconnected.get());
- }
-}