From 92ecc4827f9da0df75307732ae47131dbb4bcf3b Mon Sep 17 00:00:00 2001 From: Ilya Matyukhin Date: Wed, 6 May 2020 00:44:21 -0700 Subject: [PATCH 01/62] Add a delay between tests to make them more robust Bug: 154342874 Test: atest VtsHalBiometricsFaceV1_0TargetTest Change-Id: I09713b6814ecb9f4ee4a7f568b1f891a94f4e017 --- .../vts/functional/VtsHalBiometricsFaceV1_0TargetTest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/biometrics/face/1.0/vts/functional/VtsHalBiometricsFaceV1_0TargetTest.cpp b/biometrics/face/1.0/vts/functional/VtsHalBiometricsFaceV1_0TargetTest.cpp index 7ac44a4159..78f93af0d3 100644 --- a/biometrics/face/1.0/vts/functional/VtsHalBiometricsFaceV1_0TargetTest.cpp +++ b/biometrics/face/1.0/vts/functional/VtsHalBiometricsFaceV1_0TargetTest.cpp @@ -28,6 +28,7 @@ #include #include #include +#include using android::sp; using android::hardware::hidl_vec; @@ -144,7 +145,10 @@ class FaceHidlTest : public ::testing::TestWithParam { ASSERT_EQ(Status::OK, static_cast(ret2)); } - void TearDown() override {} + void TearDown() override { + // Hack to allow the asynchronous operations to finish on time. + std::this_thread::sleep_for(std::chrono::milliseconds(250)); + } sp mService; sp mCallback; From 2f5aec702490b3f42531a3140b199eb150b00307 Mon Sep 17 00:00:00 2001 From: Midas Chien Date: Thu, 28 May 2020 22:15:41 +0800 Subject: [PATCH 02/62] composer: vts: send refresh frame even composition changes sendRefreshFrame is used to send refresh frame to composer, so even composition changes should present frame to composer. Bug: 157638511 Test: VtsHalGraphicsComposerV2_4TargetTest on C2, R3 Change-Id: I325668b7a75cbbe72841c424eb9fc43479ac48b6 --- .../VtsHalGraphicsComposerV2_4TargetTest.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index 27b633a409..00df7c78f3 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -414,12 +414,9 @@ void GraphicsComposerHidlCommandTest::sendRefreshFrame(const VsyncPeriodChangeTi mWriter->validateDisplay(); execute(); - if (mReader->mCompositionChanges.size() != 0) { - GTEST_SUCCEED() << "Composition change requested, skipping test"; - return; - } - ASSERT_EQ(0, mReader->mErrors.size()); + mReader->mCompositionChanges.clear(); + mWriter->presentDisplay(); execute(); ASSERT_EQ(0, mReader->mErrors.size()); @@ -427,8 +424,14 @@ void GraphicsComposerHidlCommandTest::sendRefreshFrame(const VsyncPeriodChangeTi mWriter->selectLayer(layer); auto handle2 = allocate(); ASSERT_NE(nullptr, handle2); + mWriter->setLayerBuffer(0, handle2, -1); mWriter->setLayerSurfaceDamage(std::vector(1, {0, 0, 10, 10})); + mWriter->validateDisplay(); + execute(); + ASSERT_EQ(0, mReader->mErrors.size()); + mReader->mCompositionChanges.clear(); + mWriter->presentDisplay(); execute(); } From d1803412f6046a6aa52513c56149a460fb24ca36 Mon Sep 17 00:00:00 2001 From: felipeal Date: Thu, 28 May 2020 14:44:20 -0700 Subject: [PATCH 03/62] Implemented CREATE_USER and REMOVE_USER on VHAL reference implementation. Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --set 299896585 a 1 i 666 i 1 && \ adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --user-hal Bug: 150408921 Bug: 150409600 Change-Id: If971c262ecaba604f55582b3ef0a850410d82ff9 --- .../default/impl/vhal_v2_0/DefaultConfig.h | 16 ++++++ .../impl/vhal_v2_0/EmulatedUserHal.cpp | 52 +++++++++++++++++++ .../default/impl/vhal_v2_0/EmulatedUserHal.h | 7 +++ 3 files changed, 75 insertions(+) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index b8a606adab..16c33b9d19 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -1036,6 +1036,22 @@ const ConfigDeclaration kVehicleProperties[]{ .changeMode = VehiclePropertyChangeMode::ON_CHANGE, }, }, + { + .config = + { + .prop = toInt(VehicleProperty::CREATE_USER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + }, + { + .config = + { + .prop = toInt(VehicleProperty::REMOVE_USER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + }, { .config = { diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp index d744a06d40..f712ea20b3 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp @@ -30,6 +30,8 @@ namespace impl { constexpr int INITIAL_USER_INFO = static_cast(VehicleProperty::INITIAL_USER_INFO); constexpr int SWITCH_USER = static_cast(VehicleProperty::SWITCH_USER); +constexpr int CREATE_USER = static_cast(VehicleProperty::CREATE_USER); +constexpr int REMOVE_USER = static_cast(VehicleProperty::REMOVE_USER); constexpr int USER_IDENTIFICATION_ASSOCIATION = static_cast(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION); @@ -37,6 +39,8 @@ bool EmulatedUserHal::isSupported(int32_t prop) { switch (prop) { case INITIAL_USER_INFO: case SWITCH_USER: + case CREATE_USER: + case REMOVE_USER: case USER_IDENTIFICATION_ASSOCIATION: return true; default: @@ -53,6 +57,11 @@ android::base::Result> EmulatedUserHal::onSetP return onSetInitialUserInfoResponse(value); case SWITCH_USER: return onSetSwitchUserResponse(value); + case CREATE_USER: + return onSetCreateUserResponse(value); + case REMOVE_USER: + ALOGI("REMOVE_USER is FYI only, nothing to do..."); + return {}; case USER_IDENTIFICATION_ASSOCIATION: return onSetUserIdentificationAssociation(value); default: @@ -67,6 +76,8 @@ android::base::Result> EmulatedUserHal::onGetP switch (prop) { case INITIAL_USER_INFO: case SWITCH_USER: + case CREATE_USER: + case REMOVE_USER: ALOGE("onGetProperty(): %d is only supported on SET", prop); return android::base::Error(static_cast(StatusCode::INVALID_ARG)) << "only supported on SET"; @@ -162,6 +173,41 @@ android::base::Result> EmulatedUserHal::onSetS return updatedValue; } +android::base::Result> EmulatedUserHal::onSetCreateUserResponse( + const VehiclePropValue& value) { + if (value.value.int32Values.size() == 0) { + ALOGE("set(CREATE_USER): no int32values, ignoring it: %s", toString(value).c_str()); + return android::base::Error(static_cast(StatusCode::INVALID_ARG)) + << "no int32values on " << toString(value); + } + + if (value.areaId != 0) { + ALOGD("set(CREATE_USER) called from lshal; storing it: %s", toString(value).c_str()); + mCreateUserResponseFromCmd.reset(new VehiclePropValue(value)); + return {}; + } + ALOGD("set(CREATE_USER) called from Android: %s", toString(value).c_str()); + + int32_t requestId = value.value.int32Values[0]; + if (mCreateUserResponseFromCmd != nullptr) { + ALOGI("replying CREATE_USER with lshal value: %s", + toString(*mCreateUserResponseFromCmd).c_str()); + return sendUserHalResponse(std::move(mCreateUserResponseFromCmd), requestId); + } + + // Returns default response + auto updatedValue = std::unique_ptr(new VehiclePropValue); + updatedValue->prop = CREATE_USER; + updatedValue->timestamp = elapsedRealtimeNano(); + updatedValue->value.int32Values.resize(2); + updatedValue->value.int32Values[0] = requestId; + updatedValue->value.int32Values[1] = (int32_t)CreateUserStatus::SUCCESS; + + ALOGI("no lshal response; replying with SUCCESS: %s", toString(*updatedValue).c_str()); + + return updatedValue; +} + android::base::Result> EmulatedUserHal::onSetUserIdentificationAssociation(const VehiclePropValue& value) { if (value.value.int32Values.size() == 0) { @@ -247,6 +293,12 @@ void EmulatedUserHal::dump(int fd, std::string indent) { } else { dprintf(fd, "%sNo SwitchUser response\n", indent.c_str()); } + if (mCreateUserResponseFromCmd != nullptr) { + dprintf(fd, "%sCreateUser response: %s\n", indent.c_str(), + toString(*mCreateUserResponseFromCmd).c_str()); + } else { + dprintf(fd, "%sNo CreateUser response\n", indent.c_str()); + } if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { dprintf(fd, "%sSetUserIdentificationAssociation response: %s\n", indent.c_str(), toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h index 3168d75d44..5243b969d8 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h @@ -104,6 +104,12 @@ class EmulatedUserHal { android::base::Result> onSetSwitchUserResponse( const VehiclePropValue& value); + /** + * Used to emulate CREATE_USER - see onSetInitialUserInfoResponse() for usage. + */ + android::base::Result> onSetCreateUserResponse( + const VehiclePropValue& value); + /** * Used to emulate USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for * usage. @@ -116,6 +122,7 @@ class EmulatedUserHal { std::unique_ptr mInitialUserResponseFromCmd; std::unique_ptr mSwitchUserResponseFromCmd; + std::unique_ptr mCreateUserResponseFromCmd; std::unique_ptr mSetUserIdentificationAssociationResponseFromCmd; }; From c1e965642296c3614452563420c32932f2684b3f Mon Sep 17 00:00:00 2001 From: "jicheol.shin" Date: Wed, 29 Jan 2020 12:14:38 +0900 Subject: [PATCH 04/62] Fix issues for Japan model. 1. Docomo, Softbank, KDDI, and another Japan Operator request this. - During operation, the mobile device confirms the presence of the ICC and performs ICC outlier detection. If ICC disconnection is detected during operation, turn off the power within 5 seconds after detection, and perform power reset operation. 2. "setSimCardPower power down" - After "setSimCardPower power down", SIM set power down. and ME is wating for "remove sim card" event, but phsically detect pin is still connected, so "remove" event never be sent, and ME can't reboot. 3. Japan model can not "setSimCardPower power up" After "setSimCardPower power down", Japan model prepare for rebooting. so so VTS requests "setSimCardPower power up", they can't do this. Signed-off-by: Jicheol Shin Test: VTS Test: runc vts -m VtsHalRadioV1_1Target -t VtsHalRadioV1_1Target#RadioHidlTest_v1_1.setSimCardPower_1_1(slot1)_32bit Test: runc vts -m VtsHalRadioV1_1Target -t VtsHalRadioV1_1Target#RadioHidlTest_v1_1.setSimCardPower_1_1(slot1)_64bit Bug ID : 147969063 Change-Id: I524a16d04a7783f605913fd3ead15d3c1fbbc78b (cherry picked from commit c89fd888a9a27547b0134caed30e23bc6aea000d) --- radio/1.1/vts/functional/radio_hidl_hal_api.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp index 33347c5d7a..42f691659b 100644 --- a/radio/1.1/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.1/vts/functional/radio_hidl_hal_api.cpp @@ -24,6 +24,9 @@ TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) { /* Record the sim card state for the testing environment */ CardState cardStateForTest = cardStatus.cardState; +#if 0 + /* This test has to be removed for Japan Model. + * After "setSimCardPower power down", Japan model can not "setSimCardPower power up" */ /* Test setSimCardPower power down */ serial = GetRandomSerialNumber(); radio_v1_1->setSimCardPower_1_1(serial, CardPowerState::POWER_DOWN); @@ -56,6 +59,7 @@ TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_1->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::INVALID_ARGUMENTS, RadioError::RADIO_NOT_AVAILABLE})); +#endif /** * If the sim card status for the testing environment is PRESENT, From b2dd35aaf2473554e2e4ee0788293234121ba895 Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Fri, 29 May 2020 15:08:43 -0700 Subject: [PATCH 05/62] Disable framework for some VTS tests The test doesn't need framework. It seems that the test can be flaky when framework was stop/started earlier. Bug: 154445273 Test: atest -a VtsHalBluetoothV1_0TargetTest \ VtsHalSapV1_0TargetTest \ VtsHalAudioV4_0TargetTest Change-Id: I60f62923cfb826c5e33e9885ea08efdbe4c8f57e --- bluetooth/1.0/vts/functional/Android.bp | 1 + radio/1.0/vts/functional/vts_hal_sap_target_test.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bluetooth/1.0/vts/functional/Android.bp b/bluetooth/1.0/vts/functional/Android.bp index 463ed849f6..e9f867f5f0 100644 --- a/bluetooth/1.0/vts/functional/Android.bp +++ b/bluetooth/1.0/vts/functional/Android.bp @@ -26,4 +26,5 @@ cc_test { "general-tests", "vts", ], + disable_framework: true, } diff --git a/radio/1.0/vts/functional/vts_hal_sap_target_test.xml b/radio/1.0/vts/functional/vts_hal_sap_target_test.xml index 876e1fba12..d7d44773c4 100644 --- a/radio/1.0/vts/functional/vts_hal_sap_target_test.xml +++ b/radio/1.0/vts/functional/vts_hal_sap_target_test.xml @@ -22,6 +22,8 @@ + + - - diff --git a/neuralnetworks/1.1/vts/functional/AndroidTest.xml b/neuralnetworks/1.1/vts/functional/AndroidTest.xml index a6f812fe1e..cfde60cca4 100644 --- a/neuralnetworks/1.1/vts/functional/AndroidTest.xml +++ b/neuralnetworks/1.1/vts/functional/AndroidTest.xml @@ -26,10 +26,6 @@ - - diff --git a/neuralnetworks/1.2/vts/functional/AndroidTest.xml b/neuralnetworks/1.2/vts/functional/AndroidTest.xml index adbdf40da3..3f91618920 100644 --- a/neuralnetworks/1.2/vts/functional/AndroidTest.xml +++ b/neuralnetworks/1.2/vts/functional/AndroidTest.xml @@ -26,10 +26,6 @@ - - diff --git a/neuralnetworks/1.3/vts/functional/AndroidTest.xml b/neuralnetworks/1.3/vts/functional/AndroidTest.xml index 30cff2e9fa..e5acd90a9c 100644 --- a/neuralnetworks/1.3/vts/functional/AndroidTest.xml +++ b/neuralnetworks/1.3/vts/functional/AndroidTest.xml @@ -26,10 +26,6 @@ - - From ffb1ffdd0e821636018d982346261e1e152c5037 Mon Sep 17 00:00:00 2001 From: Mayank Garg Date: Mon, 15 Jun 2020 12:20:00 -0700 Subject: [PATCH 33/62] Added DISABLED flag to users flag for HAL Bug: 158681378 Test: m (successful build) Change-Id: I46af767c2cb4716bfbe45f51f59f9c670d6c0a0b --- automotive/vehicle/2.0/types.hal | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index acdea8ac5c..b4aa11d599 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -4280,6 +4280,16 @@ enum UserFlags: int32_t { * Admin users have additional privileges such as permission to create other users. */ ADMIN = 0x08, + + /** + * Disabled users are marked for deletion. + */ + DISABLED = 0x10, + + /** + * Profile user is a profile of another user. + */ + PROFILE = 0x20, }; /** @@ -4294,10 +4304,16 @@ struct UsersInfo { /** The current foreground user. */ UserInfo currentUser; - /** Number of existing users (includes the current user). */ + /** + * Number of existing users; includes the current user, recently removed users (with DISABLED + * flag), and profile users (with PROFILE flag). + */ int32_t numberUsers; - /** List of existing users (includes the current user). */ + /** + * List of existing users; includes the current user, recently removed users (with DISABLED + * flag), and profile users (with PROFILE flag). + */ vec existingUsers; }; From 62ffe870a24fdfa5fc8e067d6cbcc4b13e1c775f Mon Sep 17 00:00:00 2001 From: "yan.cao" Date: Tue, 9 Jun 2020 14:55:22 +0800 Subject: [PATCH 34/62] Fix the failed case for the VtsHalRadioV1_5TargetTest.PerInstance/RadioHidlTest_v1_5#sendCdmaSmsExpectMore/0_slot1 Sendcdmasexpectmoreresponse to the request sendcdmasexpectmore did not accept the return parameter responseinfo, which caused the VTS system to wait for a response until it exceeded 60 seconds, and the VTS determined No test results. so we can add parameters to receive the parameters of sendcdmasexpectmoreresponse,and then make subsequent judgment. Bug: 158542706 Test: run vts -m VtsHalRadioV1_5TargetTest Change-Id: I1d6214f58850d707520b80634cb93d0e0cc712bb Merged-In: I1d6214f58850d707520b80634cb93d0e0cc712bb --- radio/1.5/vts/functional/radio_response.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/1.5/vts/functional/radio_response.cpp b/radio/1.5/vts/functional/radio_response.cpp index 8cbb2d0cce..9b6d450e83 100644 --- a/radio/1.5/vts/functional/radio_response.cpp +++ b/radio/1.5/vts/functional/radio_response.cpp @@ -1017,8 +1017,10 @@ Return RadioResponse_v1_5::setNetworkSelectionModeManualResponse_1_5( return Void(); } -Return RadioResponse_v1_5::sendCdmaSmsExpectMoreResponse(const RadioResponseInfo& /*info*/, +Return RadioResponse_v1_5::sendCdmaSmsExpectMoreResponse(const RadioResponseInfo& info, const SendSmsResult& /*sms*/) { + rspInfo = info; + parent_v1_5.notify(info.serial); return Void(); } From 8c8efd68e8cafa6cf13221dcbf993bbca9dd924e Mon Sep 17 00:00:00 2001 From: Slava Shklyaev Date: Tue, 16 Jun 2020 16:43:01 +0100 Subject: [PATCH 35/62] Log NNAPI VTS test case to logcat Sample output: I VtsHalNeuralnetworksV1_2TargetTest: [Test Case] TestGenerated/GeneratedTest.Test/nnapi_sample_all_add BEGIN ... I VtsHalNeuralnetworksV1_2TargetTest: [Test Case] TestGenerated/GeneratedTest.Test/nnapi_sample_all_add END Bug: 159060565 Test: VtsHalNeuralnetworksV1_0TargetTest (inspected logcat output) Test: VtsHalNeuralnetworksV1_1TargetTest (inspected logcat output) Test: VtsHalNeuralnetworksV1_2TargetTest (inspected logcat output) Test: VtsHalNeuralnetworksV1_3TargetTest (inspected logcat output) Change-Id: Ic1a0c90e0853ca84dd925d0f7df65e159bb284aa --- neuralnetworks/1.0/vts/functional/Android.bp | 3 +- .../1.0/vts/functional/TestMain.cpp | 25 ++++++++++++ .../include/1.0/LogTestCaseToLogcat.h | 40 +++++++++++++++++++ neuralnetworks/1.1/vts/functional/Android.bp | 1 + .../1.1/vts/functional/TestMain.cpp | 25 ++++++++++++ neuralnetworks/1.2/vts/functional/Android.bp | 1 + .../1.2/vts/functional/TestMain.cpp | 25 ++++++++++++ .../1.2/vts/functional/VtsHalNeuralnetworks.h | 1 + neuralnetworks/1.3/vts/functional/Android.bp | 1 + .../1.3/vts/functional/TestMain.cpp | 25 ++++++++++++ .../1.3/vts/functional/VtsHalNeuralnetworks.h | 1 + 11 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 neuralnetworks/1.0/vts/functional/TestMain.cpp create mode 100644 neuralnetworks/1.0/vts/functional/include/1.0/LogTestCaseToLogcat.h create mode 100644 neuralnetworks/1.1/vts/functional/TestMain.cpp create mode 100644 neuralnetworks/1.2/vts/functional/TestMain.cpp create mode 100644 neuralnetworks/1.3/vts/functional/TestMain.cpp diff --git a/neuralnetworks/1.0/vts/functional/Android.bp b/neuralnetworks/1.0/vts/functional/Android.bp index 87e851930d..d802911234 100644 --- a/neuralnetworks/1.0/vts/functional/Android.bp +++ b/neuralnetworks/1.0/vts/functional/Android.bp @@ -62,11 +62,12 @@ cc_test { defaults: ["neuralnetworks_vts_functional_defaults"], srcs: [ "BasicTests.cpp", + "GeneratedTestHarness.cpp", "TestAssertions.cpp", + "TestMain.cpp", "ValidateModel.cpp", "ValidateRequest.cpp", "VtsHalNeuralnetworks.cpp", - "GeneratedTestHarness.cpp", ], shared_libs: [ "libfmq", diff --git a/neuralnetworks/1.0/vts/functional/TestMain.cpp b/neuralnetworks/1.0/vts/functional/TestMain.cpp new file mode 100644 index 0000000000..6bf4e5fab1 --- /dev/null +++ b/neuralnetworks/1.0/vts/functional/TestMain.cpp @@ -0,0 +1,25 @@ +/* + * 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 +#include "1.0/LogTestCaseToLogcat.h" + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + testing::UnitTest::GetInstance()->listeners().Append( + new android::hardware::neuralnetworks::LogTestCaseToLogcat()); + return RUN_ALL_TESTS(); +} diff --git a/neuralnetworks/1.0/vts/functional/include/1.0/LogTestCaseToLogcat.h b/neuralnetworks/1.0/vts/functional/include/1.0/LogTestCaseToLogcat.h new file mode 100644 index 0000000000..f1413ef1aa --- /dev/null +++ b/neuralnetworks/1.0/vts/functional/include/1.0/LogTestCaseToLogcat.h @@ -0,0 +1,40 @@ +/* + * 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. + */ + +#ifndef ANDROID_HARDWARE_NEURALNETWORKS_V1_0_LOG_TEST_CASE_TO_LOGCAT_H +#define ANDROID_HARDWARE_NEURALNETWORKS_V1_0_LOG_TEST_CASE_TO_LOGCAT_H + +#include +#include + +namespace android::hardware::neuralnetworks { + +class LogTestCaseToLogcat : public ::testing::EmptyTestEventListener { + public: + void OnTestStart(const ::testing::TestInfo& test_info) override { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " BEGIN"; + } + + void OnTestEnd(const ::testing::TestInfo& test_info) override { + LOG(INFO) << "[Test Case] " << test_info.test_suite_name() << "." << test_info.name() + << " END"; + } +}; + +} // namespace android::hardware::neuralnetworks + +#endif // ANDROID_HARDWARE_NEURALNETWORKS_V1_0_LOG_TEST_CASE_TO_LOGCAT_H diff --git a/neuralnetworks/1.1/vts/functional/Android.bp b/neuralnetworks/1.1/vts/functional/Android.bp index 9afa0af35b..405548fe55 100644 --- a/neuralnetworks/1.1/vts/functional/Android.bp +++ b/neuralnetworks/1.1/vts/functional/Android.bp @@ -20,6 +20,7 @@ cc_test { srcs: [ "BasicTests.cpp", "TestAssertions.cpp", + "TestMain.cpp", "ValidateModel.cpp", "ValidateRequest.cpp", "VtsHalNeuralnetworks.cpp", diff --git a/neuralnetworks/1.1/vts/functional/TestMain.cpp b/neuralnetworks/1.1/vts/functional/TestMain.cpp new file mode 100644 index 0000000000..6bf4e5fab1 --- /dev/null +++ b/neuralnetworks/1.1/vts/functional/TestMain.cpp @@ -0,0 +1,25 @@ +/* + * 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 +#include "1.0/LogTestCaseToLogcat.h" + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + testing::UnitTest::GetInstance()->listeners().Append( + new android::hardware::neuralnetworks::LogTestCaseToLogcat()); + return RUN_ALL_TESTS(); +} diff --git a/neuralnetworks/1.2/vts/functional/Android.bp b/neuralnetworks/1.2/vts/functional/Android.bp index 182f716115..93edca6126 100644 --- a/neuralnetworks/1.2/vts/functional/Android.bp +++ b/neuralnetworks/1.2/vts/functional/Android.bp @@ -40,6 +40,7 @@ cc_test { "CompilationCachingTests.cpp", "GeneratedTestHarness.cpp", "TestAssertions.cpp", + "TestMain.cpp", "ValidateBurst.cpp", "ValidateModel.cpp", "ValidateRequest.cpp", diff --git a/neuralnetworks/1.2/vts/functional/TestMain.cpp b/neuralnetworks/1.2/vts/functional/TestMain.cpp new file mode 100644 index 0000000000..6bf4e5fab1 --- /dev/null +++ b/neuralnetworks/1.2/vts/functional/TestMain.cpp @@ -0,0 +1,25 @@ +/* + * 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 +#include "1.0/LogTestCaseToLogcat.h" + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + testing::UnitTest::GetInstance()->listeners().Append( + new android::hardware::neuralnetworks::LogTestCaseToLogcat()); + return RUN_ALL_TESTS(); +} diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h index d01336eccd..c4e2b15d1c 100644 --- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h @@ -21,6 +21,7 @@ #include #include #include +#include #include "1.0/Utils.h" #include "1.2/Callbacks.h" diff --git a/neuralnetworks/1.3/vts/functional/Android.bp b/neuralnetworks/1.3/vts/functional/Android.bp index 771fc54e0d..b17d44559b 100644 --- a/neuralnetworks/1.3/vts/functional/Android.bp +++ b/neuralnetworks/1.3/vts/functional/Android.bp @@ -43,6 +43,7 @@ cc_test { "MemoryDomainTests.cpp", "QualityOfServiceTests.cpp", "TestAssertions.cpp", + "TestMain.cpp", "ValidateBurst.cpp", "ValidateModel.cpp", "ValidateRequest.cpp", diff --git a/neuralnetworks/1.3/vts/functional/TestMain.cpp b/neuralnetworks/1.3/vts/functional/TestMain.cpp new file mode 100644 index 0000000000..6bf4e5fab1 --- /dev/null +++ b/neuralnetworks/1.3/vts/functional/TestMain.cpp @@ -0,0 +1,25 @@ +/* + * 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 +#include "1.0/LogTestCaseToLogcat.h" + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + testing::UnitTest::GetInstance()->listeners().Append( + new android::hardware::neuralnetworks::LogTestCaseToLogcat()); + return RUN_ALL_TESTS(); +} diff --git a/neuralnetworks/1.3/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.3/vts/functional/VtsHalNeuralnetworks.h index de082c39cc..a2e5071d97 100644 --- a/neuralnetworks/1.3/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/1.3/vts/functional/VtsHalNeuralnetworks.h @@ -21,6 +21,7 @@ #include #include #include +#include #include "1.0/Utils.h" #include "1.3/Callbacks.h" From c324db992ef376c2edebfebb6f775b97c8fafc95 Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 3 Jun 2020 18:29:31 -0700 Subject: [PATCH 36/62] Add server library build rules for both host and target Bug: 157603385 Test: build and create Acloud local instance Change-Id: I80951eb4192360c62a5f72902d20e2dee84d97ad --- automotive/vehicle/2.0/default/Android.bp | 66 ++++++++++++++++--- .../default/impl/vhal_v2_0/proto/Android.bp | 1 + 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index a4fd6415ed..d9ac239f62 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -15,12 +15,10 @@ cc_defaults { name: "vhal_v2_0_defaults", shared_libs: [ - "libbinder_ndk", "libhidlbase", "liblog", "libutils", "android.hardware.automotive.vehicle@2.0", - "carwatchdog_aidl_interface-ndk_platform", ], cflags: [ "-Wall", @@ -29,6 +27,15 @@ cc_defaults { ], } +cc_defaults { + name: "vhal_v2_0_target_defaults", + defaults: ["vhal_v2_0_defaults"], + shared_libs: [ + "libbinder_ndk", + "carwatchdog_aidl_interface-ndk_platform", + ], +} + cc_library_headers { name: "vhal_v2_0_common_headers", vendor: true, @@ -39,7 +46,7 @@ cc_library_headers { cc_library { name: "android.hardware.automotive.vehicle@2.0-manager-lib", vendor: true, - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], srcs: [ "common/src/Obd2SensorStore.cpp", "common/src/SubscriptionManager.cpp", @@ -61,7 +68,7 @@ cc_library { cc_library_static { name: "android.hardware.automotive.vehicle@2.0-default-impl-lib", vendor: true, - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], srcs: [ "impl/vhal_v2_0/CommConn.cpp", "impl/vhal_v2_0/EmulatedVehicleConnector.cpp", @@ -97,16 +104,59 @@ cc_library_static { cc_library_static { name: "android.hardware.automotive.vehicle@2.0-emulated-user-hal-lib", vendor: true, - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], srcs: [ "impl/vhal_v2_0/EmulatedUserHal.cpp", ], } +// Vehicle HAL Server reference impl lib +cc_library_static { + name: "android.hardware.automotive.vehicle@2.0-server-common-lib", + vendor: true, + host_supported: true, + defaults: ["vhal_v2_0_defaults"], + local_include_dirs: ["common/include/vhal_v2_0"], + export_include_dirs: ["common/include"], + srcs: [ + "common/src/Obd2SensorStore.cpp", + "common/src/VehicleObjectPool.cpp", + "common/src/VehicleUtils.cpp", + ], +} + +// Vehicle HAL Server default implementation +cc_library_static { + name: "android.hardware.automotive.vehicle@2.0-server-impl-lib", + vendor: true, + host_supported: true, + defaults: ["vhal_v2_0_defaults"], + local_include_dirs: ["common/include/vhal_v2_0"], + export_include_dirs: ["impl"], + srcs: [ + "impl/vhal_v2_0/EmulatedUserHal.cpp", + "impl/vhal_v2_0/GeneratorHub.cpp", + "impl/vhal_v2_0/JsonFakeValueGenerator.cpp", + "impl/vhal_v2_0/LinearFakeValueGenerator.cpp", + "impl/vhal_v2_0/ProtoMessageConverter.cpp", + "impl/vhal_v2_0/VehicleHalServer.cpp", + ], + whole_static_libs: [ + "android.hardware.automotive.vehicle@2.0-server-common-lib", + ], + static_libs: [ + "android.hardware.automotive.vehicle@2.0-libproto-native", + ], + shared_libs: [ + "libbase", + "libjsoncpp", + ], +} + cc_test { name: "android.hardware.automotive.vehicle@2.0-manager-unit-tests", vendor: true, - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], whole_static_libs: ["android.hardware.automotive.vehicle@2.0-manager-lib"], srcs: [ "tests/RecurrentTimer_test.cpp", @@ -126,7 +176,7 @@ cc_test { cc_test { name: "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests", vendor: true, - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], srcs: [ "impl/vhal_v2_0/tests/ProtoMessageConverter_test.cpp", ], @@ -140,7 +190,7 @@ cc_test { cc_binary { name: "android.hardware.automotive.vehicle@2.0-service", - defaults: ["vhal_v2_0_defaults"], + defaults: ["vhal_v2_0_target_defaults"], vintf_fragments: [ "android.hardware.automotive.vehicle@2.0-service.xml", ], diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp index 31ba8ab18a..c5b9ed6b0a 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/proto/Android.bp @@ -16,6 +16,7 @@ cc_library_static { name: "android.hardware.automotive.vehicle@2.0-libproto-native", vendor: true, + host_supported: true, proto: { export_proto_headers: true, type: "lite", From ce9d001076e73eb65840028f993d54b52e46973d Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Wed, 17 Jun 2020 23:29:07 -0700 Subject: [PATCH 37/62] Camera: Allow HAL not call notify() with ERROR_BUFFER The new framework implementation derives capture buffer loss notification from other information, and treats HAL notify() with ERROR_BUFFER as no-op. Test: Build Bug: 155353799 Change-Id: Ia7ea52ee2750c7404b657467e1cfda4c05e6cc78 --- camera/device/3.2/ICameraDeviceCallback.hal | 7 +++++-- current.txt | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/camera/device/3.2/ICameraDeviceCallback.hal b/camera/device/3.2/ICameraDeviceCallback.hal index 607502e5bf..206a649da3 100644 --- a/camera/device/3.2/ICameraDeviceCallback.hal +++ b/camera/device/3.2/ICameraDeviceCallback.hal @@ -87,8 +87,11 @@ interface ICameraDeviceCallback { * ERROR_RESULT message. * * If an output buffer cannot be filled, its status field must be set to - * STATUS_ERROR. In addition, notify() must be called with a ERROR_BUFFER - * message. + * STATUS_ERROR. In this case, notify() isn't required to be called with + * an ERROR_BUFFER message. The framework will simply treat the notify() + * call with ERROR_BUFFER as a no-op, and derive whether and when to notify + * the application of buffer loss based on the buffer status and whether or not + * the entire capture has failed. * * If the entire capture has failed, then this method still needs to be * called to return the output buffers to the framework. All the buffer diff --git a/current.txt b/current.txt index 2608b54dee..b03d330f5e 100644 --- a/current.txt +++ b/current.txt @@ -588,7 +588,7 @@ c3ec182ce325862b7d79e526f3e170c02cfee1497ed309d7c60d0de4ca636b0b android.hardwar 578f640c653726d58f99c84a7e1bb63862e21ef7cbb4f7d95c3cc62de00dca35 android.hardware.automotive.evs@1.0::IEvsDisplay f5bc6aa840db933cb9fd36668b06d3e2021cf5384bb70e459f22e2f2f921fba5 android.hardware.automotive.evs@1.0::IEvsEnumerator d3a344b7bd4c0d2658ae7209f55a979b8f53f361fd00f4fca29d5baa56d11fd2 android.hardware.automotive.evs@1.0::types -d123013165a19b6353cdc46a57b2ff4a17179619d36dbd595dfcf15dcd099af6 android.hardware.camera.device@3.2::ICameraDeviceCallback # b/155353799 +2924c3e43858190ee3e2da4c2fb93bba8ae065fe314451f035a7ec52cb80c94a android.hardware.camera.device@3.2::ICameraDeviceCallback # b/155353799 2410dd02d67786a732d36e80b0f8ccf55086604ef37f9838e2013ff2c571e404 android.hardware.camera.device@3.5::types cd06a7911b9acd4a653bbf7133888878fbcb3f84be177c7a3f1becaae3d8618f android.hardware.camera.metadata@3.2::types 5cf81b1001296fbb3c5b3d275a859244f61cec5fa858d7be9cca46c5b7dfa733 android.hardware.camera.metadata@3.2::types # b/150331548 From d7066d0ccaa0c7fd02b78db3c62c77013f3911b5 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Thu, 18 Jun 2020 09:44:51 -0400 Subject: [PATCH 38/62] Identity: More static linking of VTS test binary. The VTS test was dynamically linking some libraries not normally present on an Android system. Statically link these libraries instead. Bug: 158150767 Test: atest VtsHalIdentityTargetTest Change-Id: I0000ae199b4a4917e70056aadf4ae907e7fa97f7 --- identity/aidl/vts/Android.bp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp index cd6f9b0143..c1f44e742e 100644 --- a/identity/aidl/vts/Android.bp +++ b/identity/aidl/vts/Android.bp @@ -14,19 +14,19 @@ cc_test { "ReaderAuthTests.cpp", ], shared_libs: [ - "android.hardware.keymaster@4.0", "libbinder", "libcrypto", - "android.hardware.keymaster-ndk_platform", ], static_libs: [ "libcppbor", "libkeymaster_portable", "libsoft_attestation_cert", "libpuresoftkeymasterdevice", + "android.hardware.keymaster@4.0", "android.hardware.identity-support-lib", "android.hardware.identity-cpp", "android.hardware.keymaster-cpp", + "android.hardware.keymaster-ndk_platform", ], test_suites: [ "general-tests", From e98bce8cec55de7c380c3138a71810adb733ffdb Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Thu, 11 Jun 2020 09:12:32 -0700 Subject: [PATCH 39/62] Adds a EvsEvent type for general streaming error Bug: 142891447 Test: m -j android.hardware.automotive.evs@1.1 Change-Id: I102c48e689cd567701bc33e379f545e8aff880e9 --- automotive/evs/1.1/types.hal | 4 ++++ current.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/automotive/evs/1.1/types.hal b/automotive/evs/1.1/types.hal index 1f69f09b5b..e699fd0d1b 100644 --- a/automotive/evs/1.1/types.hal +++ b/automotive/evs/1.1/types.hal @@ -105,6 +105,10 @@ enum EvsEventType : uint32_t { * Master role has become available */ MASTER_RELEASED, + /** + * Any other erroneous streaming events + */ + STREAM_ERROR, }; /** diff --git a/current.txt b/current.txt index 2608b54dee..29066b0cf7 100644 --- a/current.txt +++ b/current.txt @@ -658,7 +658,7 @@ ca515ff4b63c80cf5ad7b3395c997c57d6c56157361f6c367d1c96f23cc4860a android.hardwar 87958d728d7c0ee9b9391ab4a072b097914921a7b38f7dc3df427f933a5b528e android.hardware.automotive.evs@1.1::IEvsEnumerator f53b4e8de6209c6d0fa9036005671b34a2f98328b51423d3a5137a43bf42c84d android.hardware.automotive.evs@1.1::IEvsUltrasonicsArray 0460bacbde906a846a3d71b2b7b33d6927cac3ff072e523ffac7853577464406 android.hardware.automotive.evs@1.1::IEvsUltrasonicsArrayStream -3e374b5c4777f959f62a320abb3b9edca8874e24e383dbb19c66d224f151b363 android.hardware.automotive.evs@1.1::types +f27cf8283e7b953d33dd258734749d2fca9cc63502ea41353060ffa78d8ce9f6 android.hardware.automotive.evs@1.1::types 4e4904c4067dadae974ddf90351f362331dcd04bba1d890d313cc8ba91f68c15 android.hardware.automotive.sv@1.0::ISurroundView2dSession 63336e9d03f545020ff2982ff76d9d8c44fa76ad476293b5ef6732cbbd71e61b android.hardware.automotive.sv@1.0::ISurroundView3dSession b7015428cd52ce8192d13bfcbf2c4455cda3727d57f2aac80d65a1747104f5ac android.hardware.automotive.sv@1.0::ISurroundViewService From 523e37e6383d21b874cba99c60355a1436bd93a8 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Thu, 18 Jun 2020 21:04:41 -0700 Subject: [PATCH 40/62] Reserves memory for external buffers This change adds a line to reserve memory to hold externally allocated EVS frame buffers for CameraStreamExternalBuffering test. Fix: 159399273 Test: vts-tradefed run commandAndExit -m VtsHalEvsV1_1TargetTest Change-Id: I9e6b29580ac8357efd32b8fec434456e40cbaa58 --- automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp index 6a386c3080..8b68fd6f0a 100644 --- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp @@ -2262,6 +2262,7 @@ TEST_P(EvsHidlTest, CameraStreamExternalBuffering) { // Allocate buffers to use hidl_vec buffers; + buffers.resize(kBuffersToHold); for (auto i = 0; i < kBuffersToHold; ++i) { unsigned pixelsPerLine; buffer_handle_t memHandle = nullptr; From d6346872c6e6fadc2917ffb84e2413591899cb34 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Fri, 19 Jun 2020 15:25:01 -0700 Subject: [PATCH 41/62] Camera: Fix insensitive language in comments and names Test: Builds Bug: 159480149 Change-Id: Ic048071867b69e5c2d337f59f697980a6a64587f --- camera/device/3.2/default/convert.cpp | 2 +- .../2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/camera/device/3.2/default/convert.cpp b/camera/device/3.2/default/convert.cpp index d878deb03d..06ad7e963c 100644 --- a/camera/device/3.2/default/convert.cpp +++ b/camera/device/3.2/default/convert.cpp @@ -38,7 +38,7 @@ bool convertFromHidl(const CameraMetadata &src, const camera_metadata_t** dst) { } const uint8_t* data = src.data(); - // sanity check the size of CameraMetadata match underlying camera_metadata_t + // check that the size of CameraMetadata match underlying camera_metadata_t if (get_camera_metadata_size((camera_metadata_t*)data) != src.size()) { ALOGE("%s: input CameraMetadata is corrupt!", __FUNCTION__); return false; diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index f6860cfe7f..3b8f833cea 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -1894,7 +1894,7 @@ TEST_P(CameraHidlTest, getCameraDeviceInterface) { } // Verify that the device resource cost can be retrieved and the values are -// sane. +// correct. TEST_P(CameraHidlTest, getResourceCost) { hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); @@ -2544,7 +2544,7 @@ TEST_P(CameraHidlTest, sendCommandSmoothZoom) { } } -// Basic sanity tests related to camera parameters. +// Basic correctness tests related to camera parameters. TEST_P(CameraHidlTest, getSetParameters) { hidl_vec cameraDeviceNames = getCameraDeviceNames(mProvider); From e886f8094239703a6f712dd7b12d2cd2486e58db Mon Sep 17 00:00:00 2001 From: layog Date: Thu, 4 Jun 2020 20:03:24 +0800 Subject: [PATCH 42/62] Add test for subsample metadata for YUV420 format Bug: 153704651 Test: atest VtsHalGraphicsMapperV4_0TargetTest Change-Id: Ie7a521b19b2eb1c459327fe699253aaa50ae8257 --- .../VtsHalGraphicsMapperV4_0TargetTest.cpp | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 529fb1817a..16be5db356 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -658,6 +658,56 @@ TEST_P(GraphicsMapperHidlTest, Lock_YCRCB_420_SP) { ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); } +TEST_P(GraphicsMapperHidlTest, YV12SubsampleMetadata) { + auto info = mDummyDescriptorInfo; + info.format = PixelFormat::YV12; + + const native_handle_t* bufferHandle; + uint32_t stride; + ASSERT_NO_FATAL_FAILURE( + bufferHandle = mGralloc->allocate(info, true, Tolerance::kToleranceStrict, &stride)); + + const IMapper::Rect region{0, 0, static_cast(info.width), + static_cast(info.height)}; + unique_fd fence; + ASSERT_NO_FATAL_FAILURE(mGralloc->lock(bufferHandle, info.usage, region, fence.release())); + + hidl_vec vec; + ASSERT_EQ(Error::NONE, mGralloc->get(bufferHandle, gralloc4::MetadataType_PlaneLayouts, &vec)); + std::vector planeLayouts; + ASSERT_EQ(NO_ERROR, gralloc4::decodePlaneLayouts(vec, &planeLayouts)); + + ASSERT_EQ(3, planeLayouts.size()); + + auto yPlane = planeLayouts[0]; + auto crPlane = planeLayouts[1]; + auto cbPlane = planeLayouts[2]; + + constexpr uint32_t kCbCrSubSampleFactor = 2; + EXPECT_EQ(kCbCrSubSampleFactor, crPlane.horizontalSubsampling); + EXPECT_EQ(kCbCrSubSampleFactor, crPlane.verticalSubsampling); + + EXPECT_EQ(kCbCrSubSampleFactor, cbPlane.horizontalSubsampling); + EXPECT_EQ(kCbCrSubSampleFactor, cbPlane.verticalSubsampling); + + const long chromaSampleWidth = info.width / kCbCrSubSampleFactor; + const long chromaSampleHeight = info.height / kCbCrSubSampleFactor; + + EXPECT_EQ(info.width, yPlane.widthInSamples); + EXPECT_EQ(info.height, yPlane.heightInSamples); + + EXPECT_EQ(chromaSampleWidth, crPlane.widthInSamples); + EXPECT_EQ(chromaSampleHeight, crPlane.heightInSamples); + + EXPECT_EQ(chromaSampleWidth, cbPlane.widthInSamples); + EXPECT_EQ(chromaSampleHeight, cbPlane.heightInSamples); + + EXPECT_LE(crPlane.widthInSamples, crPlane.strideInBytes); + EXPECT_LE(cbPlane.widthInSamples, cbPlane.strideInBytes); + + ASSERT_NO_FATAL_FAILURE(fence.reset(mGralloc->unlock(bufferHandle))); +} + TEST_P(GraphicsMapperHidlTest, Lock_YV12) { auto info = mDummyDescriptorInfo; info.format = PixelFormat::YV12; From 922654fc4dda8e62d09e92418852fc6165703baa Mon Sep 17 00:00:00 2001 From: Pawin Vongmasa Date: Sat, 20 Jun 2020 11:29:54 -0700 Subject: [PATCH 43/62] OMX VTS: Use GetComponentRole from OMXUtils Test: atest VtsHalMediaOmxV1_0TargetMasterTest Bug: 159410244 Change-Id: Iba2a7259ddc5fc634b22d8c5954178dede6b71d5 --- .../omx/1.0/vts/functional/common/Android.bp | 1 + .../VtsHalMediaOmxV1_0TargetMasterTest.cpp | 69 +------------------ 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/media/omx/1.0/vts/functional/common/Android.bp b/media/omx/1.0/vts/functional/common/Android.bp index 2c024a0c0c..720ea9f1cf 100644 --- a/media/omx/1.0/vts/functional/common/Android.bp +++ b/media/omx/1.0/vts/functional/common/Android.bp @@ -74,5 +74,6 @@ cc_defaults { // TODO(b/64437680): Assume these libs are always available on the device. shared_libs: [ "libstagefright_foundation", + "libstagefright_omx_utils", ], } diff --git a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp index 9b4722ec57..4e253134c4 100644 --- a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp +++ b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp @@ -33,6 +33,7 @@ #include #include #include +#include using ::android::sp; using ::android::base::Join; @@ -87,71 +88,6 @@ void displayComponentInfo(hidl_vec& nodeList) { } } -/* - * Returns the role based on is_encoder and mime. - * - * The mapping from a pair (is_encoder, mime) to a role string is - * defined in frameworks/av/media/libmedia/MediaDefs.cpp and - * frameworks/av/media/libstagefright/omx/OMXUtils.cpp. This function - * does essentially the same work as GetComponentRole() in - * OMXUtils.cpp. - * - * Args: - * is_encoder: A boolean indicating whether the role is for an - * encoder or a decoder. - * mime: A string of the desired mime type. - * - * Returns: - * A const string for the requested role name, empty if mime is not - * recognized. - */ -const std::string getComponentRole(bool isEncoder, const std::string mime) { - // Mapping from mime types to roles. - // These values come from MediaDefs.cpp and OMXUtils.cpp - const std::map audioMimeToRole = { - {"3gpp", "amrnb"}, {"ac3", "ac3"}, {"amr-wb", "amrwb"}, - {"eac3", "eac3"}, {"flac", "flac"}, {"g711-alaw", "g711alaw"}, - {"g711-mlaw", "g711mlaw"}, {"gsm", "gsm"}, {"mp4a-latm", "aac"}, - {"mpeg", "mp3"}, {"mpeg-L1", "mp1"}, {"mpeg-L2", "mp2"}, - {"opus", "opus"}, {"raw", "raw"}, {"vorbis", "vorbis"}, - }; - const std::map videoMimeToRole = { - {"3gpp", "h263"}, {"avc", "avc"}, {"dolby-vision", "dolby-vision"}, - {"hevc", "hevc"}, {"mp4v-es", "mpeg4"}, {"mpeg2", "mpeg2"}, - {"x-vnd.on2.vp8", "vp8"}, {"x-vnd.on2.vp9", "vp9"}, - }; - const std::map imageMimeToRole = { - {"vnd.android.heic", "heic"}, - }; - - // Suffix begins after the mime prefix. - const size_t prefixEnd = mime.find("/"); - if (prefixEnd == std::string::npos || prefixEnd == mime.size()) return ""; - const std::string mime_suffix = mime.substr(prefixEnd + 1, mime.size() - 1); - const std::string middle = isEncoder ? "encoder." : "decoder."; - std::string prefix; - std::string suffix; - if (mime.rfind("audio/", 0) != std::string::npos) { - const auto it = audioMimeToRole.find(mime_suffix); - if (it == audioMimeToRole.end()) return ""; - prefix = "audio_"; - suffix = it->second; - } else if (mime.rfind("video/", 0) != std::string::npos) { - const auto it = videoMimeToRole.find(mime_suffix); - if (it == videoMimeToRole.end()) return ""; - prefix = "video_"; - suffix = it->second; - } else if (mime.rfind("image/", 0) != std::string::npos) { - const auto it = imageMimeToRole.find(mime_suffix); - if (it == imageMimeToRole.end()) return ""; - prefix = "image_"; - suffix = it->second; - } else { - return ""; - } - return prefix + middle + suffix; -} - void validateAttributes( const std::map& knownPatterns, const std::vector& unknownPatterns, @@ -328,7 +264,8 @@ TEST_P(MasterHidlTest, ListRoles) { // Make sure role name follows expected format based on type and // isEncoder - const std::string role_name = getComponentRole(role.isEncoder, role.type); + const std::string role_name( + ::android::GetComponentRole(role.isEncoder, role.type.c_str())); EXPECT_EQ(role_name, role.role) << "Role \"" << role.role << "\" does not match " << (role.isEncoder ? "an encoder " : "a decoder ") << "for mime type \"" << role.type << "."; From 29e37e27ccba3e077f09c4452c91b6a946465b20 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Mon, 22 Jun 2020 10:26:45 -0700 Subject: [PATCH 44/62] RebootEscrow HAL: testing with secure implementations To test implementations that use TEE keymaster with EARLY_BOOT_ONLY keys, it is required that the "earlyBootEnded" call in vold should be removed before they will pass. Mark those tests as DISABLED_... and include a comment and README indicating what needs to be done. Bug: 159513354 Bug: 158964050 Test: atest VtsHalRebootEscrowTargetTest Change-Id: Ie12969c0353ff42202b3dfcfa0be87ba3442e5d3 --- rebootescrow/aidl/vts/functional/README.md | 7 +++++ .../VtsHalRebootEscrowTargetTest.cpp | 26 ++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 rebootescrow/aidl/vts/functional/README.md diff --git a/rebootescrow/aidl/vts/functional/README.md b/rebootescrow/aidl/vts/functional/README.md new file mode 100644 index 0000000000..9ae5caffad --- /dev/null +++ b/rebootescrow/aidl/vts/functional/README.md @@ -0,0 +1,7 @@ +Many of the tests in this directory may require that TEE Keymaster +"EARLY_BOOT_ONLY" keys be usable when this test runs. In order to accomplish +this, a build of "vold" that omits the call to "earlyBootEnded()" function +should be made. Then these DISABLED tests may be run successfully. + +The CTS test ResumeOnRebootHostTests will test the functionality without a +special build. diff --git a/rebootescrow/aidl/vts/functional/VtsHalRebootEscrowTargetTest.cpp b/rebootescrow/aidl/vts/functional/VtsHalRebootEscrowTargetTest.cpp index cd8cc3eaa1..809a3b502a 100644 --- a/rebootescrow/aidl/vts/functional/VtsHalRebootEscrowTargetTest.cpp +++ b/rebootescrow/aidl/vts/functional/VtsHalRebootEscrowTargetTest.cpp @@ -60,7 +60,10 @@ class RebootEscrowAidlTest : public testing::TestWithParam { }; }; -TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_Success) { +// This test assumes that it can retrieve keys immediately, but some +// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the +// earlyBootEnded() calls will need to be disabled to test this correctly. +TEST_P(RebootEscrowAidlTest, DISABLED_StoreAndRetrieve_Success) { SKIP_UNSUPPORTED; ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk()); @@ -70,7 +73,10 @@ TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_Success) { EXPECT_EQ(actualKey, KEY_1); } -TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_SecondRetrieveSucceeds) { +// This test assumes that it can retrieve keys immediately, but some +// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the +// earlyBootEnded() calls will need to be disabled to test this correctly. +TEST_P(RebootEscrowAidlTest, DISABLED_StoreAndRetrieve_SecondRetrieveSucceeds) { SKIP_UNSUPPORTED; ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk()); @@ -83,7 +89,10 @@ TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_SecondRetrieveSucceeds) { EXPECT_EQ(actualKey, KEY_1); } -TEST_P(RebootEscrowAidlTest, StoreTwiceOverwrites_Success) { +// This test assumes that it can retrieve keys immediately, but some +// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the +// earlyBootEnded() calls will need to be disabled to test this correctly. +TEST_P(RebootEscrowAidlTest, DISABLED_StoreTwiceOverwrites_Success) { SKIP_UNSUPPORTED; ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk()); @@ -94,7 +103,10 @@ TEST_P(RebootEscrowAidlTest, StoreTwiceOverwrites_Success) { EXPECT_EQ(actualKey, KEY_2); } -TEST_P(RebootEscrowAidlTest, StoreEmpty_AfterGetEmptyKey_Success) { +// This test assumes that it can retrieve keys immediately, but some +// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the +// earlyBootEnded() calls will need to be disabled to test this correctly. +TEST_P(RebootEscrowAidlTest, DISABLED_StoreEmpty_AfterGetEmptyKey_Success) { SKIP_UNSUPPORTED; rebootescrow->storeKey(KEY_1); @@ -105,6 +117,12 @@ TEST_P(RebootEscrowAidlTest, StoreEmpty_AfterGetEmptyKey_Success) { EXPECT_EQ(actualKey, EMPTY_KEY); } +TEST_P(RebootEscrowAidlTest, Store_Success) { + SKIP_UNSUPPORTED; + + rebootescrow->storeKey(KEY_1); +} + INSTANTIATE_TEST_SUITE_P( RebootEscrow, RebootEscrowAidlTest, testing::ValuesIn(android::getAidlHalInstanceNames(IRebootEscrow::descriptor)), From 81fa7605cff32efbc62b5b74b975b51a9d7ab27b Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Mon, 22 Jun 2020 18:04:33 +0000 Subject: [PATCH 45/62] Revert "Allow compilations in TOCTOU tests to fail with GENERAL_FAILURE." This reverts commit 362dfd64d5c2a431dc5138f0ac6dab4f0c23f690. Bug: 157489048 Test: 1.2/1.3 VTS TOCTOU tests Change-Id: Ifdf4a8fab129cd90a3be019c3c598d980b785aaa --- .../functional/CompilationCachingTests.cpp | 47 ++++--------------- .../functional/CompilationCachingTests.cpp | 47 ++++--------------- 2 files changed, 18 insertions(+), 76 deletions(-) diff --git a/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp b/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp index 16b313a855..449b8f369d 100644 --- a/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp +++ b/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp @@ -315,8 +315,7 @@ class CompilationCachingTestBase : public testing::Test { void saveModelToCache(const Model& model, const hidl_vec& modelCache, const hidl_vec& dataCache, - sp* preparedModel = nullptr, - bool allowGeneralFailure = false) { + sp* preparedModel = nullptr) { if (preparedModel != nullptr) *preparedModel = nullptr; // Launch prepare model. @@ -330,10 +329,7 @@ class CompilationCachingTestBase : public testing::Test { // Retrieve prepared model. preparedModelCallback->wait(); - const auto prepareCallbackStatus = preparedModelCallback->getStatus(); - if (!allowGeneralFailure || prepareCallbackStatus != ErrorStatus::GENERAL_FAILURE) { - ASSERT_EQ(prepareCallbackStatus, ErrorStatus::NONE); - } + ASSERT_EQ(preparedModelCallback->getStatus(), ErrorStatus::NONE); if (preparedModel != nullptr) { *preparedModel = IPreparedModel::castFrom(preparedModelCallback->getPreparedModel()) .withDefault(nullptr); @@ -1026,8 +1022,7 @@ static void copyCacheFiles(const std::vector>& from, // Number of operations in the large test model. constexpr uint32_t kLargeModelSize = 100; -constexpr uint32_t kNumSuccessfulIterationsTOCTOU = 100; -constexpr uint32_t kMaxNumFailedIterationsTOCTOU = 100; +constexpr uint32_t kNumIterationsTOCTOU = 100; TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { if (!mIsCachingSupported) return; @@ -1055,30 +1050,18 @@ TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; - // This test is probabilistic, so we run it multiple times. We allow the compilation to fail - // because it is not related to the security aspect of the TOCTOU test. However, we need to have - // enough successful iterations to ensure the test coverage. - uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; - while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // Save the modelAdd compilation to cache. { hidl_vec modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); - sp preparedModel = nullptr; // Spawn a thread to copy the cache content concurrently while saving to cache. std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); - saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, - /*allowGeneralFailure=*/true); + saveModelToCache(modelAdd, modelCache, dataCache); thread.join(); - - if (preparedModel == nullptr) { - numFailedIterations++; - ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); - } else { - numSuccessfulIterations++; - } } // Retrieve preparedModel from cache. @@ -1129,26 +1112,14 @@ TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; - // This test is probabilistic, so we run it multiple times. We allow the compilation to fail - // because it is not related to the security aspect of the TOCTOU test. However, we need to have - // enough successful iterations to ensure the test coverage. - uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; - while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // Save the modelAdd compilation to cache. { hidl_vec modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); - sp preparedModel = nullptr; - saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, - /*allowGeneralFailure=*/true); - - if (preparedModel == nullptr) { - numFailedIterations++; - ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); - } else { - numSuccessfulIterations++; - } + saveModelToCache(modelAdd, modelCache, dataCache); } // Retrieve preparedModel from cache. diff --git a/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp b/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp index 382fc767f7..ac18c8ffcc 100644 --- a/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp +++ b/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp @@ -318,8 +318,7 @@ class CompilationCachingTestBase : public testing::Test { void saveModelToCache(const Model& model, const hidl_vec& modelCache, const hidl_vec& dataCache, - sp* preparedModel = nullptr, - bool allowGeneralFailure = false) { + sp* preparedModel = nullptr) { if (preparedModel != nullptr) *preparedModel = nullptr; // Launch prepare model. @@ -333,10 +332,7 @@ class CompilationCachingTestBase : public testing::Test { // Retrieve prepared model. preparedModelCallback->wait(); - const auto prepareCallbackStatus = preparedModelCallback->getStatus(); - if (!allowGeneralFailure || prepareCallbackStatus != ErrorStatus::GENERAL_FAILURE) { - ASSERT_EQ(prepareCallbackStatus, ErrorStatus::NONE); - } + ASSERT_EQ(preparedModelCallback->getStatus(), ErrorStatus::NONE); if (preparedModel != nullptr) { *preparedModel = IPreparedModel::castFrom(preparedModelCallback->getPreparedModel()) .withDefault(nullptr); @@ -1017,8 +1013,7 @@ static void copyCacheFiles(const std::vector>& from, // Number of operations in the large test model. constexpr uint32_t kLargeModelSize = 100; -constexpr uint32_t kNumSuccessfulIterationsTOCTOU = 100; -constexpr uint32_t kMaxNumFailedIterationsTOCTOU = 100; +constexpr uint32_t kNumIterationsTOCTOU = 100; TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { if (!mIsCachingSupported) return; @@ -1046,30 +1041,18 @@ TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; - // This test is probabilistic, so we run it multiple times. We allow the compilation to fail - // because it is not related to the security aspect of the TOCTOU test. However, we need to have - // enough successful iterations to ensure the test coverage. - uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; - while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // Save the modelAdd compilation to cache. { hidl_vec modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); - sp preparedModel = nullptr; // Spawn a thread to copy the cache content concurrently while saving to cache. std::thread thread(copyCacheFiles, std::cref(modelCacheMul), std::cref(mModelCache)); - saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, - /*allowGeneralFailure=*/true); + saveModelToCache(modelAdd, modelCache, dataCache); thread.join(); - - if (preparedModel == nullptr) { - numFailedIterations++; - ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); - } else { - numSuccessfulIterations++; - } } // Retrieve preparedModel from cache. @@ -1120,26 +1103,14 @@ TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) { // Use a different token for modelAdd. mToken[0]++; - // This test is probabilistic, so we run it multiple times. We allow the compilation to fail - // because it is not related to the security aspect of the TOCTOU test. However, we need to have - // enough successful iterations to ensure the test coverage. - uint32_t numSuccessfulIterations = 0, numFailedIterations = 0; - while (numSuccessfulIterations < kNumSuccessfulIterationsTOCTOU) { + // This test is probabilistic, so we run it multiple times. + for (uint32_t i = 0; i < kNumIterationsTOCTOU; i++) { // Save the modelAdd compilation to cache. { hidl_vec modelCache, dataCache; createCacheHandles(mModelCache, AccessMode::READ_WRITE, &modelCache); createCacheHandles(mDataCache, AccessMode::READ_WRITE, &dataCache); - sp preparedModel = nullptr; - saveModelToCache(modelAdd, modelCache, dataCache, &preparedModel, - /*allowGeneralFailure=*/true); - - if (preparedModel == nullptr) { - numFailedIterations++; - ASSERT_LE(numFailedIterations, kMaxNumFailedIterationsTOCTOU); - } else { - numSuccessfulIterations++; - } + saveModelToCache(modelAdd, modelCache, dataCache); } // Retrieve preparedModel from cache. From 1972df27b9576b3aa41ffc842352446203f5fd7e Mon Sep 17 00:00:00 2001 From: felipeal Date: Fri, 19 Jun 2020 18:03:54 -0700 Subject: [PATCH 46/62] Fixed EmulatedUserHal::get(USER_IDENTIFICATION_ASSOCIATION). It must set the requestId in the response. Test: adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default --set 299896587 a 1 i 666 i 1 i 1 i 2 && \ adb shell cmd car_service get-user-auth-association --hal-only KEY_FOB Fixes: 159497444 Bug: 159498909 Change-Id: Ib3f87b45714883c3e5b72464813df24ec4124dbb --- .../impl/vhal_v2_0/EmulatedUserHal.cpp | 56 +++++++++++-------- .../default/impl/vhal_v2_0/EmulatedUserHal.h | 18 +++++- .../impl/vhal_v2_0/EmulatedVehicleHal.cpp | 2 +- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp index 2c2f23c4c6..ea38cb3941 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.cpp @@ -71,34 +71,44 @@ android::base::Result> EmulatedUserHal::onSetP } android::base::Result> EmulatedUserHal::onGetProperty( - int32_t prop) { - ALOGV("onGetProperty(%d)", prop); - switch (prop) { + const VehiclePropValue& value) { + ALOGV("onGetProperty(%s)", toString(value).c_str()); + switch (value.prop) { case INITIAL_USER_INFO: case SWITCH_USER: case CREATE_USER: case REMOVE_USER: - ALOGE("onGetProperty(): %d is only supported on SET", prop); + ALOGE("onGetProperty(): %d is only supported on SET", value.prop); return android::base::Error(static_cast(StatusCode::INVALID_ARG)) << "only supported on SET"; case USER_IDENTIFICATION_ASSOCIATION: - if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { - ALOGI("onGetProperty(%d): returning %s", prop, - toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); - auto value = std::unique_ptr( - new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); - return value; - } - ALOGE("onGetProperty(%d): USER_IDENTIFICATION_ASSOCIATION not set by lshal", prop); - return android::base::Error(static_cast(StatusCode::NOT_AVAILABLE)) - << "not set by lshal"; + return onGetUserIdentificationAssociation(value); default: - ALOGE("onGetProperty(): %d is not supported", prop); + ALOGE("onGetProperty(): %d is not supported", value.prop); return android::base::Error(static_cast(StatusCode::INVALID_ARG)) << "not supported by User HAL"; } } +android::base::Result> +EmulatedUserHal::onGetUserIdentificationAssociation(const VehiclePropValue& value) { + if (mSetUserIdentificationAssociationResponseFromCmd != nullptr) { + ALOGI("get(USER_IDENTIFICATION_ASSOCIATION): returning %s", + toString(*mSetUserIdentificationAssociationResponseFromCmd).c_str()); + auto newValue = std::unique_ptr( + new VehiclePropValue(*mSetUserIdentificationAssociationResponseFromCmd)); + // Must use the same requestId + if (value.value.int32Values.size() > 0) { + newValue->value.int32Values[0] = value.value.int32Values[0]; + } else { + ALOGE("get(USER_IDENTIFICATION_ASSOCIATION): no requestId on %s", + toString(value).c_str()); + } + return newValue; + } + return defaultUserIdentificationAssociation(value); +} + android::base::Result> EmulatedUserHal::onSetInitialUserInfoResponse(const VehiclePropValue& value) { if (value.value.int32Values.size() == 0) { @@ -250,16 +260,14 @@ EmulatedUserHal::onSetUserIdentificationAssociation(const VehiclePropValue& valu } // Returns default response - auto updatedValue = std::unique_ptr(new VehiclePropValue); - updatedValue->prop = USER_IDENTIFICATION_ASSOCIATION; - updatedValue->timestamp = elapsedRealtimeNano(); - updatedValue->value.int32Values.resize(1); - updatedValue->value.int32Values[0] = requestId; - updatedValue->value.stringValue = "Response not set by LSHAL"; + return defaultUserIdentificationAssociation(value); +} - ALOGI("no lshal response; replying with an error message: %s", toString(*updatedValue).c_str()); - - return updatedValue; +android::base::Result> +EmulatedUserHal::defaultUserIdentificationAssociation(const VehiclePropValue& request) { + // TODO(b/159498909): return a response with NOT_ASSOCIATED_ANY_USER for all requested types + ALOGE("no lshal response for %s; replying with NOT_AVAILABLE", toString(request).c_str()); + return android::base::Error(static_cast(StatusCode::NOT_AVAILABLE)) << "not set by lshal"; } android::base::Result> EmulatedUserHal::sendUserHalResponse( diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h index 5243b969d8..db2f117e3e 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedUserHal.h @@ -58,7 +58,8 @@ class EmulatedUserHal { * * @return property value and StatusCode */ - android::base::Result> onGetProperty(int32_t prop); + android::base::Result> onGetProperty( + const VehiclePropValue& value); /** * Shows the User HAL emulation help. @@ -111,12 +112,25 @@ class EmulatedUserHal { const VehiclePropValue& value); /** - * Used to emulate USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for + * Used to emulate set USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for * usage. */ android::base::Result> onSetUserIdentificationAssociation( const VehiclePropValue& value); + /** + * Used to emulate get USER_IDENTIFICATION_ASSOCIATION - see onSetInitialUserInfoResponse() for + * usage. + */ + android::base::Result> onGetUserIdentificationAssociation( + const VehiclePropValue& value); + + /** + * Creates a default USER_IDENTIFICATION_ASSOCIATION when it was not set by lshal. + */ + android::base::Result> defaultUserIdentificationAssociation( + const VehiclePropValue& request); + android::base::Result> sendUserHalResponse( std::unique_ptr response, int32_t requestId); diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp index 9cfcc1c605..a0b566d1ee 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp @@ -153,7 +153,7 @@ VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get( default: if (mEmulatedUserHal != nullptr && mEmulatedUserHal->isSupported(propId)) { ALOGI("get(): getting value for prop %d from User HAL", propId); - const auto& ret = mEmulatedUserHal->onGetProperty(propId); + const auto& ret = mEmulatedUserHal->onGetProperty(requestedPropValue); if (!ret.ok()) { ALOGE("get(): User HAL returned error: %s", ret.error().message().c_str()); *outStatus = StatusCode(ret.error().code()); From 709842ab98a0ade21588ea776e010ab991ef4807 Mon Sep 17 00:00:00 2001 From: Slava Shklyaev Date: Mon, 8 Jun 2020 15:07:19 +0100 Subject: [PATCH 47/62] Clarify NNAPI control flow shape constraints Bug: 156918813 Bug: 158557728 Test: m Change-Id: I4c2b83e11b27b791b3aa624be68474011b92a269 --- current.txt | 1 + neuralnetworks/1.3/types.hal | 28 +++++++++++++++++++--------- neuralnetworks/1.3/types.t | 8 +++++--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/current.txt b/current.txt index e2d14083cc..bacedfd47a 100644 --- a/current.txt +++ b/current.txt @@ -721,6 +721,7 @@ ee9dc34b9925b8367b1111c72bd6d9d375432735e451572ca5a665d8516a7744 android.hardwar eee3430cc86c97c7b407495863d8fb61da6f1a64b7721e77b9b4909b11b174e9 android.hardware.neuralnetworks@1.3::IPreparedModelCallback acf84925f8ee0a651f2ec547ac334034de266479b93af5434f6c1f25e66aba96 android.hardware.neuralnetworks@1.3::types e9080d04218e98512b63aace9ff3da52f0130238391f15cbbf7df396a3ec9072 android.hardware.neuralnetworks@1.3::types # b/155508675, b/155662254, b/155238914, b/155660285 +583dc88b41e702e940fd954edda1beb8b4151eab55a5c6d7e69e2781bce84b59 android.hardware.neuralnetworks@1.3::types # b/156918813 b454df853441c12f6e425e8a60dd29fda20f5e6e39b93d1103e4b37495db38aa android.hardware.radio@1.5::IRadio fcbb0742a88215ee7a6d7ce0825d253eb2b50391fc6c8c48667f9fd7f6d4549e android.hardware.radio@1.5::IRadioIndication b809193970a91ca637a4b0184767315601d32e3ef3d5992ffbc7a8d14a14f015 android.hardware.radio@1.5::IRadioResponse diff --git a/neuralnetworks/1.3/types.hal b/neuralnetworks/1.3/types.hal index 39ea4c24f2..3b2b14c98c 100644 --- a/neuralnetworks/1.3/types.hal +++ b/neuralnetworks/1.3/types.hal @@ -5102,11 +5102,15 @@ enum OperationType : int32_t { * The inputs and outputs of the two referenced subgraphs must agree with the * signature of this operation. That is, if the operation has (3 + n) inputs * and m outputs, both subgraphs must have n inputs and m outputs with the same - * types as the corresponding operation inputs and outputs. + * types, ranks, dimensions, scales, + * zeroPoints, and extraParams as the corresponding operation inputs and + * outputs. + * All of the operands mentioned must have fully specified dimensions. * * Inputs: * * 0: A value of type {@link OperandType::TENSOR_BOOL8} and shape [1] * that determines which of the two referenced subgraphs to execute. + * The operand must have fully specified dimensions. * * 1: A {@link OperandType::SUBGRAPH} reference to the subgraph to be * executed if the condition is true. * * 2: A {@link OperandType::SUBGRAPH} reference to the subgraph to be @@ -5165,13 +5169,17 @@ enum OperationType : int32_t { * Inputs: * * 0: A {@link OperandType::SUBGRAPH} reference to the condition * subgraph. The subgraph must have (m + k + n) inputs with - * the same types as the corresponding inputs of the WHILE operation - * and exactly one output of {@link OperandType::TENSOR_BOOL8} - * and shape [1]. + * the same types, ranks, dimensions, + * scales, zeroPoints, and extraParams as the corresponding inputs of + * the WHILE operation and exactly one output of + * {@link OperandType::TENSOR_BOOL8} and shape [1]. + * All of the operands mentioned must have fully specified dimensions. * * 1: A {@link OperandType::SUBGRAPH} reference to the body subgraph. * The subgraph must have (m + k + n) inputs and (m + k) outputs with - * the same types as the corresponding inputs and outputs of the WHILE - * operation. + * the same types, ranks, dimensions, + * scales, zeroPoints, and extraParams as the corresponding inputs and + * outputs of the WHILE operation. + * All of the operands mentioned must have fully specified dimensions. * * (m inputs): Initial values for input-output operands. * * (k inputs): Initial values for state-only operands. * * (n inputs): Values for input-only operands. @@ -5491,7 +5499,9 @@ struct Operand { * If a tensor operand's dimensions are not fully specified, the * dimensions of the operand are deduced from the operand * dimensions and values of the operation for which that operand - * is an output. + * is an output or from the corresponding {@link OperationType::IF} or + * {@link OperationType::WHILE} operation input operand dimensions in the + * case of referenced subgraph input operands. * * In the following situations, a tensor operand's dimensions must * be fully specified: @@ -5499,8 +5509,8 @@ struct Operand { * . The operand has lifetime CONSTANT_COPY or * CONSTANT_REFERENCE. * - * . The operand has lifetime SUBGRAPH_INPUT. Fully - * specified dimensions must either be present in the + * . The operand has lifetime SUBGRAPH_INPUT and belongs to the main + * subgraph. Fully specified dimensions must either be present in the * Operand or they must be provided in the corresponding * RequestArgument. * EXCEPTION: If the input is optional and omitted diff --git a/neuralnetworks/1.3/types.t b/neuralnetworks/1.3/types.t index 0a6e45e487..7220e372a7 100644 --- a/neuralnetworks/1.3/types.t +++ b/neuralnetworks/1.3/types.t @@ -264,7 +264,9 @@ struct Operand { * If a tensor operand's dimensions are not fully specified, the * dimensions of the operand are deduced from the operand * dimensions and values of the operation for which that operand - * is an output. + * is an output or from the corresponding {@link OperationType::IF} or + * {@link OperationType::WHILE} operation input operand dimensions in the + * case of referenced subgraph input operands. * * In the following situations, a tensor operand's dimensions must * be fully specified: @@ -272,8 +274,8 @@ struct Operand { * . The operand has lifetime CONSTANT_COPY or * CONSTANT_REFERENCE. * - * . The operand has lifetime SUBGRAPH_INPUT. Fully - * specified dimensions must either be present in the + * . The operand has lifetime SUBGRAPH_INPUT and belongs to the main + * subgraph. Fully specified dimensions must either be present in the * Operand or they must be provided in the corresponding * RequestArgument. * EXCEPTION: If the input is optional and omitted From fbcb5a89c91b2bb4a8b27c88338cae35cc973d90 Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Tue, 23 Jun 2020 16:31:44 -0400 Subject: [PATCH 48/62] Do not link mapper libraries statically Linking them statically prevents the mapper SP HAL from being extended Bug: 158465474 Test: local build vts tools. Passed on VtsHalGraphicsComposerV2_XTargetTest. Change-Id: I916b1c042b1e81e53f7398cd4a1a2231469ea91f --- graphics/composer/2.1/vts/functional/Android.bp | 8 ++++---- graphics/composer/2.2/vts/functional/Android.bp | 8 ++++---- graphics/composer/2.3/vts/functional/Android.bp | 8 ++++---- graphics/composer/2.4/vts/functional/Android.bp | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp index dafbbf9c9e..e137afb27a 100644 --- a/graphics/composer/2.1/vts/functional/Android.bp +++ b/graphics/composer/2.1/vts/functional/Android.bp @@ -23,6 +23,10 @@ cc_test { shared_libs: [ "libfmq", "libsync", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@2.1", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", ], static_libs: [ "android.hardware.graphics.allocator@2.0", @@ -30,13 +34,9 @@ cc_test { "android.hardware.graphics.allocator@4.0", "android.hardware.graphics.composer@2.1", "android.hardware.graphics.composer@2.1-vts", - "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0", "android.hardware.graphics.mapper@4.0-vts", ], header_libs: [ diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp index e1a254dee4..d80845f9dd 100644 --- a/graphics/composer/2.2/vts/functional/Android.bp +++ b/graphics/composer/2.2/vts/functional/Android.bp @@ -33,6 +33,10 @@ cc_test { "libprocessgroup", "libsync", "libui", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@2.1", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", ], static_libs: [ "android.hardware.graphics.allocator@2.0", @@ -43,13 +47,9 @@ cc_test { "android.hardware.graphics.composer@2.1-vts", "android.hardware.graphics.composer@2.2", "android.hardware.graphics.composer@2.2-vts", - "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0", "android.hardware.graphics.mapper@4.0-vts", "libgtest", "librenderengine", diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp index 18ea2aa96c..1ab6b3b88d 100644 --- a/graphics/composer/2.3/vts/functional/Android.bp +++ b/graphics/composer/2.3/vts/functional/Android.bp @@ -24,6 +24,10 @@ cc_test { "libfmq", "libhidlbase", "libsync", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@2.1", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", ], static_libs: [ "android.hardware.graphics.allocator@2.0", @@ -35,13 +39,9 @@ cc_test { "android.hardware.graphics.composer@2.2-vts", "android.hardware.graphics.composer@2.3", "android.hardware.graphics.composer@2.3-vts", - "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0", "android.hardware.graphics.mapper@4.0-vts", ], header_libs: [ diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp index 9e7cc46c56..d0209b7af3 100644 --- a/graphics/composer/2.4/vts/functional/Android.bp +++ b/graphics/composer/2.4/vts/functional/Android.bp @@ -23,6 +23,10 @@ cc_test { shared_libs: [ "libfmq", "libsync", + "android.hardware.graphics.mapper@2.0", + "android.hardware.graphics.mapper@2.1", + "android.hardware.graphics.mapper@3.0", + "android.hardware.graphics.mapper@4.0", ], static_libs: [ "android.hardware.graphics.allocator@2.0", @@ -36,13 +40,9 @@ cc_test { "android.hardware.graphics.composer@2.3-vts", "android.hardware.graphics.composer@2.4", "android.hardware.graphics.composer@2.4-vts", - "android.hardware.graphics.mapper@2.0", "android.hardware.graphics.mapper@2.0-vts", - "android.hardware.graphics.mapper@2.1", "android.hardware.graphics.mapper@2.1-vts", - "android.hardware.graphics.mapper@3.0", "android.hardware.graphics.mapper@3.0-vts", - "android.hardware.graphics.mapper@4.0", "android.hardware.graphics.mapper@4.0-vts", ], header_libs: [ From f90b7d8363b643bc058769ab003e6f9adcfe074a Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sat, 20 Jun 2020 17:04:41 -0400 Subject: [PATCH 49/62] Identity: Update for changes to ISO 18013-5. Key derivation for session encryption and MACing now involves mixing in SessionTranscriptBytes. Update docs, default implementation, and VTS tests to reflect this. Also, the standard changed such that instead of DeviceAuthentication being MACed or signed, it's instead DeviceAuthenticationBytes which is defined as #6.24(bstr .cbor DeviceAuthentication). The same also for ReaderAuthentication, now ReaderAuthenticationBytes is the CBOR which is signed by the reader. Also update the URL for CDDL since it's now a published RFC. Bug: 159482543 Test: atest VtsHalIdentityTargetTest Test: atest android.security.identity.cts Merged-In: I73fc7eb48ffb71e00a8b54849266ed814295fa39 Change-Id: I4bb5040895cf24a7089b7e36e05eeaf26496381e --- .../identity/IIdentityCredential.aidl | 10 +++-- .../identity/IIdentityCredentialStore.aidl | 2 +- identity/aidl/default/IdentityCredential.cpp | 34 +++++++++++----- identity/aidl/vts/ReaderAuthTests.cpp | 38 ++++++++++-------- .../aidl/vts/VtsHalIdentityEndToEndTest.cpp | 39 ++++++++++++------- 5 files changed, 79 insertions(+), 44 deletions(-) diff --git a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl index 3b8fbd9e1f..730b601c69 100644 --- a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl +++ b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl @@ -151,8 +151,8 @@ interface IIdentityCredential { * IntentToRetain = bool * * For the readerSignature parameter, this can either be empty or if non-empty it - * must be a COSE_Sign1 structure with an ECDSA signature over the content of the - * CBOR conforming to the following CDDL: + * must be a COSE_Sign1 where the payload is the bytes of the + * ReaderAuthenticationBytes CBOR defined below: * * ReaderAuthentication = [ * "ReaderAuthentication", @@ -164,6 +164,8 @@ interface IIdentityCredential { * * ItemsRequestBytes = #6.24(bstr .cbor ItemsRequest) * + * ReaderAuthenticationBytes = #6.24(bstr .cbor ReaderAuthentication) + * * The public key corresponding to the key used to made signature, can be found in the * 'x5chain' unprotected header element of the COSE_Sign1 structure (as as described * in 'draft-ietf-cose-x509-04'). There will be at least one certificate in said element @@ -278,7 +280,7 @@ interface IIdentityCredential { * * @param out mac is empty if signingKeyBlob or the sessionTranscript passed to * startRetrieval() is empty. Otherwise it is a COSE_Mac0 with empty payload - * and the detached content is set to DeviceAuthentication as defined below. + * and the detached content is set to DeviceAuthenticationBytes as defined below. * This code is produced by using the key agreement and key derivation function * from the ciphersuite with the authentication private key and the reader * ephemeral public key to compute a shared message authentication code (MAC) @@ -299,6 +301,8 @@ interface IIdentityCredential { * * DeviceNameSpacesBytes = #6.24(bstr .cbor DeviceNameSpaces) * + * DeviceAuthenticationBytes = #6.24(bstr .cbor DeviceAuthentication) + * * where * * DeviceNameSpaces = { diff --git a/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl b/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl index bd664e86ea..33e25b1adf 100644 --- a/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl +++ b/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl @@ -99,7 +99,7 @@ import android.hardware.identity.CipherSuite; * Various fields need to be encoded as precisely-specified byte arrays. Where existing standards * define appropriate encodings, those are used. For example, X.509 certificates. Where new * encodings are needed, CBOR is used. CBOR maps are described in CDDL notation - * (https://tools.ietf.org/html/draft-ietf-cbor-cddl-06). + * (https://tools.ietf.org/html/rfc8610). * * All binder calls in the HAL may return a ServiceSpecificException with statuses from the * STATUS_* integers defined in this interface. Each method states which status can be returned diff --git a/identity/aidl/default/IdentityCredential.cpp b/identity/aidl/default/IdentityCredential.cpp index f3c4bbfc28..10f9aa5886 100644 --- a/identity/aidl/default/IdentityCredential.cpp +++ b/identity/aidl/default/IdentityCredential.cpp @@ -39,6 +39,10 @@ using ::std::optional; using namespace ::android::hardware::identity; int IdentityCredential::initialize() { + if (credentialData_.size() == 0) { + LOG(ERROR) << "CredentialData is empty"; + return IIdentityCredentialStore::STATUS_INVALID_DATA; + } auto [item, _, message] = cppbor::parse(credentialData_); if (item == nullptr) { LOG(ERROR) << "CredentialData is not valid CBOR: " << message; @@ -316,13 +320,16 @@ ndk::ScopedAStatus IdentityCredential::startRetrieval( } const vector& itemsRequestBytes = itemsRequest; - vector dataThatWasSigned = cppbor::Array() - .add("ReaderAuthentication") - .add(sessionTranscriptItem_->clone()) - .add(cppbor::Semantic(24, itemsRequestBytes)) - .encode(); + vector encodedReaderAuthentication = + cppbor::Array() + .add("ReaderAuthentication") + .add(sessionTranscriptItem_->clone()) + .add(cppbor::Semantic(24, itemsRequestBytes)) + .encode(); + vector encodedReaderAuthenticationBytes = + cppbor::Semantic(24, encodedReaderAuthentication).encode(); if (!support::coseCheckEcDsaSignature(readerSignature, - dataThatWasSigned, // detached content + encodedReaderAuthenticationBytes, // detached content readerPublicKey.value())) { return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( IIdentityCredentialStore::STATUS_READER_SIGNATURE_CHECK_FAILED, @@ -779,7 +786,7 @@ ndk::ScopedAStatus IdentityCredential::finishRetrieval(vector* outMac, array.add(sessionTranscriptItem_->clone()); array.add(docType_); array.add(cppbor::Semantic(24, encodedDeviceNameSpaces)); - vector encodedDeviceAuthentication = array.encode(); + vector deviceAuthenticationBytes = cppbor::Semantic(24, array.encode()).encode(); vector docTypeAsBlob(docType_.begin(), docType_.end()); optional> signingKey = @@ -797,17 +804,24 @@ ndk::ScopedAStatus IdentityCredential::finishRetrieval(vector* outMac, IIdentityCredentialStore::STATUS_FAILED, "Error doing ECDH")); } + // Mix-in SessionTranscriptBytes + vector sessionTranscriptBytes = cppbor::Semantic(24, sessionTranscript_).encode(); + vector sharedSecretWithSessionTranscriptBytes = sharedSecret.value(); + std::copy(sessionTranscriptBytes.begin(), sessionTranscriptBytes.end(), + std::back_inserter(sharedSecretWithSessionTranscriptBytes)); + vector salt = {0x00}; vector info = {}; - optional> derivedKey = support::hkdf(sharedSecret.value(), salt, info, 32); + optional> derivedKey = + support::hkdf(sharedSecretWithSessionTranscriptBytes, salt, info, 32); if (!derivedKey) { return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( IIdentityCredentialStore::STATUS_FAILED, "Error deriving key from shared secret")); } - mac = support::coseMac0(derivedKey.value(), {}, // payload - encodedDeviceAuthentication); // additionalData + mac = support::coseMac0(derivedKey.value(), {}, // payload + deviceAuthenticationBytes); // detached content if (!mac) { return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( IIdentityCredentialStore::STATUS_FAILED, "Error MACing data")); diff --git a/identity/aidl/vts/ReaderAuthTests.cpp b/identity/aidl/vts/ReaderAuthTests.cpp index 680ba5b7f9..b11f6c5e8f 100644 --- a/identity/aidl/vts/ReaderAuthTests.cpp +++ b/identity/aidl/vts/ReaderAuthTests.cpp @@ -289,16 +289,19 @@ void ReaderAuthTests::retrieveData(const vector& readerPrivateKey, .add("Accessible by None", false))) .encode(); } - vector dataToSign = cppbor::Array() - .add("ReaderAuthentication") - .add(sessionTranscript.clone()) - .add(cppbor::Semantic(24, itemsRequestBytes)) - .encode(); + vector encodedReaderAuthentication = + cppbor::Array() + .add("ReaderAuthentication") + .add(sessionTranscript.clone()) + .add(cppbor::Semantic(24, itemsRequestBytes)) + .encode(); + vector encodedReaderAuthenticationBytes = + cppbor::Semantic(24, encodedReaderAuthentication).encode(); optional> readerSignature = - support::coseSignEcDsa(readerPrivateKey, // private key for reader - {}, // content - dataToSign, // detached content + support::coseSignEcDsa(readerPrivateKey, // private key for reader + {}, // content + encodedReaderAuthenticationBytes, // detached content support::certificateChainJoin(readerCertChain)); ASSERT_TRUE(readerSignature); @@ -528,17 +531,20 @@ TEST_P(ReaderAuthTests, ephemeralKeyNotInSessionTranscript) { .add("Accessible by C", false) .add("Accessible by None", false))) .encode(); - vector dataToSign = cppbor::Array() - .add("ReaderAuthentication") - .add(sessionTranscript.clone()) - .add(cppbor::Semantic(24, itemsRequestBytes)) - .encode(); + vector encodedReaderAuthentication = + cppbor::Array() + .add("ReaderAuthentication") + .add(sessionTranscript.clone()) + .add(cppbor::Semantic(24, itemsRequestBytes)) + .encode(); + vector encodedReaderAuthenticationBytes = + cppbor::Semantic(24, encodedReaderAuthentication).encode(); vector> readerCertChain = {cert_reader_SelfSigned_}; optional> readerSignature = - support::coseSignEcDsa(readerPrivateKey_, // private key for reader - {}, // content - dataToSign, // detached content + support::coseSignEcDsa(readerPrivateKey_, // private key for reader + {}, // content + encodedReaderAuthenticationBytes, // detached content support::certificateChainJoin(readerCertChain)); ASSERT_TRUE(readerSignature); diff --git a/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp b/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp index a0c4416115..1577293521 100644 --- a/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp +++ b/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp @@ -319,7 +319,7 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { cppbor::Array sessionTranscript = cppbor::Array() .add(cppbor::Semantic(24, deviceEngagementBytes)) .add(cppbor::Semantic(24, eReaderPubBytes)); - vector sessionTranscriptBytes = sessionTranscript.encode(); + vector sessionTranscriptEncoded = sessionTranscript.encode(); vector itemsRequestBytes = cppbor::Map("nameSpaces", @@ -347,14 +347,17 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { " },\n" "}", cborPretty); - vector dataToSign = cppbor::Array() - .add("ReaderAuthentication") - .add(sessionTranscript.clone()) - .add(cppbor::Semantic(24, itemsRequestBytes)) - .encode(); + vector encodedReaderAuthentication = + cppbor::Array() + .add("ReaderAuthentication") + .add(sessionTranscript.clone()) + .add(cppbor::Semantic(24, itemsRequestBytes)) + .encode(); + vector encodedReaderAuthenticationBytes = + cppbor::Semantic(24, encodedReaderAuthentication).encode(); optional> readerSignature = - support::coseSignEcDsa(readerKey, {}, // content - dataToSign, // detached content + support::coseSignEcDsa(readerKey, {}, // content + encodedReaderAuthenticationBytes, // detached content readerCertificate.value()); ASSERT_TRUE(readerSignature); @@ -388,7 +391,7 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { credential->setVerificationToken(verificationToken); ASSERT_TRUE(credential ->startRetrieval(secureProfiles.value(), authToken, itemsRequestBytes, - signingKeyBlob, sessionTranscriptBytes, + signingKeyBlob, sessionTranscriptEncoded, readerSignature.value(), testEntriesEntryCounts) .isOk()); @@ -432,7 +435,7 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { " },\n" "}", cborPretty); - // The data that is MACed is ["DeviceAuthentication", sessionTranscriptBytes, docType, + // The data that is MACed is ["DeviceAuthentication", sessionTranscript, docType, // deviceNameSpacesBytes] so build up that structure cppbor::Array deviceAuthentication; deviceAuthentication.add("DeviceAuthentication"); @@ -441,7 +444,8 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { string docType = "org.iso.18013-5.2019.mdl"; deviceAuthentication.add(docType); deviceAuthentication.add(cppbor::Semantic(24, deviceNameSpacesBytes)); - vector encodedDeviceAuthentication = deviceAuthentication.encode(); + vector deviceAuthenticationBytes = + cppbor::Semantic(24, deviceAuthentication.encode()).encode(); // Derive the key used for MACing. optional> readerEphemeralPrivateKey = @@ -449,13 +453,20 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { optional> sharedSecret = support::ecdh(signingPubKey.value(), readerEphemeralPrivateKey.value()); ASSERT_TRUE(sharedSecret); + // Mix-in SessionTranscriptBytes + vector sessionTranscriptBytes = + cppbor::Semantic(24, sessionTranscript.encode()).encode(); + vector sharedSecretWithSessionTranscriptBytes = sharedSecret.value(); + std::copy(sessionTranscriptBytes.begin(), sessionTranscriptBytes.end(), + std::back_inserter(sharedSecretWithSessionTranscriptBytes)); vector salt = {0x00}; vector info = {}; - optional> derivedKey = support::hkdf(sharedSecret.value(), salt, info, 32); + optional> derivedKey = + support::hkdf(sharedSecretWithSessionTranscriptBytes, salt, info, 32); ASSERT_TRUE(derivedKey); optional> calculatedMac = - support::coseMac0(derivedKey.value(), {}, // payload - encodedDeviceAuthentication); // detached content + support::coseMac0(derivedKey.value(), {}, // payload + deviceAuthenticationBytes); // detached content ASSERT_TRUE(calculatedMac); EXPECT_EQ(mac, calculatedMac); } From 6a9a809e36e5419c4c8937e54cb4c85d1e780c57 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Tue, 23 Jun 2020 14:20:00 -0700 Subject: [PATCH 50/62] camera : Allow non bc camera devices through getConcurrentStreamingCameraIds Also Add y16 stream combinations to configureConcurrentStreamsAvailableOutputs vts test Bug: 159247271 Test: VtsHalCameraProviderV2_4TargetTest --gtest_filter=PerInstance/CameraHidlTest.configureConc* on cuttlefish Change-Id: If5fea1fc47a3bcc8d3695e23f01a55091c246eda Signed-off-by: Jayant Chowdhary --- .../VtsHalCameraProviderV2_4TargetTest.cpp | 19 ++++++++++++++++--- camera/provider/2.6/ICameraProvider.hal | 6 ++++++ current.txt | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 3b8f833cea..f235235ab7 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -843,7 +843,7 @@ public: void verifyRequestTemplate(const camera_metadata_t* metadata, RequestTemplate requestTemplate); - bool isDepthOnly(camera_metadata_t* staticMeta); + static bool isDepthOnly(const camera_metadata_t* staticMeta); static Status getAvailableOutputStreams(const camera_metadata_t *staticMeta, std::vector &outputStreams, @@ -5537,9 +5537,22 @@ static Size getMinSize(Size a, Size b) { // TODO: Add more combinations Status CameraHidlTest::getMandatoryConcurrentStreams(const camera_metadata_t* staticMeta, std::vector* outputStreams) { - if (nullptr == staticMeta) { + if (nullptr == staticMeta || nullptr == outputStreams) { return Status::ILLEGAL_ARGUMENT; } + + if (isDepthOnly(staticMeta)) { + Size y16MaxSize(640, 480); + Size maxAvailableY16Size; + getMaxOutputSizeForFormat(staticMeta, PixelFormat::Y16, &maxAvailableY16Size); + Size y16ChosenSize = getMinSize(y16MaxSize, maxAvailableY16Size); + AvailableStream y16Stream = {.width = y16ChosenSize.width, + .height = y16ChosenSize.height, + .format = static_cast(PixelFormat::Y16)}; + outputStreams->push_back(y16Stream); + return Status::OK; + } + Size yuvMaxSize(1280, 720); Size jpegMaxSize(1920, 1440); Size maxAvailableYuvSize; @@ -6296,7 +6309,7 @@ void CameraHidlTest::configureOfflineStillStream(const std::string &name, ASSERT_TRUE(ret.isOk()); } -bool CameraHidlTest::isDepthOnly(camera_metadata_t* staticMeta) { +bool CameraHidlTest::isDepthOnly(const camera_metadata_t* staticMeta) { camera_metadata_ro_entry scalarEntry; camera_metadata_ro_entry depthEntry; diff --git a/camera/provider/2.6/ICameraProvider.hal b/camera/provider/2.6/ICameraProvider.hal index b8873a6261..d720b26e5c 100644 --- a/camera/provider/2.6/ICameraProvider.hal +++ b/camera/provider/2.6/ICameraProvider.hal @@ -61,6 +61,12 @@ interface ICameraProvider extends @2.5::ICameraProvider { * outputs, stream combinations mentioned above, where YUV is substituted by * Y8 must be also supported. * + * Devices whose capabilities do not include + * ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, must support + * at least a single Y16 stream, Dataspace::DEPTH with sVGA resolution, + * during concurrent operation. + * Where sVGA - min (max output resolution for the given format, 640 X 480) + * * The camera framework must call this method whenever it gets a * cameraDeviceStatusChange callback adding a new camera device or removing * a camera device known to it. This is so that the camera framework can get new combinations diff --git a/current.txt b/current.txt index 90402b4e49..171e2da62e 100644 --- a/current.txt +++ b/current.txt @@ -677,7 +677,7 @@ eb90c4d366f05a025d1d1a3672f8b4c3e33e420fa387f73f21b264645bfdf845 android.hardwar a718c8a3acaa938de5a57923e8c4625ed7ca051e05a1d930ba6998557d7b57c8 android.hardware.camera.device@3.6::ICameraOfflineSession a35d5151b48505f06a775b38c0e2e265f80a845d92802324c643565807f81c53 android.hardware.camera.device@3.6::types 02bdf82dba7dce273a554b4474468a8fb1fb4f61ab65da95eb16e080df63fff6 android.hardware.camera.metadata@3.5::types -7d6b362681f4a4fd0be95535d8913d8de9a26f0765c1bdda4bd837dea8c25db6 android.hardware.camera.provider@2.6::ICameraProvider +93cd94e47b22007bbf436c2f5c2703bb7b2859d1b714d6ae15520db55667ba6c android.hardware.camera.provider@2.6::ICameraProvider 8f8d9463508ff9cae88eb35c429fd0e2dbca0ca8f5de7fdf836cc0c4370becb6 android.hardware.camera.provider@2.6::ICameraProviderCallback 1edf7aef68ef3bd577a1175b1462fb82e3e39f01c6915dda61fba121028df283 android.hardware.camera.provider@2.6::types c1aa508d00b66ed5feefea398fd5edf28fa651ac89773adad7dfda4e0a73a952 android.hardware.cas@1.2::ICas From 25d2378734861ff6d5f96e4037a86dadafe8ab10 Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Wed, 24 Jun 2020 14:29:20 -0700 Subject: [PATCH 51/62] Allow Unsupported BarringInfo in RVC for Radio 1.5 Allow devices launching with IRadio 1.5 this year to not support BarringInfo. Bug: 159582898 Test: atest VtsHalRadioV1_5TargetTest -- -t getBarringInfo Change-Id: I05b749fa3cfb3648148fd2666d7eb6f43f3c45d2 --- radio/1.5/vts/functional/radio_hidl_hal_api.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp index 32c02cb137..ee97431a0f 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) @@ -1174,6 +1175,17 @@ TEST_P(RadioHidlTest_v1_5, getBarringInfo) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial); + int32_t firstApiLevel = android::base::GetIntProperty("ro.product.first_api_level", 0); + // Allow devices shipping with Radio::1_5 and Android 11 to not support barring info. + if (firstApiLevel > 0 && firstApiLevel <= 30) { + ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, + {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); + // Early exit for devices that don't support barring info. + if (radioRsp_v1_5->rspInfo.error != RadioError::NONE) { + return; + } + } + ASSERT_TRUE(radioRsp_v1_5->barringInfos.size() > 0); std::set reportedServices; From bc366009a6d55815af767d4d66e229bd9ea79c52 Mon Sep 17 00:00:00 2001 From: felipeal Date: Thu, 25 Jun 2020 12:40:31 -0700 Subject: [PATCH 52/62] Yet more minor fixes on User HAL: - Minor fixes on docs. - Switched order of String fields on InitialUserInfoResponse to be consistent with doc. Test: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l android.hardware.automotive.vehicle@2.0 Bug: 159856152 Change-Id: I7b05a64fcea7512101436df7c93a3204274a4d6b --- automotive/vehicle/2.0/types.hal | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index b4aa11d599..f7a42e959b 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -2532,16 +2532,17 @@ enum VehicleProperty : int32_t { * * int32[0]: 42 // must match the request id from the request * int32[1]: 2 // action = InitialUserInfoResponseAction::CREATE - * int32[2]: -1 // userToSwitchOrCreate.userId (not used as user will be created) + * int32[2]: -10000 // userToSwitchOrCreate.userId (not used as user will be created) * int32[3]: 8 // userToSwitchOrCreate.flags = ADMIN - * string: "||Owner" // userLocales + separator + userNameToCreate + * string: "||Owner" // userLocales + separator + userNameToCreate * * Notice the string value represents multiple values, separated by ||. The first value is the * (optional) system locales for the user to be created (in this case, it's empty, meaning it * will use Android's default value), while the second value is the (also optional) name of the * to user to be created (when the type of response is InitialUserInfoResponseAction:CREATE). * For example, to create the same "Owner" user with "en-US" and "pt-BR" locales, the string - * value of the response would be "en-US,pt-BR||Owner". + * value of the response would be "en-US,pt-BR||Owner". As such, neither the locale nor the + * name can have || on it, although a single | is fine. * * NOTE: if the HAL doesn't support user management, then it should not define this property, * which in turn would disable the other user-related properties (for example, the Android @@ -2626,7 +2627,7 @@ enum VehicleProperty : int32_t { * int32[5]: 0 // current user flags (none) * int32[6]: 3 // number of users * int32[7]: 0 // 1st user (user 0) - * int32[8]: 0 // 1st user flags (none) + * int32[8]: 1 // 1st user flags (SYSTEM) * int32[9]: 10 // 2nd user (user 10) * int32[10]: 0 // 2nd user flags (none) * int32[11]: 11 // 3rd user (user 11) @@ -2660,7 +2661,7 @@ enum VehicleProperty : int32_t { * identified the user as A. * * The HAL makes this request by a property change event (passing a negative request id), and - * the Android system will response by issuye an ANDROID_POST_SWITCH call which the same + * the Android system will response by issue an ANDROID_POST_SWITCH call which the same * request id. * * For example, if the current foreground Android user is 10 and the HAL asked it to switch to @@ -2704,7 +2705,7 @@ enum VehicleProperty : int32_t { * in the response are different (as the current user didn't change to the target). * 3. If a new switch request is made before the HAL responded to the previous one or before * the user was unlocked, then the ANDROID_POST_SWITCH request is not made. For example, - * the driver could accidentally switch to the wrong user which has lock crentials, then + * the driver could accidentally switch to the wrong user which has lock credentials, then * switch to the right one before entering the credentials. * * The HAL can update its internal state once it receives this request, but it doesn't need to @@ -4389,16 +4390,16 @@ struct InitialUserInfoResponse { */ UserInfo userToSwitchOrCreate; - /** - * Name of the user that should be created. - */ - string userNameToCreate; - /** * System locales of the initial user (value will be passed as-is to * android.provider.Settings.System.SYSTEM_LOCALES) */ string userLocales; + + /** + * Name of the user that should be created. + */ + string userNameToCreate; }; /** From fffbdfa1eb984b7596cbeaa64569f7f495e20f89 Mon Sep 17 00:00:00 2001 From: Jordan Liu Date: Tue, 23 Jun 2020 16:11:48 -0700 Subject: [PATCH 53/62] Override gtest timeout and add logging Note that this just increases the gtest time to match our highest wait times. Each test still has wait times fitted for the expected length of that test. Bug: 159289514 Test: atest VtsHalRadioV1_0TargetTest Change-Id: I0825305258bae20ea6e13e9b9a65ce30b7153611 --- .../radio_hidl_hal_cell_broadcast.cpp | 13 +++ .../vts/functional/radio_hidl_hal_data.cpp | 15 +++ .../1.0/vts/functional/radio_hidl_hal_icc.cpp | 31 +++++++ .../vts/functional/radio_hidl_hal_misc.cpp | 91 +++++++++++++++++++ .../1.0/vts/functional/radio_hidl_hal_sms.cpp | 29 ++++++ .../1.0/vts/functional/radio_hidl_hal_stk.cpp | 11 +++ .../vts/functional/radio_hidl_hal_test.cpp | 4 +- .../vts/functional/radio_hidl_hal_voice.cpp | 51 +++++++++++ radio/1.0/vts/functional/sap_hidl_hal_api.cpp | 17 ++++ .../functional/vts_hal_radio_target_test.xml | 1 + radio/1.1/vts/functional/AndroidTest.xml | 1 + .../1.2/vts/functional/radio_hidl_hal_api.cpp | 2 +- 12 files changed, 264 insertions(+), 2 deletions(-) diff --git a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp index 125ea0cce6..8e6cf860af 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include using namespace ::android::hardware::radio::V1_0; @@ -22,6 +23,7 @@ using namespace ::android::hardware::radio::V1_0; * Test IRadio.setGsmBroadcastConfig() for the response returned. */ TEST_P(RadioHidlTest, setGsmBroadcastConfig) { + LOG(DEBUG) << "setGsmBroadcastConfig"; serial = GetRandomSerialNumber(); // Create GsmBroadcastSmsConfigInfo #1 @@ -79,12 +81,14 @@ TEST_P(RadioHidlTest, setGsmBroadcastConfig) { RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setGsmBroadcastConfig finished"; } /* * Test IRadio.getGsmBroadcastConfig() for the response returned. */ TEST_P(RadioHidlTest, getGsmBroadcastConfig) { + LOG(DEBUG) << "getGsmBroadcastConfig"; serial = GetRandomSerialNumber(); radio->getGsmBroadcastConfig(serial); @@ -99,12 +103,14 @@ TEST_P(RadioHidlTest, getGsmBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getGsmBroadcastConfig finished"; } /* * Test IRadio.setCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioHidlTest, setCdmaBroadcastConfig) { + LOG(DEBUG) << "setCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); CdmaBroadcastSmsConfigInfo cbSmsConfig; @@ -126,12 +132,14 @@ TEST_P(RadioHidlTest, setCdmaBroadcastConfig) { {RadioError::NONE, RadioError::INVALID_MODEM_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setCdmaBroadcastConfig finished"; } /* * Test IRadio.getCdmaBroadcastConfig() for the response returned. */ TEST_P(RadioHidlTest, getCdmaBroadcastConfig) { + LOG(DEBUG) << "getCdmaBroadcastConfig"; serial = GetRandomSerialNumber(); radio->getCdmaBroadcastConfig(serial); @@ -144,12 +152,14 @@ TEST_P(RadioHidlTest, getCdmaBroadcastConfig) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getCdmaBroadcastConfig finished"; } /* * Test IRadio.setCdmaBroadcastActivation() for the response returned. */ TEST_P(RadioHidlTest, setCdmaBroadcastActivation) { + LOG(DEBUG) << "setCdmaBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -164,12 +174,14 @@ TEST_P(RadioHidlTest, setCdmaBroadcastActivation) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setCdmaBroadcastActivation finished"; } /* * Test IRadio.setGsmBroadcastActivation() for the response returned. */ TEST_P(RadioHidlTest, setGsmBroadcastActivation) { + LOG(DEBUG) << "setGsmBroadcastActivation"; serial = GetRandomSerialNumber(); bool activate = false; @@ -186,4 +198,5 @@ TEST_P(RadioHidlTest, setGsmBroadcastActivation) { RadioError::INVALID_STATE, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setGsmBroadcastActivation finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp index d937d74403..e3ee9d4ff3 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include using namespace ::android::hardware::radio::V1_0; @@ -22,6 +23,7 @@ using namespace ::android::hardware::radio::V1_0; * Test IRadio.getDataRegistrationState() for the response returned. */ TEST_P(RadioHidlTest, getDataRegistrationState) { + LOG(DEBUG) << "getDataRegistrationState"; serial = GetRandomSerialNumber(); radio->getDataRegistrationState(serial); @@ -94,12 +96,14 @@ TEST_P(RadioHidlTest, getDataRegistrationState) { } } } + LOG(DEBUG) << "getDataRegistrationState finished"; } /* * Test IRadio.setupDataCall() for the response returned. */ TEST_P(RadioHidlTest, setupDataCall) { + LOG(DEBUG) << "setupDataCall"; serial = GetRandomSerialNumber(); RadioTechnology radioTechnology = RadioTechnology::LTE; @@ -142,12 +146,14 @@ TEST_P(RadioHidlTest, setupDataCall) { RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT}, CHECK_OEM_ERROR)); } + LOG(DEBUG) << "setupDataCall finished"; } /* * Test IRadio.deactivateDataCall() for the response returned. */ TEST_P(RadioHidlTest, deactivateDataCall) { + LOG(DEBUG) << "deactivateDataCall"; serial = GetRandomSerialNumber(); int cid = 1; bool reasonRadioShutDown = false; @@ -164,12 +170,14 @@ TEST_P(RadioHidlTest, deactivateDataCall) { RadioError::SIM_ABSENT, RadioError::INVALID_CALL_ID}, CHECK_OEM_ERROR)); } + LOG(DEBUG) << "deactivateDataCall finished"; } /* * Test IRadio.getDataCallList() for the response returned. */ TEST_P(RadioHidlTest, getDataCallList) { + LOG(DEBUG) << "getDataCallList"; serial = GetRandomSerialNumber(); radio->getDataCallList(serial); @@ -183,12 +191,14 @@ TEST_P(RadioHidlTest, getDataCallList) { radioRsp->rspInfo.error, {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "getDataCallList finished"; } /* * Test IRadio.setInitialAttachApn() for the response returned. */ TEST_P(RadioHidlTest, setInitialAttachApn) { + LOG(DEBUG) << "setInitialAttachApn"; serial = GetRandomSerialNumber(); DataProfileInfo dataProfileInfo; @@ -226,12 +236,14 @@ TEST_P(RadioHidlTest, setInitialAttachApn) { RadioError::SUBSCRIPTION_NOT_AVAILABLE}, CHECK_OEM_ERROR)); } + LOG(DEBUG) << "setInitialAttachApn finished"; } /* * Test IRadio.setDataAllowed() for the response returned. */ TEST_P(RadioHidlTest, setDataAllowed) { + LOG(DEBUG) << "setDataAllowed"; serial = GetRandomSerialNumber(); bool allow = true; @@ -244,12 +256,14 @@ TEST_P(RadioHidlTest, setDataAllowed) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "setDataAllowed finished"; } /* * Test IRadio.setDataProfile() for the response returned. */ TEST_P(RadioHidlTest, setDataProfile) { + LOG(DEBUG) << "setDataProfile"; serial = GetRandomSerialNumber(); // Create a dataProfileInfo @@ -289,4 +303,5 @@ TEST_P(RadioHidlTest, setDataProfile) { {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setDataProfile finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp index 9568524f4f..8a977a91e1 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp @@ -14,22 +14,26 @@ * limitations under the License. */ +#include #include /* * Test IRadio.getIccCardStatus() for the response returned. */ TEST_P(RadioHidlTest, getIccCardStatus) { + LOG(DEBUG) << "getIccCardStatus"; EXPECT_LE(cardStatus.applications.size(), (unsigned int)RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS); EXPECT_LT(cardStatus.imsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS); + LOG(DEBUG) << "getIccCardStatus finished"; } /* * Test IRadio.supplyIccPinForApp() for the response returned */ TEST_P(RadioHidlTest, supplyIccPinForApp) { + LOG(DEBUG) << "supplyIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -49,12 +53,14 @@ TEST_P(RadioHidlTest, supplyIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } + LOG(DEBUG) << "supplyIccPinForApp finished"; } /* * Test IRadio.supplyIccPukForApp() for the response returned. */ TEST_P(RadioHidlTest, supplyIccPukForApp) { + LOG(DEBUG) << "supplyIccPukForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -73,12 +79,14 @@ TEST_P(RadioHidlTest, supplyIccPukForApp) { RadioError::INVALID_SIM_STATE})); } } + LOG(DEBUG) << "supplyIccPukForApp finished"; } /* * Test IRadio.supplyIccPin2ForApp() for the response returned. */ TEST_P(RadioHidlTest, supplyIccPin2ForApp) { + LOG(DEBUG) << "supplyIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -99,12 +107,14 @@ TEST_P(RadioHidlTest, supplyIccPin2ForApp) { RadioError::SIM_PUK2})); } } + LOG(DEBUG) << "supplyIccPin2ForApp finished"; } /* * Test IRadio.supplyIccPuk2ForApp() for the response returned. */ TEST_P(RadioHidlTest, supplyIccPuk2ForApp) { + LOG(DEBUG) << "supplyIccPuk2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -123,12 +133,14 @@ TEST_P(RadioHidlTest, supplyIccPuk2ForApp) { RadioError::INVALID_SIM_STATE})); } } + LOG(DEBUG) << "supplyIccPuk2ForApp finished"; } /* * Test IRadio.changeIccPinForApp() for the response returned. */ TEST_P(RadioHidlTest, changeIccPinForApp) { + LOG(DEBUG) << "changeIccPinForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -148,12 +160,14 @@ TEST_P(RadioHidlTest, changeIccPinForApp) { {RadioError::PASSWORD_INCORRECT, RadioError::REQUEST_NOT_SUPPORTED})); } } + LOG(DEBUG) << "changeIccPinForApp finished"; } /* * Test IRadio.changeIccPin2ForApp() for the response returned. */ TEST_P(RadioHidlTest, changeIccPin2ForApp) { + LOG(DEBUG) << "changeIccPin2ForApp"; serial = GetRandomSerialNumber(); // Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and @@ -174,6 +188,7 @@ TEST_P(RadioHidlTest, changeIccPin2ForApp) { RadioError::SIM_PUK2})); } } + LOG(DEBUG) << "changeIccPin2ForApp finished"; } /* @@ -182,6 +197,7 @@ TEST_P(RadioHidlTest, changeIccPin2ForApp) { * Test IRadio.getImsiForApp() for the response returned. */ TEST_P(RadioHidlTest, DISABLED_getImsiForApp) { + LOG(DEBUG) << "DISABLED_getImsiForApp"; serial = GetRandomSerialNumber(); // Check success returned while getting imsi for 3GPP and 3GPP2 apps only @@ -205,12 +221,14 @@ TEST_P(RadioHidlTest, DISABLED_getImsiForApp) { } } } + LOG(DEBUG) << "DISABLED_getImsiForApp finished"; } /* * Test IRadio.iccIOForApp() for the response returned. */ TEST_P(RadioHidlTest, iccIOForApp) { + LOG(DEBUG) << "iccIOForApp"; serial = GetRandomSerialNumber(); for (int i = 0; i < (int)cardStatus.applications.size(); i++) { @@ -230,12 +248,14 @@ TEST_P(RadioHidlTest, iccIOForApp) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); EXPECT_EQ(serial, radioRsp->rspInfo.serial); } + LOG(DEBUG) << "iccIOForApp finished"; } /* * Test IRadio.iccTransmitApduBasicChannel() for the response returned. */ TEST_P(RadioHidlTest, iccTransmitApduBasicChannel) { + LOG(DEBUG) << "iccTransmitApduBasicChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -247,12 +267,14 @@ TEST_P(RadioHidlTest, iccTransmitApduBasicChannel) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); // TODO(sanketpadawe): Add test for error code + LOG(DEBUG) << "iccTransmitApduBasicChannel finished"; } /* * Test IRadio.iccOpenLogicalChannel() for the response returned. */ TEST_P(RadioHidlTest, iccOpenLogicalChannel) { + LOG(DEBUG) << "iccOpenLogicalChannel"; serial = GetRandomSerialNumber(); int p2 = 0x04; // Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested. @@ -262,12 +284,14 @@ TEST_P(RadioHidlTest, iccOpenLogicalChannel) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type); } + LOG(DEBUG) << "iccOpenLogicalChannel finished"; } /* * Test IRadio.iccCloseLogicalChannel() for the response returned. */ TEST_P(RadioHidlTest, iccCloseLogicalChannel) { + LOG(DEBUG) << "iccCloseLogicalChannel"; serial = GetRandomSerialNumber(); // Try closing invalid channel and check INVALID_ARGUMENTS returned as error radio->iccCloseLogicalChannel(serial, 0); @@ -276,12 +300,14 @@ TEST_P(RadioHidlTest, iccCloseLogicalChannel) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error); + LOG(DEBUG) << "iccCloseLogicalChannel finished"; } /* * Test IRadio.iccTransmitApduLogicalChannel() for the response returned. */ TEST_P(RadioHidlTest, iccTransmitApduLogicalChannel) { + LOG(DEBUG) << "iccTransmitApduLogicalChannel"; serial = GetRandomSerialNumber(); SimApdu msg; memset(&msg, 0, sizeof(msg)); @@ -293,12 +319,14 @@ TEST_P(RadioHidlTest, iccTransmitApduLogicalChannel) { EXPECT_EQ(serial, radioRsp->rspInfo.serial); // TODO(sanketpadawe): Add test for error code + LOG(DEBUG) << "iccTransmitApduLogicalChannel finished"; } /* * Test IRadio.requestIccSimAuthentication() for the response returned. */ TEST_P(RadioHidlTest, requestIccSimAuthentication) { + LOG(DEBUG) << "requestIccSimAuthentication"; serial = GetRandomSerialNumber(); // Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS @@ -312,12 +340,14 @@ TEST_P(RadioHidlTest, requestIccSimAuthentication) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "requestIccSimAuthentication finished"; } /* * Test IRadio.supplyNetworkDepersonalization() for the response returned. */ TEST_P(RadioHidlTest, supplyNetworkDepersonalization) { + LOG(DEBUG) << "supplyNetworkDepersonalization"; serial = GetRandomSerialNumber(); radio->supplyNetworkDepersonalization(serial, hidl_string("test")); @@ -332,4 +362,5 @@ TEST_P(RadioHidlTest, supplyNetworkDepersonalization) { RadioError::INVALID_SIM_STATE, RadioError::MODEM_ERR, RadioError::NO_MEMORY, RadioError::PASSWORD_INCORRECT, RadioError::SIM_ABSENT, RadioError::SYSTEM_ERR})); } + LOG(DEBUG) << "supplyNetworkDepersonalization finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp index 7228fb086b..3f964732f6 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp @@ -14,12 +14,14 @@ * limitations under the License. */ +#include #include /* * Test IRadio.getSignalStrength() for the response returned. */ TEST_P(RadioHidlTest, getSignalStrength) { + LOG(DEBUG) << "getSignalStrength"; serial = GetRandomSerialNumber(); radio->getSignalStrength(serial); @@ -30,12 +32,14 @@ TEST_P(RadioHidlTest, getSignalStrength) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getSignalStrength finished"; } /* * Test IRadio.getVoiceRegistrationState() for the response returned. */ TEST_P(RadioHidlTest, getVoiceRegistrationState) { + LOG(DEBUG) << "getVoiceRegistrationState"; serial = GetRandomSerialNumber(); radio->getVoiceRegistrationState(serial); @@ -46,12 +50,14 @@ TEST_P(RadioHidlTest, getVoiceRegistrationState) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getVoiceRegistrationState finished"; } /* * Test IRadio.getOperator() for the response returned. */ TEST_P(RadioHidlTest, getOperator) { + LOG(DEBUG) << "getOperator"; serial = GetRandomSerialNumber(); radio->getOperator(serial); @@ -62,12 +68,14 @@ TEST_P(RadioHidlTest, getOperator) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getOperator finished"; } /* * Test IRadio.setRadioPower() for the response returned. */ TEST_P(RadioHidlTest, setRadioPower) { + LOG(DEBUG) << "setRadioPower"; serial = GetRandomSerialNumber(); radio->setRadioPower(serial, 1); @@ -78,12 +86,14 @@ TEST_P(RadioHidlTest, setRadioPower) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "setRadioPower finished"; } /* * Test IRadio.getNetworkSelectionMode() for the response returned. */ TEST_P(RadioHidlTest, getNetworkSelectionMode) { + LOG(DEBUG) << "getNetworkSelectionMode"; serial = GetRandomSerialNumber(); radio->getNetworkSelectionMode(serial); @@ -94,12 +104,14 @@ TEST_P(RadioHidlTest, getNetworkSelectionMode) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getNetworkSelectionMode finished"; } /* * Test IRadio.setNetworkSelectionModeAutomatic() for the response returned. */ TEST_P(RadioHidlTest, setNetworkSelectionModeAutomatic) { + LOG(DEBUG) << "setNetworkSelectionModeAutomatic"; serial = GetRandomSerialNumber(); radio->setNetworkSelectionModeAutomatic(serial); @@ -113,12 +125,14 @@ TEST_P(RadioHidlTest, setNetworkSelectionModeAutomatic) { {RadioError::NONE, RadioError::ILLEGAL_SIM_OR_ME, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setNetworkSelectionModeAutomatic finished"; } /* * Test IRadio.setNetworkSelectionModeManual() for the response returned. */ TEST_P(RadioHidlTest, setNetworkSelectionModeManual) { + LOG(DEBUG) << "setNetworkSelectionModeManual"; serial = GetRandomSerialNumber(); radio->setNetworkSelectionModeManual(serial, "123456"); @@ -132,12 +146,14 @@ TEST_P(RadioHidlTest, setNetworkSelectionModeManual) { RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setNetworkSelectionModeManual finished"; } /* * Test IRadio.getAvailableNetworks() for the response returned. */ TEST_P(RadioHidlTest, getAvailableNetworks) { + LOG(DEBUG) << "getAvailableNetworks"; serial = GetRandomSerialNumber(); radio->getAvailableNetworks(serial); @@ -153,12 +169,14 @@ TEST_P(RadioHidlTest, getAvailableNetworks) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getAvailableNetworks finished"; } /* * Test IRadio.getBasebandVersion() for the response returned. */ TEST_P(RadioHidlTest, getBasebandVersion) { + LOG(DEBUG) << "getBasebandVersion"; serial = GetRandomSerialNumber(); radio->getBasebandVersion(serial); @@ -169,12 +187,14 @@ TEST_P(RadioHidlTest, getBasebandVersion) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getBasebandVersion finished"; } /* * Test IRadio.setBandMode() for the response returned. */ TEST_P(RadioHidlTest, setBandMode) { + LOG(DEBUG) << "setBandMode"; serial = GetRandomSerialNumber(); radio->setBandMode(serial, RadioBandMode::BAND_MODE_USA); @@ -186,12 +206,14 @@ TEST_P(RadioHidlTest, setBandMode) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setBandMode finished"; } /* * Test IRadio.getAvailableBandModes() for the response returned. */ TEST_P(RadioHidlTest, getAvailableBandModes) { + LOG(DEBUG) << "getAvailableBandModes"; serial = GetRandomSerialNumber(); radio->getAvailableBandModes(serial); @@ -202,12 +224,14 @@ TEST_P(RadioHidlTest, getAvailableBandModes) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getAvailableBandModes finished"; } /* * Test IRadio.setPreferredNetworkType() for the response returned. */ TEST_P(RadioHidlTest, setPreferredNetworkType) { + LOG(DEBUG) << "setPreferredNetworkType"; serial = GetRandomSerialNumber(); radio->setPreferredNetworkType(serial, PreferredNetworkType::GSM_ONLY); @@ -219,12 +243,14 @@ TEST_P(RadioHidlTest, setPreferredNetworkType) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setPreferredNetworkType finished"; } /* * Test IRadio.getPreferredNetworkType() for the response returned. */ TEST_P(RadioHidlTest, getPreferredNetworkType) { + LOG(DEBUG) << "getPreferredNetworkType"; serial = GetRandomSerialNumber(); radio->getPreferredNetworkType(serial); @@ -235,12 +261,14 @@ TEST_P(RadioHidlTest, getPreferredNetworkType) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getPreferredNetworkType finished"; } /* * Test IRadio.getNeighboringCids() for the response returned. */ TEST_P(RadioHidlTest, getNeighboringCids) { + LOG(DEBUG) << "getNeighboringCids"; serial = GetRandomSerialNumber(); radio->getNeighboringCids(serial); @@ -253,12 +281,14 @@ TEST_P(RadioHidlTest, getNeighboringCids) { {RadioError::NONE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getNeighboringCids finished"; } /* * Test IRadio.setLocationUpdates() for the response returned. */ TEST_P(RadioHidlTest, setLocationUpdates) { + LOG(DEBUG) << "setLocationUpdates"; serial = GetRandomSerialNumber(); radio->setLocationUpdates(serial, true); @@ -270,12 +300,14 @@ TEST_P(RadioHidlTest, setLocationUpdates) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "setLocationUpdates finished"; } /* * Test IRadio.setCdmaRoamingPreference() for the response returned. */ TEST_P(RadioHidlTest, setCdmaRoamingPreference) { + LOG(DEBUG) << "setCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK); @@ -288,12 +320,14 @@ TEST_P(RadioHidlTest, setCdmaRoamingPreference) { radioRsp->rspInfo.error, {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setCdmaRoamingPreference finished"; } /* * Test IRadio.getCdmaRoamingPreference() for the response returned. */ TEST_P(RadioHidlTest, getCdmaRoamingPreference) { + LOG(DEBUG) << "getCdmaRoamingPreference"; serial = GetRandomSerialNumber(); radio->getCdmaRoamingPreference(serial); @@ -307,12 +341,14 @@ TEST_P(RadioHidlTest, getCdmaRoamingPreference) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getCdmaRoamingPreference finished"; } /* * Test IRadio.getTTYMode() for the response returned. */ TEST_P(RadioHidlTest, getTTYMode) { + LOG(DEBUG) << "getTTYMode"; serial = GetRandomSerialNumber(); radio->getTTYMode(serial); @@ -323,12 +359,14 @@ TEST_P(RadioHidlTest, getTTYMode) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getTTYMode finished"; } /* * Test IRadio.setTTYMode() for the response returned. */ TEST_P(RadioHidlTest, setTTYMode) { + LOG(DEBUG) << "setTTYMode"; serial = GetRandomSerialNumber(); radio->setTTYMode(serial, TtyMode::OFF); @@ -339,12 +377,14 @@ TEST_P(RadioHidlTest, setTTYMode) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "setTTYMode finished"; } /* * Test IRadio.setPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioHidlTest, setPreferredVoicePrivacy) { + LOG(DEBUG) << "setPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio->setPreferredVoicePrivacy(serial, true); @@ -356,12 +396,14 @@ TEST_P(RadioHidlTest, setPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setPreferredVoicePrivacy finished"; } /* * Test IRadio.getPreferredVoicePrivacy() for the response returned. */ TEST_P(RadioHidlTest, getPreferredVoicePrivacy) { + LOG(DEBUG) << "getPreferredVoicePrivacy"; serial = GetRandomSerialNumber(); radio->getPreferredVoicePrivacy(serial); @@ -373,12 +415,14 @@ TEST_P(RadioHidlTest, getPreferredVoicePrivacy) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "getPreferredVoicePrivacy finished"; } /* * Test IRadio.getCDMASubscription() for the response returned. */ TEST_P(RadioHidlTest, getCDMASubscription) { + LOG(DEBUG) << "getCDMASubscription"; serial = GetRandomSerialNumber(); radio->getCDMASubscription(serial); @@ -391,12 +435,14 @@ TEST_P(RadioHidlTest, getCDMASubscription) { radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "getCDMASubscription finished"; } /* * Test IRadio.getDeviceIdentity() for the response returned. */ TEST_P(RadioHidlTest, getDeviceIdentity) { + LOG(DEBUG) << "getDeviceIdentity"; serial = GetRandomSerialNumber(); radio->getDeviceIdentity(serial); @@ -408,12 +454,14 @@ TEST_P(RadioHidlTest, getDeviceIdentity) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::EMPTY_RECORD})); } + LOG(DEBUG) << "getDeviceIdentity finished"; } /* * Test IRadio.exitEmergencyCallbackMode() for the response returned. */ TEST_P(RadioHidlTest, exitEmergencyCallbackMode) { + LOG(DEBUG) << "exitEmergencyCallbackMode"; serial = GetRandomSerialNumber(); radio->exitEmergencyCallbackMode(serial); @@ -426,12 +474,14 @@ TEST_P(RadioHidlTest, exitEmergencyCallbackMode) { radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "exitEmergencyCallbackMode finished"; } /* * Test IRadio.getCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioHidlTest, getCdmaSubscriptionSource) { + LOG(DEBUG) << "getCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio->getCdmaSubscriptionSource(serial); @@ -444,12 +494,14 @@ TEST_P(RadioHidlTest, getCdmaSubscriptionSource) { radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "getCdmaSubscriptionSource finished"; } /* * Test IRadio.setCdmaSubscriptionSource() for the response returned. */ TEST_P(RadioHidlTest, setCdmaSubscriptionSource) { + LOG(DEBUG) << "setCdmaSubscriptionSource"; serial = GetRandomSerialNumber(); radio->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM); @@ -463,12 +515,14 @@ TEST_P(RadioHidlTest, setCdmaSubscriptionSource) { {RadioError::NONE, RadioError::SIM_ABSENT, RadioError::SUBSCRIPTION_NOT_AVAILABLE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setCdmaSubscriptionSource finished"; } /* * Test IRadio.getVoiceRadioTechnology() for the response returned. */ TEST_P(RadioHidlTest, getVoiceRadioTechnology) { + LOG(DEBUG) << "getVoiceRadioTechnology"; serial = GetRandomSerialNumber(); radio->getVoiceRadioTechnology(serial); @@ -479,12 +533,14 @@ TEST_P(RadioHidlTest, getVoiceRadioTechnology) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getVoiceRadioTechnology finished"; } /* * Test IRadio.getCellInfoList() for the response returned. */ TEST_P(RadioHidlTest, getCellInfoList) { + LOG(DEBUG) << "getCellInfoList"; serial = GetRandomSerialNumber(); radio->getCellInfoList(serial); @@ -497,12 +553,14 @@ TEST_P(RadioHidlTest, getCellInfoList) { {RadioError::NONE, RadioError::NO_NETWORK_FOUND}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getCellInfoList finished"; } /* * Test IRadio.setCellInfoListRate() for the response returned. */ TEST_P(RadioHidlTest, setCellInfoListRate) { + LOG(DEBUG) << "setCellInfoListRate"; serial = GetRandomSerialNumber(); // TODO(sanketpadawe): RIL crashes with value of rate = 10 @@ -515,12 +573,14 @@ TEST_P(RadioHidlTest, setCellInfoListRate) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setCellInfoListRate finished"; } /* * Test IRadio.nvReadItem() for the response returned. */ TEST_P(RadioHidlTest, nvReadItem) { + LOG(DEBUG) << "nvReadItem"; serial = GetRandomSerialNumber(); radio->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25); @@ -532,12 +592,14 @@ TEST_P(RadioHidlTest, nvReadItem) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "nvReadItem finished"; } /* * Test IRadio.nvWriteItem() for the response returned. */ TEST_P(RadioHidlTest, nvWriteItem) { + LOG(DEBUG) << "nvWriteItem"; serial = GetRandomSerialNumber(); NvWriteItem item; memset(&item, 0, sizeof(item)); @@ -552,12 +614,14 @@ TEST_P(RadioHidlTest, nvWriteItem) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "nvWriteItem finished"; } /* * Test IRadio.nvWriteCdmaPrl() for the response returned. */ TEST_P(RadioHidlTest, nvWriteCdmaPrl) { + LOG(DEBUG) << "nvWriteCdmaPrl"; serial = GetRandomSerialNumber(); std::vector prl = {1, 2, 3, 4, 5}; @@ -570,12 +634,14 @@ TEST_P(RadioHidlTest, nvWriteCdmaPrl) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "nvWriteCdmaPrl finished"; } /* * Test IRadio.nvResetConfig() for the response returned. */ TEST_P(RadioHidlTest, nvResetConfig) { + LOG(DEBUG) << "nvResetConfig"; serial = GetRandomSerialNumber(); radio->nvResetConfig(serial, ResetNvType::FACTORY_RESET); @@ -587,12 +653,14 @@ TEST_P(RadioHidlTest, nvResetConfig) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "nvResetConfig finished"; } /* * Test IRadio.setUiccSubscription() for the response returned. */ TEST_P(RadioHidlTest, setUiccSubscription) { + LOG(DEBUG) << "setUiccSubscription"; serial = GetRandomSerialNumber(); SelectUiccSub item; memset(&item, 0, sizeof(item)); @@ -609,12 +677,14 @@ TEST_P(RadioHidlTest, setUiccSubscription) { RadioError::MODEM_ERR, RadioError::SUBSCRIPTION_NOT_SUPPORTED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setUiccSubscription finished"; } /* * Test IRadio.getHardwareConfig() for the response returned. */ TEST_P(RadioHidlTest, getHardwareConfig) { + LOG(DEBUG) << "getHardwareConfig"; serial = GetRandomSerialNumber(); radio->getHardwareConfig(serial); @@ -626,6 +696,7 @@ TEST_P(RadioHidlTest, getHardwareConfig) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getHardwareConfig finished"; } /* @@ -651,6 +722,7 @@ TEST_P(RadioHidlTest, DISABLED_requestShutdown) { * Test IRadio.getRadioCapability() for the response returned. */ TEST_P(RadioHidlTest, getRadioCapability) { + LOG(DEBUG) << "getRadioCapability"; serial = GetRandomSerialNumber(); radio->getRadioCapability(serial); @@ -661,12 +733,14 @@ TEST_P(RadioHidlTest, getRadioCapability) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getRadioCapability finished"; } /* * Test IRadio.setRadioCapability() for the response returned. */ TEST_P(RadioHidlTest, setRadioCapability) { + LOG(DEBUG) << "setRadioCapability"; serial = GetRandomSerialNumber(); RadioCapability rc; memset(&rc, 0, sizeof(rc)); @@ -682,12 +756,14 @@ TEST_P(RadioHidlTest, setRadioCapability) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setRadioCapability finished"; } /* * Test IRadio.startLceService() for the response returned. */ TEST_P(RadioHidlTest, startLceService) { + LOG(DEBUG) << "startLceService"; serial = GetRandomSerialNumber(); radio->startLceService(serial, 5, true); @@ -701,12 +777,14 @@ TEST_P(RadioHidlTest, startLceService) { {RadioError::INTERNAL_ERR, RadioError::LCE_NOT_SUPPORTED, RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT, RadioError::NONE})); } + LOG(DEBUG) << "startLceService finished"; } /* * Test IRadio.stopLceService() for the response returned. */ TEST_P(RadioHidlTest, stopLceService) { + LOG(DEBUG) << "stopLceService"; serial = GetRandomSerialNumber(); radio->stopLceService(serial); @@ -719,12 +797,14 @@ TEST_P(RadioHidlTest, stopLceService) { {RadioError::NONE, RadioError::LCE_NOT_SUPPORTED, RadioError::REQUEST_NOT_SUPPORTED, RadioError::SIM_ABSENT})); } + LOG(DEBUG) << "stopLceService finished"; } /* * Test IRadio.pullLceData() for the response returned. */ TEST_P(RadioHidlTest, pullLceData) { + LOG(DEBUG) << "pullLceData"; serial = GetRandomSerialNumber(); radio->pullLceData(serial); @@ -738,12 +818,14 @@ TEST_P(RadioHidlTest, pullLceData) { RadioError::RADIO_NOT_AVAILABLE, RadioError::SIM_ABSENT}, CHECK_OEM_ERROR)); } + LOG(DEBUG) << "pullLceData finished"; } /* * Test IRadio.getModemActivityInfo() for the response returned. */ TEST_P(RadioHidlTest, getModemActivityInfo) { + LOG(DEBUG) << "getModemActivityInfo"; serial = GetRandomSerialNumber(); radio->getModemActivityInfo(serial); @@ -755,6 +837,7 @@ TEST_P(RadioHidlTest, getModemActivityInfo) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "getModemActivityInfo finished"; } /* @@ -840,6 +923,7 @@ TEST_P(RadioHidlTest, DISABLED_setAllowedCarriers) { * Test IRadio.getAllowedCarriers() for the response returned. */ TEST_P(RadioHidlTest, getAllowedCarriers) { + LOG(DEBUG) << "getAllowedCarriers"; serial = GetRandomSerialNumber(); radio->getAllowedCarriers(serial); @@ -851,12 +935,14 @@ TEST_P(RadioHidlTest, getAllowedCarriers) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "getAllowedCarriers finished"; } /* * Test IRadio.sendDeviceState() for the response returned. */ TEST_P(RadioHidlTest, sendDeviceState) { + LOG(DEBUG) << "sendDeviceState"; serial = GetRandomSerialNumber(); radio->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true); @@ -870,12 +956,14 @@ TEST_P(RadioHidlTest, sendDeviceState) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "sendDeviceState finished"; } /* * Test IRadio.setIndicationFilter() for the response returned. */ TEST_P(RadioHidlTest, setIndicationFilter) { + LOG(DEBUG) << "setIndicationFilter"; serial = GetRandomSerialNumber(); radio->setIndicationFilter(serial, 1); @@ -889,12 +977,14 @@ TEST_P(RadioHidlTest, setIndicationFilter) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setIndicationFilter finished"; } /* * Test IRadio.setSimCardPower() for the response returned. */ TEST_P(RadioHidlTest, setSimCardPower) { + LOG(DEBUG) << "setSimCardPower"; serial = GetRandomSerialNumber(); radio->setSimCardPower(serial, true); @@ -906,4 +996,5 @@ TEST_P(RadioHidlTest, setSimCardPower) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED})); } + LOG(DEBUG) << "setSimCardPower finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp index 58c3bbd7de..0807deec2d 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include using namespace ::android::hardware::radio::V1_0; @@ -22,6 +23,7 @@ using namespace ::android::hardware::radio::V1_0; * Test IRadio.sendSms() for the response returned. */ TEST_P(RadioHidlTest, sendSms) { + LOG(DEBUG) << "sendSms"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -40,12 +42,14 @@ TEST_P(RadioHidlTest, sendSms) { CHECK_GENERAL_ERROR)); EXPECT_EQ(0, radioRsp->sendSmsResult.errorCode); } + LOG(DEBUG) << "sendSms finished"; } /* * Test IRadio.sendSMSExpectMore() for the response returned. */ TEST_P(RadioHidlTest, sendSMSExpectMore) { + LOG(DEBUG) << "sendSMSExpectMore"; serial = GetRandomSerialNumber(); GsmSmsMessage msg; msg.smscPdu = ""; @@ -66,12 +70,14 @@ TEST_P(RadioHidlTest, sendSMSExpectMore) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendSMSExpectMore finished"; } /* * Test IRadio.acknowledgeLastIncomingGsmSms() for the response returned. */ TEST_P(RadioHidlTest, acknowledgeLastIncomingGsmSms) { + LOG(DEBUG) << "acknowledgeLastIncomingGsmSms"; serial = GetRandomSerialNumber(); bool success = true; @@ -87,12 +93,14 @@ TEST_P(RadioHidlTest, acknowledgeLastIncomingGsmSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "acknowledgeLastIncomingGsmSms finished"; } /* * Test IRadio.acknowledgeIncomingGsmSmsWithPdu() for the response returned. */ TEST_P(RadioHidlTest, acknowledgeIncomingGsmSmsWithPdu) { + LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu"; serial = GetRandomSerialNumber(); bool success = true; std::string ackPdu = ""; @@ -106,12 +114,14 @@ TEST_P(RadioHidlTest, acknowledgeIncomingGsmSmsWithPdu) { if (cardStatus.cardState == CardState::ABSENT) { // TODO(shuoq): Will add error check when we know the expected error from QC } + LOG(DEBUG) << "acknowledgeIncomingGsmSmsWithPdu finished"; } /* * Test IRadio.sendCdmaSms() for the response returned. */ TEST_P(RadioHidlTest, sendCdmaSms) { + LOG(DEBUG) << "sendCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -150,12 +160,14 @@ TEST_P(RadioHidlTest, sendCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendCdmaSms finished"; } /* * Test IRadio.acknowledgeLastIncomingCdmaSms() for the response returned. */ TEST_P(RadioHidlTest, acknowledgeLastIncomingCdmaSms) { + LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAck @@ -174,12 +186,14 @@ TEST_P(RadioHidlTest, acknowledgeLastIncomingCdmaSms) { {RadioError::INVALID_ARGUMENTS, RadioError::NO_SMS_TO_ACK}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "acknowledgeLastIncomingCdmaSms finished"; } /* * Test IRadio.sendImsSms() for the response returned. */ TEST_P(RadioHidlTest, sendImsSms) { + LOG(DEBUG) << "sendImsSms"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -224,12 +238,14 @@ TEST_P(RadioHidlTest, sendImsSms) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendImsSms finished"; } /* * Test IRadio.getSmscAddress() for the response returned. */ TEST_P(RadioHidlTest, getSmscAddress) { + LOG(DEBUG) << "getSmscAddress"; serial = GetRandomSerialNumber(); radio->getSmscAddress(serial); @@ -244,12 +260,14 @@ TEST_P(RadioHidlTest, getSmscAddress) { {RadioError::INVALID_MODEM_STATE, RadioError::INVALID_STATE, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getSmscAddress finished"; } /* * Test IRadio.setSmscAddress() for the response returned. */ TEST_P(RadioHidlTest, setSmscAddress) { + LOG(DEBUG) << "setSmscAddress"; serial = GetRandomSerialNumber(); hidl_string address = hidl_string("smscAddress"); @@ -265,12 +283,14 @@ TEST_P(RadioHidlTest, setSmscAddress) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_SMS_FORMAT, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setSmscAddress finished"; } /* * Test IRadio.writeSmsToSim() for the response returned. */ TEST_P(RadioHidlTest, writeSmsToSim) { + LOG(DEBUG) << "writeSmsToSim"; serial = GetRandomSerialNumber(); SmsWriteArgs smsWriteArgs; smsWriteArgs.status = SmsWriteArgsStatus::REC_UNREAD; @@ -291,12 +311,14 @@ TEST_P(RadioHidlTest, writeSmsToSim) { RadioError::NO_RESOURCES, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "writeSmsToSim finished"; } /* * Test IRadio.deleteSmsOnSim() for the response returned. */ TEST_P(RadioHidlTest, deleteSmsOnSim) { + LOG(DEBUG) << "deleteSmsOnSim"; serial = GetRandomSerialNumber(); int index = 1; @@ -314,12 +336,14 @@ TEST_P(RadioHidlTest, deleteSmsOnSim) { RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "deleteSmsOnSim finished"; } /* * Test IRadio.writeSmsToRuim() for the response returned. */ TEST_P(RadioHidlTest, writeSmsToRuim) { + LOG(DEBUG) << "writeSmsToRuim"; serial = GetRandomSerialNumber(); // Create a CdmaSmsAddress @@ -365,12 +389,14 @@ TEST_P(RadioHidlTest, writeSmsToRuim) { RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "writeSmsToRuim finished"; } /* * Test IRadio.deleteSmsOnRuim() for the response returned. */ TEST_P(RadioHidlTest, deleteSmsOnRuim) { + LOG(DEBUG) << "deleteSmsOnRuim"; serial = GetRandomSerialNumber(); int index = 1; @@ -416,12 +442,14 @@ TEST_P(RadioHidlTest, deleteSmsOnRuim) { RadioError::MODEM_ERR, RadioError::NO_SUCH_ENTRY, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "deleteSmsOnRuim finished"; } /* * Test IRadio.reportSmsMemoryStatus() for the response returned. */ TEST_P(RadioHidlTest, reportSmsMemoryStatus) { + LOG(DEBUG) << "reportSmsMemoryStatus"; serial = GetRandomSerialNumber(); bool available = true; @@ -437,4 +465,5 @@ TEST_P(RadioHidlTest, reportSmsMemoryStatus) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "reportSmsMemoryStatus finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp index 1170111fba..193c25dcc0 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include using namespace ::android::hardware::radio::V1_0; @@ -22,6 +23,7 @@ using namespace ::android::hardware::radio::V1_0; * Test IRadio.sendEnvelope() for the response returned. */ TEST_P(RadioHidlTest, sendEnvelope) { + LOG(DEBUG) << "sendEnvelope"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -39,12 +41,14 @@ TEST_P(RadioHidlTest, sendEnvelope) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendEnvelope finished"; } /* * Test IRadio.sendTerminalResponseToSim() for the response returned. */ TEST_P(RadioHidlTest, sendTerminalResponseToSim) { + LOG(DEBUG) << "sendTerminalResponseToSim"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -62,12 +66,14 @@ TEST_P(RadioHidlTest, sendTerminalResponseToSim) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendTerminalResponseToSim finished"; } /* * Test IRadio.handleStkCallSetupRequestFromSim() for the response returned. */ TEST_P(RadioHidlTest, handleStkCallSetupRequestFromSim) { + LOG(DEBUG) << "handleStkCallSetupRequestFromSim"; serial = GetRandomSerialNumber(); bool accept = false; @@ -83,12 +89,14 @@ TEST_P(RadioHidlTest, handleStkCallSetupRequestFromSim) { RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "handleStkCallSetupRequestFromSim finished"; } /* * Test IRadio.reportStkServiceIsRunning() for the response returned. */ TEST_P(RadioHidlTest, reportStkServiceIsRunning) { + LOG(DEBUG) << "reportStkServiceIsRunning"; serial = GetRandomSerialNumber(); radio->reportStkServiceIsRunning(serial); @@ -101,6 +109,7 @@ TEST_P(RadioHidlTest, reportStkServiceIsRunning) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "reportStkServiceIsRunning finished"; } /* @@ -108,6 +117,7 @@ TEST_P(RadioHidlTest, reportStkServiceIsRunning) { * string. */ TEST_P(RadioHidlTest, sendEnvelopeWithStatus) { + LOG(DEBUG) << "sendEnvelopeWithStatus"; serial = GetRandomSerialNumber(); // Test with sending empty string @@ -125,4 +135,5 @@ TEST_P(RadioHidlTest, sendEnvelopeWithStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR, RadioError::SIM_ABSENT}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendEnvelopeWithStatus finished"; } diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp index 3c833c0c20..3583514014 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp @@ -14,11 +14,13 @@ * limitations under the License. */ +#include #include void RadioHidlTest::SetUp() { radio = IRadio::getService(GetParam()); if (radio == NULL) { + LOG(DEBUG) << "Radio is NULL, waiting 1 minute to retry"; sleep(60); radio = IRadio::getService(GetParam()); } @@ -70,4 +72,4 @@ void RadioHidlTest::updateSimCardStatus() { serial = GetRandomSerialNumber(); radio->getIccCardStatus(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); -} \ No newline at end of file +} diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp index a192a33a07..f6de2f854a 100644 --- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp +++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp @@ -14,12 +14,14 @@ * limitations under the License. */ +#include #include /* * Test IRadio.getCurrentCalls() for the response returned. */ TEST_P(RadioHidlTest, getCurrentCalls) { + LOG(DEBUG) << "getCurrentCalls"; serial = GetRandomSerialNumber(); radio->getCurrentCalls(serial); @@ -30,12 +32,14 @@ TEST_P(RadioHidlTest, getCurrentCalls) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getCurrentCalls finished"; } /* * Test IRadio.dial() for the response returned. */ TEST_P(RadioHidlTest, dial) { + LOG(DEBUG) << "dial"; serial = GetRandomSerialNumber(); Dial dialInfo; @@ -57,12 +61,14 @@ TEST_P(RadioHidlTest, dial) { RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "dial finished"; } /* * Test IRadio.hangup() for the response returned. */ TEST_P(RadioHidlTest, hangup) { + LOG(DEBUG) << "hangup"; serial = GetRandomSerialNumber(); radio->hangup(serial, 1); @@ -76,12 +82,14 @@ TEST_P(RadioHidlTest, hangup) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "hangup finished"; } /* * Test IRadio.hangupWaitingOrBackground() for the response returned. */ TEST_P(RadioHidlTest, hangupWaitingOrBackground) { + LOG(DEBUG) << "hangupWaitingOrBackground"; serial = GetRandomSerialNumber(); radio->hangupWaitingOrBackground(serial); @@ -94,12 +102,14 @@ TEST_P(RadioHidlTest, hangupWaitingOrBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "hangupWaitingOrBackground finished"; } /* * Test IRadio.hangupForegroundResumeBackground() for the response returned. */ TEST_P(RadioHidlTest, hangupForegroundResumeBackground) { + LOG(DEBUG) << "hangupForegroundResumeBackground"; serial = GetRandomSerialNumber(); radio->hangupForegroundResumeBackground(serial); @@ -112,12 +122,14 @@ TEST_P(RadioHidlTest, hangupForegroundResumeBackground) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "hangupForegroundResumeBackground finished"; } /* * Test IRadio.switchWaitingOrHoldingAndActive() for the response returned. */ TEST_P(RadioHidlTest, switchWaitingOrHoldingAndActive) { + LOG(DEBUG) << "switchWaitingOrHoldingAndActive"; serial = GetRandomSerialNumber(); radio->switchWaitingOrHoldingAndActive(serial); @@ -130,12 +142,14 @@ TEST_P(RadioHidlTest, switchWaitingOrHoldingAndActive) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "switchWaitingOrHoldingAndActive finished"; } /* * Test IRadio.conference() for the response returned. */ TEST_P(RadioHidlTest, conference) { + LOG(DEBUG) << "conference"; serial = GetRandomSerialNumber(); radio->conference(serial); @@ -148,12 +162,14 @@ TEST_P(RadioHidlTest, conference) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "conference finished"; } /* * Test IRadio.rejectCall() for the response returned. */ TEST_P(RadioHidlTest, rejectCall) { + LOG(DEBUG) << "rejectCall"; serial = GetRandomSerialNumber(); radio->rejectCall(serial); @@ -166,12 +182,14 @@ TEST_P(RadioHidlTest, rejectCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "rejectCall finished"; } /* * Test IRadio.getLastCallFailCause() for the response returned. */ TEST_P(RadioHidlTest, getLastCallFailCause) { + LOG(DEBUG) << "getLastCallFailCause"; serial = GetRandomSerialNumber(); radio->getLastCallFailCause(serial); @@ -183,12 +201,14 @@ TEST_P(RadioHidlTest, getLastCallFailCause) { ASSERT_TRUE( CheckAnyOfErrors(radioRsp->rspInfo.error, {RadioError::NONE}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getLastCallFailCause finished"; } /* * Test IRadio.sendUssd() for the response returned. */ TEST_P(RadioHidlTest, sendUssd) { + LOG(DEBUG) << "sendUssd"; serial = GetRandomSerialNumber(); radio->sendUssd(serial, hidl_string("test")); EXPECT_EQ(std::cv_status::no_timeout, wait()); @@ -201,12 +221,14 @@ TEST_P(RadioHidlTest, sendUssd) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendUssd finished"; } /* * Test IRadio.cancelPendingUssd() for the response returned. */ TEST_P(RadioHidlTest, cancelPendingUssd) { + LOG(DEBUG) << "cancelPendingUssd"; serial = GetRandomSerialNumber(); radio->cancelPendingUssd(serial); @@ -220,12 +242,14 @@ TEST_P(RadioHidlTest, cancelPendingUssd) { {RadioError::NONE, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "cancelPendingUssd finished"; } /* * Test IRadio.getCallForwardStatus() for the response returned. */ TEST_P(RadioHidlTest, getCallForwardStatus) { + LOG(DEBUG) << "getCallForwardStatus"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -242,12 +266,14 @@ TEST_P(RadioHidlTest, getCallForwardStatus) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getCallForwardStatus finished"; } /* * Test IRadio.setCallForward() for the response returned. */ TEST_P(RadioHidlTest, setCallForward) { + LOG(DEBUG) << "setCallForward"; serial = GetRandomSerialNumber(); CallForwardInfo callInfo; memset(&callInfo, 0, sizeof(callInfo)); @@ -264,12 +290,14 @@ TEST_P(RadioHidlTest, setCallForward) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setCallForward finished"; } /* * Test IRadio.getCallWaiting() for the response returned. */ TEST_P(RadioHidlTest, getCallWaiting) { + LOG(DEBUG) << "getCallWaiting"; serial = GetRandomSerialNumber(); radio->getCallWaiting(serial, 1); @@ -283,12 +311,14 @@ TEST_P(RadioHidlTest, getCallWaiting) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "getCallWaiting finished"; } /* * Test IRadio.setCallWaiting() for the response returned. */ TEST_P(RadioHidlTest, setCallWaiting) { + LOG(DEBUG) << "setCallWaiting"; serial = GetRandomSerialNumber(); radio->setCallWaiting(serial, true, 1); @@ -302,12 +332,14 @@ TEST_P(RadioHidlTest, setCallWaiting) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setCallWaiting finished"; } /* * Test IRadio.acceptCall() for the response returned. */ TEST_P(RadioHidlTest, acceptCall) { + LOG(DEBUG) << "acceptCall"; serial = GetRandomSerialNumber(); radio->acceptCall(serial); @@ -320,12 +352,14 @@ TEST_P(RadioHidlTest, acceptCall) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "acceptCall finished"; } /* * Test IRadio.separateConnection() for the response returned. */ TEST_P(RadioHidlTest, separateConnection) { + LOG(DEBUG) << "separateConnection"; serial = GetRandomSerialNumber(); radio->separateConnection(serial, 1); @@ -339,12 +373,14 @@ TEST_P(RadioHidlTest, separateConnection) { {RadioError::INVALID_ARGUMENTS, RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "separateConnection finished"; } /* * Test IRadio.explicitCallTransfer() for the response returned. */ TEST_P(RadioHidlTest, explicitCallTransfer) { + LOG(DEBUG) << "explicitCallTransfer"; serial = GetRandomSerialNumber(); radio->explicitCallTransfer(serial); @@ -357,12 +393,14 @@ TEST_P(RadioHidlTest, explicitCallTransfer) { {RadioError::INVALID_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "explicitCallTransfer finished"; } /* * Test IRadio.sendCDMAFeatureCode() for the response returned. */ TEST_P(RadioHidlTest, sendCDMAFeatureCode) { + LOG(DEBUG) << "sendCDMAFeatureCode"; serial = GetRandomSerialNumber(); radio->sendCDMAFeatureCode(serial, hidl_string()); @@ -377,12 +415,14 @@ TEST_P(RadioHidlTest, sendCDMAFeatureCode) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendCDMAFeatureCode finished"; } /* * Test IRadio.sendDtmf() for the response returned. */ TEST_P(RadioHidlTest, sendDtmf) { + LOG(DEBUG) << "sendDtmf"; serial = GetRandomSerialNumber(); radio->sendDtmf(serial, "1"); @@ -397,12 +437,14 @@ TEST_P(RadioHidlTest, sendDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendDtmf finished"; } /* * Test IRadio.startDtmf() for the response returned. */ TEST_P(RadioHidlTest, startDtmf) { + LOG(DEBUG) << "startDtmf"; serial = GetRandomSerialNumber(); radio->startDtmf(serial, "1"); @@ -417,12 +459,14 @@ TEST_P(RadioHidlTest, startDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "startDtmf finished"; } /* * Test IRadio.stopDtmf() for the response returned. */ TEST_P(RadioHidlTest, stopDtmf) { + LOG(DEBUG) << "stopDtmf"; serial = GetRandomSerialNumber(); radio->stopDtmf(serial); @@ -436,12 +480,14 @@ TEST_P(RadioHidlTest, stopDtmf) { RadioError::INVALID_MODEM_STATE, RadioError::MODEM_ERR}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "stopDtmf finished"; } /* * Test IRadio.setMute() for the response returned. */ TEST_P(RadioHidlTest, setMute) { + LOG(DEBUG) << "setMute"; serial = GetRandomSerialNumber(); radio->setMute(serial, true); @@ -454,12 +500,14 @@ TEST_P(RadioHidlTest, setMute) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "setMute finished"; } /* * Test IRadio.getMute() for the response returned. */ TEST_P(RadioHidlTest, getMute) { + LOG(DEBUG) << "getMute"; serial = GetRandomSerialNumber(); radio->getMute(serial); @@ -470,12 +518,14 @@ TEST_P(RadioHidlTest, getMute) { if (cardStatus.cardState == CardState::ABSENT) { EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error); } + LOG(DEBUG) << "getMute finished"; } /* * Test IRadio.sendBurstDtmf() for the response returned. */ TEST_P(RadioHidlTest, sendBurstDtmf) { + LOG(DEBUG) << "sendBurstDtmf"; serial = GetRandomSerialNumber(); radio->sendBurstDtmf(serial, "1", 0, 0); @@ -489,4 +539,5 @@ TEST_P(RadioHidlTest, sendBurstDtmf) { RadioError::MODEM_ERR, RadioError::OPERATION_NOT_ALLOWED}, CHECK_GENERAL_ERROR)); } + LOG(DEBUG) << "sendBurstDtmf finished"; } diff --git a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp index 6bd2c88a05..6c7870d399 100644 --- a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp +++ b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp @@ -14,12 +14,14 @@ * limitations under the License. */ +#include #include /* * Test ISap.connectReq() for the response returned. */ TEST_P(SapHidlTest, connectReq) { + LOG(DEBUG) << "connectReq"; token = GetRandomSerialNumber(); int32_t maxMsgSize = 100; @@ -30,23 +32,27 @@ TEST_P(SapHidlTest, connectReq) { // Modem side need time for connect to finish. Adding a waiting time to prevent // disconnect being requested right after connect request. sleep(1); + LOG(DEBUG) << "connectReq finished"; } /* * Test IRadio.disconnectReq() for the response returned */ TEST_P(SapHidlTest, disconnectReq) { + LOG(DEBUG) << "disconnectReq"; token = GetRandomSerialNumber(); sap->disconnectReq(token); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(sapCb->sapResponseToken, token); + LOG(DEBUG) << "disconnectReq finished"; } /* * Test IRadio.apduReq() for the response returned. */ TEST_P(SapHidlTest, apduReq) { + LOG(DEBUG) << "apduReq"; token = GetRandomSerialNumber(); SapApduType sapApduType = SapApduType::APDU; android::hardware::hidl_vec command = {}; @@ -59,12 +65,14 @@ TEST_P(SapHidlTest, apduReq) { CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_REMOVED})); + LOG(DEBUG) << "apduReq finished"; } /* * Test IRadio.transferAtrReq() for the response returned. */ TEST_P(SapHidlTest, transferAtrReq) { + LOG(DEBUG) << "transferAtrReq"; token = GetRandomSerialNumber(); sap->transferAtrReq(token); @@ -75,12 +83,14 @@ TEST_P(SapHidlTest, transferAtrReq) { CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED})); + LOG(DEBUG) << "transferAtrReq finished"; } /* * Test IRadio.powerReq() for the response returned. */ TEST_P(SapHidlTest, powerReq) { + LOG(DEBUG) << "powerReq"; token = GetRandomSerialNumber(); bool state = true; @@ -92,12 +102,14 @@ TEST_P(SapHidlTest, powerReq) { sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED, SapResultCode::CARD_ALREADY_POWERED_ON})); + LOG(DEBUG) << "powerReq finished"; } /* * Test IRadio.resetSimReq() for the response returned. */ TEST_P(SapHidlTest, resetSimReq) { + LOG(DEBUG) << "resetSimReq"; token = GetRandomSerialNumber(); sap->resetSimReq(token); @@ -108,12 +120,14 @@ TEST_P(SapHidlTest, resetSimReq) { CheckAnyOfErrors(sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::CARD_NOT_ACCESSSIBLE, SapResultCode::CARD_ALREADY_POWERED_OFF, SapResultCode::CARD_REMOVED})); + LOG(DEBUG) << "resetSimReq finished"; } /* * Test IRadio.transferCardReaderStatusReq() for the response returned. */ TEST_P(SapHidlTest, transferCardReaderStatusReq) { + LOG(DEBUG) << "transferCardReaderStatusReq"; token = GetRandomSerialNumber(); sap->transferCardReaderStatusReq(token); @@ -122,12 +136,14 @@ TEST_P(SapHidlTest, transferCardReaderStatusReq) { ASSERT_TRUE(CheckAnyOfErrors( sapCb->sapResultCode, {SapResultCode::GENERIC_FAILURE, SapResultCode::DATA_NOT_AVAILABLE})); + LOG(DEBUG) << "transferCardReaderStatusReq finished"; } /* * Test IRadio.setTransferProtocolReq() for the response returned. */ TEST_P(SapHidlTest, setTransferProtocolReq) { + LOG(DEBUG) << "setTransferProtocolReq"; token = GetRandomSerialNumber(); SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0; @@ -136,4 +152,5 @@ TEST_P(SapHidlTest, setTransferProtocolReq) { EXPECT_EQ(sapCb->sapResponseToken, token); EXPECT_EQ(SapResultCode::NOT_SUPPORTED, sapCb->sapResultCode); + LOG(DEBUG) << "setTransferProtocolReq finished"; } diff --git a/radio/1.0/vts/functional/vts_hal_radio_target_test.xml b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml index b91119d40a..82af2ee388 100644 --- a/radio/1.0/vts/functional/vts_hal_radio_target_test.xml +++ b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml @@ -30,5 +30,6 @@ diff --git a/radio/1.1/vts/functional/AndroidTest.xml b/radio/1.1/vts/functional/AndroidTest.xml index 3699575223..f1bc7a80ed 100644 --- a/radio/1.1/vts/functional/AndroidTest.xml +++ b/radio/1.1/vts/functional/AndroidTest.xml @@ -29,6 +29,7 @@ diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp index c81a8d9795..acb1b0ef6d 100644 --- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp @@ -735,7 +735,7 @@ TEST_P(RadioHidlTest_v1_2, getDataRegistrationState) { EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_2->rspInfo.type); EXPECT_EQ(serial, radioRsp_v1_2->rspInfo.serial); - ALOGI("getVoiceRegistrationStateResponse_1_2, rspInfo.error = %s\n", + ALOGI("getDataRegistrationStateResponse_1_2, rspInfo.error = %s\n", toString(radioRsp_v1_2->rspInfo.error).c_str()); ASSERT_TRUE(CheckAnyOfErrors( radioRsp_v1_2->rspInfo.error, From f65225671ced6093b4ffeb222b3952924434f23b Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Mon, 29 Jun 2020 09:45:03 -0700 Subject: [PATCH 54/62] Camera: fix the VTS test timeout to be 30min Test: test failure is gone Bug: 159413657 Change-Id: Id1a350081241910463614960c6fdda3d7e32eddc --- camera/provider/2.4/vts/functional/AndroidTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera/provider/2.4/vts/functional/AndroidTest.xml b/camera/provider/2.4/vts/functional/AndroidTest.xml index 05e16394d6..3000c0e3a6 100644 --- a/camera/provider/2.4/vts/functional/AndroidTest.xml +++ b/camera/provider/2.4/vts/functional/AndroidTest.xml @@ -28,6 +28,6 @@ From 5836f407aaaea326fb8a8799019df033eb6f9af0 Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 24 Jun 2020 16:46:43 -0700 Subject: [PATCH 55/62] Update VTS tests to use GeranBands P900 and 850 instead Also call stopNetworkScan to prevent DEVICE_IN_USE error Test: run vts VtsHalRadioV1_4Target, VtsHalRadioV1_5Target Bug: 159582104 Change-Id: If27cb00fe9eb5cf3ce2e73107ed6463c1ebb7cfd --- .../1.4/vts/functional/radio_hidl_hal_api.cpp | 78 +++----- .../vts/functional/radio_hidl_hal_test.cpp | 6 + .../functional/radio_hidl_hal_utils_v1_4.h | 5 +- .../1.5/vts/functional/radio_hidl_hal_api.cpp | 189 ++++++++++++------ .../vts/functional/radio_hidl_hal_test.cpp | 6 + .../functional/radio_hidl_hal_utils_v1_5.h | 3 + 6 files changed, 180 insertions(+), 107 deletions(-) diff --git a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp index e4c0877e45..3ba9b9db9d 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp @@ -18,6 +18,15 @@ #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) +namespace { +const RadioAccessSpecifier GERAN_SPECIFIER_P900 = {.radioAccessNetwork = RadioAccessNetworks::GERAN, + .geranBands = {GeranBands::BAND_P900}, + .channels = {1, 2}}; +const RadioAccessSpecifier GERAN_SPECIFIER_850 = {.radioAccessNetwork = RadioAccessNetworks::GERAN, + .geranBands = {GeranBands::BAND_850}, + .channels = {128, 129}}; +} // namespace + /* * Test IRadio.emergencyDial() for the response returned. */ @@ -199,14 +208,10 @@ TEST_P(RadioHidlTest_v1_4, setPreferredNetworkTypeBitmap) { TEST_P(RadioHidlTest_v1_4, startNetworkScan) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -234,6 +239,11 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan) { {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED, RadioError::REQUEST_NOT_SUPPORTED})); } + + if (radioRsp_v1_4->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* @@ -270,14 +280,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidArgument) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidInterval1) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 4, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -307,14 +313,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidInterval1) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidInterval2) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 301, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -343,14 +345,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidInterval2) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidMaxSearchTime1) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 59, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -379,14 +377,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidMaxSearchTime1) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidMaxSearchTime2) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 3601, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -415,14 +409,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidMaxSearchTime2) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidPeriodicity1) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 600, .incrementalResults = true, .incrementalResultsPeriodicity = 0}; @@ -451,14 +441,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidPeriodicity1) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidPeriodicity2) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, .maxSearchTime = 600, .incrementalResults = true, .incrementalResultsPeriodicity = 11}; @@ -487,14 +473,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_InvalidPeriodicity2) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_GoodRequest1) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, // Some vendor may not support max search time of 360s. // This issue is tracked in b/112205669. .maxSearchTime = 300, @@ -518,6 +500,11 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_GoodRequest1) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } + + if (radioRsp_v1_4->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* @@ -526,14 +513,10 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_GoodRequest1) { TEST_P(RadioHidlTest_v1_4, startNetworkScan_GoodRequest2) { serial = GetRandomSerialNumber(); - RadioAccessSpecifier specifier = {.radioAccessNetwork = RadioAccessNetworks::GERAN, - .geranBands = {GeranBands::BAND_450, GeranBands::BAND_480}, - .channels = {1, 2}}; - ::android::hardware::radio::V1_2::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}, // Some vendor may not support max search time of 360s. // This issue is tracked in b/112205669. .maxSearchTime = 300, @@ -559,6 +542,11 @@ TEST_P(RadioHidlTest_v1_4, startNetworkScan_GoodRequest2) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } + + if (radioRsp_v1_4->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* diff --git a/radio/1.4/vts/functional/radio_hidl_hal_test.cpp b/radio/1.4/vts/functional/radio_hidl_hal_test.cpp index 15a0b24914..4ac6cc9b57 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.4/vts/functional/radio_hidl_hal_test.cpp @@ -107,3 +107,9 @@ void RadioHidlTest_v1_4::updateSimCardStatus() { radio_v1_4->getIccCardStatus(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); } + +void RadioHidlTest_v1_4::stopNetworkScan() { + serial = GetRandomSerialNumber(); + radio_v1_4->stopNetworkScan(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} diff --git a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h index 31b7e13e29..53a584545c 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h +++ b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h @@ -721,7 +721,10 @@ class RadioHidlTest_v1_4 : public ::testing::TestWithParam { /* Update Sim Card Status */ void updateSimCardStatus(); - public: + /* Stop Network Scan Command */ + void stopNetworkScan(); + + public: virtual void SetUp() override; /* Used as a mechanism to inform the test about data/event callback */ diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp index 32c02cb137..bf505b4465 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp @@ -502,15 +502,21 @@ TEST_P(RadioHidlTest_v1_5, areUiccApplicationsEnabled) { TEST_P(RadioHidlTest_v1_5, setSystemSelectionChannels_1_5) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; - Return res = radio_v1_5->setSystemSelectionChannels_1_5(serial, true, {specifier}); + Return res = + radio_v1_5->setSystemSelectionChannels_1_5(serial, true, {specifierP900, specifier850}); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type); @@ -523,7 +529,8 @@ TEST_P(RadioHidlTest_v1_5, setSystemSelectionChannels_1_5) { if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) { serial = GetRandomSerialNumber(); - Return res = radio_v1_5->setSystemSelectionChannels_1_5(serial, false, {specifier}); + Return res = radio_v1_5->setSystemSelectionChannels_1_5( + serial, false, {specifierP900, specifier850}); ASSERT_OK(res); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type); @@ -540,18 +547,23 @@ TEST_P(RadioHidlTest_v1_5, setSystemSelectionChannels_1_5) { TEST_P(RadioHidlTest_v1_5, startNetworkScan) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -573,6 +585,11 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan) { ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, {RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED})); } + + if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* @@ -608,18 +625,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidArgument) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval1) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 4, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -647,18 +669,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval1) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval2) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 301, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 60, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -686,18 +713,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval2) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime1) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 59, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -725,18 +757,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime1) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime2) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 3601, .incrementalResults = false, .incrementalResultsPeriodicity = 1}; @@ -764,18 +801,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime2) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity1) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 600, .incrementalResults = true, .incrementalResultsPeriodicity = 0}; @@ -803,18 +845,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity1) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity2) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 600, .incrementalResults = true, .incrementalResultsPeriodicity = 11}; @@ -842,18 +889,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity2) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_GoodRequest1) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 360, .incrementalResults = false, .incrementalResultsPeriodicity = 10}; @@ -873,6 +925,11 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_GoodRequest1) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } + + if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* @@ -881,18 +938,23 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_GoodRequest1) { TEST_P(RadioHidlTest_v1_5, startNetworkScan_GoodRequest2) { serial = GetRandomSerialNumber(); - ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands; - rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480}; - - ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = { + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900; + bandP900.geranBands() = {GeranBands::BAND_P900}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850; + band850.geranBands() = {GeranBands::BAND_850}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = { .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, - .bands = rasBands, + .bands = bandP900, .channels = {1, 2}}; + ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = { + .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN, + .bands = band850, + .channels = {128, 129}}; ::android::hardware::radio::V1_5::NetworkScanRequest request = { .type = ScanType::ONE_SHOT, .interval = 60, - .specifiers = {specifier}, + .specifiers = {specifierP900, specifier850}, .maxSearchTime = 360, .incrementalResults = false, .incrementalResultsPeriodicity = 10, @@ -913,6 +975,11 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan_GoodRequest2) { {RadioError::NONE, RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED})); } + + if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) { + ALOGI("Stop Network Scan"); + stopNetworkScan(); + } } /* diff --git a/radio/1.5/vts/functional/radio_hidl_hal_test.cpp b/radio/1.5/vts/functional/radio_hidl_hal_test.cpp index 7313de4ede..4155550572 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_test.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_test.cpp @@ -78,3 +78,9 @@ void RadioHidlTest_v1_5::updateSimCardStatus() { radio_v1_5->getIccCardStatus(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); } + +void RadioHidlTest_v1_5::stopNetworkScan() { + serial = GetRandomSerialNumber(); + radio_v1_5->stopNetworkScan(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); +} diff --git a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h index 6a369cc2e2..87ce675c5c 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h +++ b/radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h @@ -831,6 +831,9 @@ class RadioHidlTest_v1_5 : public ::testing::TestWithParam { /* Update Sim Card Status */ void updateSimCardStatus(); + /* Stop Network Scan Command */ + void stopNetworkScan(); + public: virtual void SetUp() override; From 4feb8cd28404a5aa8a65cfa8ca00c63816eb0e2a Mon Sep 17 00:00:00 2001 From: josephjang Date: Fri, 3 Jul 2020 17:48:06 +0800 Subject: [PATCH 56/62] Keymaster: Fix potential bug in extractUint32()/extractUint64() In deserializeVerificationToken(), we use extractUint64() to extract VerificationToken.challenge. A potential bug was found in extractUint64() that will cause VerificationToken.challenge() incorrect. Bug: 160198696 Merged-In: Ie0d2c0127cc34f1bb90455e4f7869e15e5542173 Change-Id: Ie0d2c0127cc34f1bb90455e4f7869e15e5542173 --- keymaster/4.0/support/keymaster_utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keymaster/4.0/support/keymaster_utils.cpp b/keymaster/4.0/support/keymaster_utils.cpp index 366cd0e553..bcfa75729a 100644 --- a/keymaster/4.0/support/keymaster_utils.cpp +++ b/keymaster/4.0/support/keymaster_utils.cpp @@ -121,8 +121,8 @@ void appendUint64(std::vector& vec, uint64_t value) { uint64_t extractUint64(const std::vector& data, size_t offset) { uint64_t value = 0; for (size_t n = 0; n < sizeof(uint64_t); n++) { - uint8_t byte = data[offset + n]; - value |= byte << (n * 8); + uint64_t tmp = data[offset + n]; + value |= (tmp << (n * 8)); } return value; } @@ -137,8 +137,8 @@ void appendUint32(std::vector& vec, uint32_t value) { uint32_t extractUint32(const std::vector& data, size_t offset) { uint32_t value = 0; for (size_t n = 0; n < sizeof(uint32_t); n++) { - uint8_t byte = data[offset + n]; - value |= byte << (n * 8); + uint32_t tmp = data[offset + n]; + value |= (tmp << (n * 8)); } return value; } From 400d9fa0a92df29a85a0e2e982b56993904945cb Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Wed, 8 Jul 2020 10:56:26 -0700 Subject: [PATCH 57/62] [VTS] Use primary channel to enable RTT responder Bug: 160109667 Test: atest VtsHalWifiRttV1_4TargetTest Change-Id: I9bbe5cdaf9656503acb87e2888856e0f199dc45f --- wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp b/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp index 9d842234b7..a099c8afd5 100644 --- a/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp +++ b/wifi/1.4/vts/functional/wifi_rtt_controller_hidl_test.cpp @@ -225,8 +225,8 @@ TEST_P(WifiRttControllerHidlTest, EnableResponder_1_4) { int cmdId = 55; WifiChannelInfo channelInfo; channelInfo.width = WifiChannelWidthInMhz::WIDTH_80; - channelInfo.centerFreq = 5690; - channelInfo.centerFreq0 = 5690; + channelInfo.centerFreq = 5660; + channelInfo.centerFreq0 = 5660; channelInfo.centerFreq1 = 0; // Get the responder first From 074d9041e0c6d3a6cf76ecbbab6a8453af10a74c Mon Sep 17 00:00:00 2001 From: Shuo Qian Date: Wed, 1 Jul 2020 11:56:44 -0700 Subject: [PATCH 58/62] Change range of SS-RSRQ per 3gpp Bug: 159761054 Test: VTS Change-Id: I377ef00015876b706ffeb20d9255c1b1ebf66c15 --- radio/1.5/vts/functional/radio_hidl_hal_api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp index 29cb1277f1..24b7fd5df3 100644 --- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp @@ -249,7 +249,7 @@ TEST_P(RadioHidlTest_v1_5, setSignalStrengthReportingCriteria_1_5_NGRAN_SSRSRQ) signalThresholdInfo.signalMeasurement = SignalMeasurementType::SSRSRQ; signalThresholdInfo.hysteresisMs = 5000; signalThresholdInfo.hysteresisDb = 0; - signalThresholdInfo.thresholds = {-15, -10, -5, -4}; + signalThresholdInfo.thresholds = {-43, -20, 0, 20}; signalThresholdInfo.isEnabled = true; Return res = radio_v1_5->setSignalStrengthReportingCriteria_1_5( From 799e59292bc3e8bce40d61b4c9550c39d54045a3 Mon Sep 17 00:00:00 2001 From: Victor Khimenko Date: Wed, 8 Jul 2020 23:17:33 +0200 Subject: [PATCH 59/62] Make android.hardware.renderscript@1.0 buildable for native_bridge Bug: http://b/153609531 Test: m android.hardware.renderscript@1.0.native_bridge Change-Id: If11376cdd583629c8edfea17efb130dd68dc9b8f Merged-In: If11376cdd583629c8edfea17efb130dd68dc9b8f --- audio/4.0/Android.bp | 2 ++ audio/common/2.0/Android.bp | 2 ++ audio/common/4.0/Android.bp | 2 ++ audio/effect/2.0/Android.bp | 2 ++ audio/effect/4.0/Android.bp | 2 ++ renderscript/1.0/Android.bp | 2 ++ 6 files changed, 12 insertions(+) diff --git a/audio/4.0/Android.bp b/audio/4.0/Android.bp index 862c71117c..bc695c852f 100644 --- a/audio/4.0/Android.bp +++ b/audio/4.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.audio@4.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, }, diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp index bd3b069ac7..56b43ffce0 100644 --- a/audio/common/2.0/Android.bp +++ b/audio/common/2.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.audio.common@2.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, }, diff --git a/audio/common/4.0/Android.bp b/audio/common/4.0/Android.bp index c01c486829..e4676ec1f5 100644 --- a/audio/common/4.0/Android.bp +++ b/audio/common/4.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.audio.common@4.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, }, diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp index d4482c2082..7b37260a27 100644 --- a/audio/effect/2.0/Android.bp +++ b/audio/effect/2.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.audio.effect@2.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, }, diff --git a/audio/effect/4.0/Android.bp b/audio/effect/4.0/Android.bp index 8c1900f1fe..2242d6d76e 100644 --- a/audio/effect/4.0/Android.bp +++ b/audio/effect/4.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.audio.effect@4.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, }, diff --git a/renderscript/1.0/Android.bp b/renderscript/1.0/Android.bp index feae9f7c7e..d3b5abed9a 100644 --- a/renderscript/1.0/Android.bp +++ b/renderscript/1.0/Android.bp @@ -3,6 +3,8 @@ hidl_interface { name: "android.hardware.renderscript@1.0", root: "android.hardware", + // TODO(b/153609531): remove when no longer needed. + native_bridge_supported: true, vndk: { enabled: true, support_system_process: true, From 88990e687cf1337bafae6b9b175b45e6da9e2f29 Mon Sep 17 00:00:00 2001 From: "jack.cc-hsu" Date: Wed, 8 Jul 2020 15:44:38 +0800 Subject: [PATCH 60/62] Update nodeNamePattern rule Include '_' which has always been allowed. Bug: 158645317 Test: VtsHalMediaOmxV1_0TargetMasterTest : OK Change-Id: Ia1cfc6004961ffad76843920fe4d5423f70244e7 --- .../functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp index 4e253134c4..68ee90093f 100644 --- a/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp +++ b/media/omx/1.0/vts/functional/master/VtsHalMediaOmxV1_0TargetMasterTest.cpp @@ -251,7 +251,7 @@ TEST_P(MasterHidlTest, ListRoles) { }; // Matching rules for node names and owners - const testing::internal::RE nodeNamePattern = "[a-zA-Z0-9.-]+"; + const testing::internal::RE nodeNamePattern = "[a-zA-Z0-9._-]+"; const testing::internal::RE nodeOwnerPattern = "[a-zA-Z0-9._-]+"; std::set roleKeys; From 035a6f3239c70e88c2137e69fcad7a5af4c77652 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 10 Jul 2020 14:34:21 -0400 Subject: [PATCH 61/62] Identity: Add VTS test to check empty and semi-empty requests work properly. Some IC applications may perform two requests - one to get data elements and a second empty request. The latter is to e.g. get an empty DeviceSignedItems and corresponding MAC. Extend VTS tests to check that the HAL does this correctly both for the completely empty request and also for a request with an empty namespace. Bug: 160966911 Test: atest VtsHalIdentityTargetTest Merged-In: I3205f2c0ded2ea315857438a3114ddcf8ef557f9 Change-Id: Ib718e6f0f0b287e39ff7dd3db5335cec1bc1804e --- .../aidl/vts/VtsHalIdentityEndToEndTest.cpp | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp b/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp index 1577293521..e347654d9a 100644 --- a/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp +++ b/identity/aidl/vts/VtsHalIdentityEndToEndTest.cpp @@ -386,7 +386,7 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { vector requestedNamespaces = test_utils::buildRequestNamespaces(testEntries); // OK to fail, not available in v1 HAL - credential->setRequestedNamespaces(requestedNamespaces).isOk(); + credential->setRequestedNamespaces(requestedNamespaces); // OK to fail, not available in v1 HAL credential->setVerificationToken(verificationToken); ASSERT_TRUE(credential @@ -446,7 +446,6 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { deviceAuthentication.add(cppbor::Semantic(24, deviceNameSpacesBytes)); vector deviceAuthenticationBytes = cppbor::Semantic(24, deviceAuthentication.encode()).encode(); - // Derive the key used for MACing. optional> readerEphemeralPrivateKey = support::ecKeyPairGetPrivateKey(readerEphemeralKeyPair.value()); @@ -469,6 +468,58 @@ TEST_P(IdentityAidl, createAndRetrieveCredential) { deviceAuthenticationBytes); // detached content ASSERT_TRUE(calculatedMac); EXPECT_EQ(mac, calculatedMac); + + // Also perform an additional empty request. This is what mDL applications + // are envisioned to do - one call to get the data elements, another to get + // an empty DeviceSignedItems and corresponding MAC. + // + credential->setRequestedNamespaces({}); // OK to fail, not available in v1 HAL + ASSERT_TRUE(credential + ->startRetrieval( + secureProfiles.value(), authToken, {}, // itemsRequestBytes + signingKeyBlob, sessionTranscriptEncoded, {}, // readerSignature, + testEntriesEntryCounts) + .isOk()); + ASSERT_TRUE(credential->finishRetrieval(&mac, &deviceNameSpacesBytes).isOk()); + cborPretty = support::cborPrettyPrint(deviceNameSpacesBytes, 32, {}); + ASSERT_EQ("{}", cborPretty); + // Calculate DeviceAuthentication and MAC (MACing key hasn't changed) + deviceAuthentication = cppbor::Array(); + deviceAuthentication.add("DeviceAuthentication"); + deviceAuthentication.add(sessionTranscript.clone()); + deviceAuthentication.add(docType); + deviceAuthentication.add(cppbor::Semantic(24, deviceNameSpacesBytes)); + deviceAuthenticationBytes = cppbor::Semantic(24, deviceAuthentication.encode()).encode(); + calculatedMac = support::coseMac0(derivedKey.value(), {}, // payload + deviceAuthenticationBytes); // detached content + ASSERT_TRUE(calculatedMac); + EXPECT_EQ(mac, calculatedMac); + + // Some mDL apps might send a request but with a single empty + // namespace. Check that too. + RequestNamespace emptyRequestNS; + emptyRequestNS.namespaceName = "PersonalData"; + credential->setRequestedNamespaces({emptyRequestNS}); // OK to fail, not available in v1 HAL + ASSERT_TRUE(credential + ->startRetrieval( + secureProfiles.value(), authToken, {}, // itemsRequestBytes + signingKeyBlob, sessionTranscriptEncoded, {}, // readerSignature, + testEntriesEntryCounts) + .isOk()); + ASSERT_TRUE(credential->finishRetrieval(&mac, &deviceNameSpacesBytes).isOk()); + cborPretty = support::cborPrettyPrint(deviceNameSpacesBytes, 32, {}); + ASSERT_EQ("{}", cborPretty); + // Calculate DeviceAuthentication and MAC (MACing key hasn't changed) + deviceAuthentication = cppbor::Array(); + deviceAuthentication.add("DeviceAuthentication"); + deviceAuthentication.add(sessionTranscript.clone()); + deviceAuthentication.add(docType); + deviceAuthentication.add(cppbor::Semantic(24, deviceNameSpacesBytes)); + deviceAuthenticationBytes = cppbor::Semantic(24, deviceAuthentication.encode()).encode(); + calculatedMac = support::coseMac0(derivedKey.value(), {}, // payload + deviceAuthenticationBytes); // detached content + ASSERT_TRUE(calculatedMac); + EXPECT_EQ(mac, calculatedMac); } INSTANTIATE_TEST_SUITE_P( From 0a19601eaedf42cf8270ffb113a990be19a2c101 Mon Sep 17 00:00:00 2001 From: Ady Abraham Date: Mon, 13 Jul 2020 16:27:15 -0700 Subject: [PATCH 62/62] composer: 2.4: VTS using old value for parameter Fix a test that is using the incorrect parameter. Bug: 161023185 Test: adb shell data/nativetest64/VtsHalGraphicsComposerV2_4TargetTest/VtsHalGraphicsComposerV2_4TargetTest Change-Id: I8574abed50c23657f5d96e9d396709cb9b92e1fd --- .../VtsHalGraphicsComposerV2_4TargetTest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp index 00df7c78f3..6b0d106075 100644 --- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp +++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp @@ -493,16 +493,16 @@ void GraphicsComposerHidlCommandTest::Test_setActiveConfigWithConstraints( // At this point the refresh rate should have changed already, however in rare // cases the implementation might have missed the deadline. In this case a new // timeline should have been provided. - auto newTimelime = mComposerCallback->takeLastVsyncPeriodChangeTimeline(); + auto newTimeline = mComposerCallback->takeLastVsyncPeriodChangeTimeline(); if (timeline.refreshRequired && refreshMiss) { - EXPECT_TRUE(newTimelime.has_value()); + EXPECT_TRUE(newTimeline.has_value()); } - if (newTimelime.has_value()) { - if (timeline.refreshRequired) { - sendRefreshFrame(&newTimelime.value()); + if (newTimeline.has_value()) { + if (newTimeline->refreshRequired) { + sendRefreshFrame(&newTimeline.value()); } - waitForVsyncPeriodChange(display, newTimelime.value(), constraints.desiredTimeNanos, + waitForVsyncPeriodChange(display, newTimeline.value(), constraints.desiredTimeNanos, vsyncPeriod1, vsyncPeriod2); }