Loading biometrics/face/aidl/default/Session.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ ndk::ScopedAStatus Session::removeEnrollments(const std::vector<int32_t>& /*enro ndk::ScopedAStatus Session::getFeatures() { LOG(INFO) << "getFeatures"; if (cb_) { cb_->onFeaturesRetrieved({}); // Must error out with UNABLE_TO_PROCESS when no faces are enrolled. cb_->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); } return ndk::ScopedAStatus::ok(); } Loading biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -60,9 +60,10 @@ class SessionCallback : public BnSessionCallback { return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus onError(Error error, int32_t /*vendorCode*/) override { ndk::ScopedAStatus onError(Error error, int32_t vendorCode) override { auto lock = std::lock_guard<std::mutex>{mMutex}; mError = error; mVendorCode = vendorCode; mOnErrorInvoked = true; mCv.notify_one(); return ndk::ScopedAStatus::ok(); Loading Loading @@ -141,6 +142,7 @@ class SessionCallback : public BnSessionCallback { std::mutex mMutex; std::condition_variable mCv; Error mError = Error::UNKNOWN; int32_t mVendorCode = 0; int64_t mGeneratedChallenge = 0; int64_t mRevokedChallenge = 0; bool mOnChallengeGeneratedInvoked = false; Loading Loading @@ -218,6 +220,8 @@ TEST_P(Face, EnrollWithBadHatResultsInErrorTest) { // Make sure an error is returned. auto lock = std::unique_lock{mCb->mMutex}; mCb->mCv.wait(lock, [this] { return mCb->mOnErrorInvoked; }); EXPECT_EQ(mCb->mError, Error::UNABLE_TO_PROCESS); EXPECT_EQ(mCb->mVendorCode, 0); } TEST_P(Face, GenerateChallengeProducesUniqueChallengesTest) { Loading Loading @@ -287,13 +291,15 @@ TEST_P(Face, RemoveEnrollmentsWorksTest) { mCb->mCv.wait(lock, [this] { return mCb->mOnEnrollmentsRemovedInvoked; }); } TEST_P(Face, GetFeaturesWorksTest) { TEST_P(Face, GetFeaturesWithoutEnrollmentsResultsInUnableToProcess) { // Call the method. ASSERT_TRUE(mSession->getFeatures().isOk()); // Wait for the result. auto lock = std::unique_lock{mCb->mMutex}; mCb->mCv.wait(lock, [this] { return mCb->mOnFeaturesRetrievedInvoked; }); mCb->mCv.wait(lock, [this] { return mCb->mOnErrorInvoked; }); EXPECT_EQ(mCb->mError, Error::UNABLE_TO_PROCESS); EXPECT_EQ(mCb->mVendorCode, 0); } TEST_P(Face, GetAuthenticatorIdWorksTest) { Loading radio/1.5/vts/functional/radio_hidl_hal_api.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1251,8 +1251,20 @@ TEST_P(RadioHidlTest_v1_5, sendCdmaSmsExpectMore) { * Test IRadio.getBarringInfo() for the response returned. */ TEST_P(RadioHidlTest_v1_5, getBarringInfo) { // If the previous setRadioPower_1_5_emergencyCall_cancelled test has just finished. // Due to radio restarting, modem may need a little more time to acquire network service // and barring infos. If voice status is in-service, waiting 3s to get barring infos ready. // Or waiting 10s if voice status is not in-service. serial = GetRandomSerialNumber(); radio_v1_5->getVoiceRegistrationState_1_5(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); if (isVoiceInService(radioRsp_v1_5->voiceRegResp.regState)) { sleep(BARRING_INFO_MAX_WAIT_TIME_SECONDS); } else { sleep(VOICE_SERVICE_MAX_WAIT_TIME_SECONDS); } serial = GetRandomSerialNumber(); Return<void> res = radio_v1_5->getBarringInfo(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type); Loading radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h +3 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ using ::android::hardware::Void; #define TIMEOUT_PERIOD 75 #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 #define VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10 #define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3 #define RADIO_SERVICE_NAME "slot1" Loading @@ -69,6 +71,7 @@ class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioRespon // Call hidl_vec<::android::hardware::radio::V1_2::Call> currentCalls; ::android::hardware::radio::V1_2::VoiceRegStateResult voiceRegResp; // Modem bool isModemEnabled; Loading radio/1.5/vts/functional/radio_response.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -763,8 +763,9 @@ Return<void> RadioResponse_v1_5::getCellInfoListResponse_1_2( Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_2( const RadioResponseInfo& info, const ::android::hardware::radio::V1_2::VoiceRegStateResult& /*voiceRegResponse*/) { const ::android::hardware::radio::V1_2::VoiceRegStateResult& voiceRegResponse) { rspInfo = info; voiceRegResp = voiceRegResponse; parent_v1_5.notify(info.serial); return Void(); } Loading Loading @@ -989,8 +990,9 @@ Return<void> RadioResponse_v1_5::getBarringInfoResponse( Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_5( const RadioResponseInfo& info, const ::android::hardware::radio::V1_5::RegStateResult& /*regResponse*/) { const ::android::hardware::radio::V1_5::RegStateResult& regResponse) { rspInfo = info; voiceRegResp.regState = regResponse.regState; parent_v1_5.notify(info.serial); return Void(); } Loading Loading
biometrics/face/aidl/default/Session.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ ndk::ScopedAStatus Session::removeEnrollments(const std::vector<int32_t>& /*enro ndk::ScopedAStatus Session::getFeatures() { LOG(INFO) << "getFeatures"; if (cb_) { cb_->onFeaturesRetrieved({}); // Must error out with UNABLE_TO_PROCESS when no faces are enrolled. cb_->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */); } return ndk::ScopedAStatus::ok(); } Loading
biometrics/face/aidl/vts/VtsHalBiometricsFaceTargetTest.cpp +9 −3 Original line number Diff line number Diff line Loading @@ -60,9 +60,10 @@ class SessionCallback : public BnSessionCallback { return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus onError(Error error, int32_t /*vendorCode*/) override { ndk::ScopedAStatus onError(Error error, int32_t vendorCode) override { auto lock = std::lock_guard<std::mutex>{mMutex}; mError = error; mVendorCode = vendorCode; mOnErrorInvoked = true; mCv.notify_one(); return ndk::ScopedAStatus::ok(); Loading Loading @@ -141,6 +142,7 @@ class SessionCallback : public BnSessionCallback { std::mutex mMutex; std::condition_variable mCv; Error mError = Error::UNKNOWN; int32_t mVendorCode = 0; int64_t mGeneratedChallenge = 0; int64_t mRevokedChallenge = 0; bool mOnChallengeGeneratedInvoked = false; Loading Loading @@ -218,6 +220,8 @@ TEST_P(Face, EnrollWithBadHatResultsInErrorTest) { // Make sure an error is returned. auto lock = std::unique_lock{mCb->mMutex}; mCb->mCv.wait(lock, [this] { return mCb->mOnErrorInvoked; }); EXPECT_EQ(mCb->mError, Error::UNABLE_TO_PROCESS); EXPECT_EQ(mCb->mVendorCode, 0); } TEST_P(Face, GenerateChallengeProducesUniqueChallengesTest) { Loading Loading @@ -287,13 +291,15 @@ TEST_P(Face, RemoveEnrollmentsWorksTest) { mCb->mCv.wait(lock, [this] { return mCb->mOnEnrollmentsRemovedInvoked; }); } TEST_P(Face, GetFeaturesWorksTest) { TEST_P(Face, GetFeaturesWithoutEnrollmentsResultsInUnableToProcess) { // Call the method. ASSERT_TRUE(mSession->getFeatures().isOk()); // Wait for the result. auto lock = std::unique_lock{mCb->mMutex}; mCb->mCv.wait(lock, [this] { return mCb->mOnFeaturesRetrievedInvoked; }); mCb->mCv.wait(lock, [this] { return mCb->mOnErrorInvoked; }); EXPECT_EQ(mCb->mError, Error::UNABLE_TO_PROCESS); EXPECT_EQ(mCb->mVendorCode, 0); } TEST_P(Face, GetAuthenticatorIdWorksTest) { Loading
radio/1.5/vts/functional/radio_hidl_hal_api.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1251,8 +1251,20 @@ TEST_P(RadioHidlTest_v1_5, sendCdmaSmsExpectMore) { * Test IRadio.getBarringInfo() for the response returned. */ TEST_P(RadioHidlTest_v1_5, getBarringInfo) { // If the previous setRadioPower_1_5_emergencyCall_cancelled test has just finished. // Due to radio restarting, modem may need a little more time to acquire network service // and barring infos. If voice status is in-service, waiting 3s to get barring infos ready. // Or waiting 10s if voice status is not in-service. serial = GetRandomSerialNumber(); radio_v1_5->getVoiceRegistrationState_1_5(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); if (isVoiceInService(radioRsp_v1_5->voiceRegResp.regState)) { sleep(BARRING_INFO_MAX_WAIT_TIME_SECONDS); } else { sleep(VOICE_SERVICE_MAX_WAIT_TIME_SECONDS); } serial = GetRandomSerialNumber(); Return<void> res = radio_v1_5->getBarringInfo(serial); EXPECT_EQ(std::cv_status::no_timeout, wait()); EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type); Loading
radio/1.5/vts/functional/radio_hidl_hal_utils_v1_5.h +3 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ using ::android::hardware::Void; #define TIMEOUT_PERIOD 75 #define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3 #define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3 #define VOICE_SERVICE_MAX_WAIT_TIME_SECONDS 10 #define BARRING_INFO_MAX_WAIT_TIME_SECONDS 3 #define RADIO_SERVICE_NAME "slot1" Loading @@ -69,6 +71,7 @@ class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioRespon // Call hidl_vec<::android::hardware::radio::V1_2::Call> currentCalls; ::android::hardware::radio::V1_2::VoiceRegStateResult voiceRegResp; // Modem bool isModemEnabled; Loading
radio/1.5/vts/functional/radio_response.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -763,8 +763,9 @@ Return<void> RadioResponse_v1_5::getCellInfoListResponse_1_2( Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_2( const RadioResponseInfo& info, const ::android::hardware::radio::V1_2::VoiceRegStateResult& /*voiceRegResponse*/) { const ::android::hardware::radio::V1_2::VoiceRegStateResult& voiceRegResponse) { rspInfo = info; voiceRegResp = voiceRegResponse; parent_v1_5.notify(info.serial); return Void(); } Loading Loading @@ -989,8 +990,9 @@ Return<void> RadioResponse_v1_5::getBarringInfoResponse( Return<void> RadioResponse_v1_5::getVoiceRegistrationStateResponse_1_5( const RadioResponseInfo& info, const ::android::hardware::radio::V1_5::RegStateResult& /*regResponse*/) { const ::android::hardware::radio::V1_5::RegStateResult& regResponse) { rspInfo = info; voiceRegResp.regState = regResponse.regState; parent_v1_5.notify(info.serial); return Void(); } Loading