Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93db6e6b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7574892 from 9581a890 to sc-release

Change-Id: Ibed77ac778e34a86cc4377374cd8c345b046a8dd
parents 51677bf7 9581a890
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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();
}
+9 −3
Original line number Diff line number Diff line
@@ -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();
@@ -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;
@@ -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) {
@@ -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) {
+12 −0
Original line number Diff line number Diff line
@@ -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);
+3 −0
Original line number Diff line number Diff line
@@ -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"

@@ -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;
+4 −2
Original line number Diff line number Diff line
@@ -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();
}
@@ -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();
}