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

Commit 51677bf7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7571067 from 5fb5afe8 to sc-release

Change-Id: I2c6640e58c32df585d81396d1df4f8c98bdbd925
parents 799fc5db 5fb5afe8
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -249,35 +249,40 @@ TEST_P(GnssHalTest, TestGnssAntennaInfo) {

/*
 * TestGnssSvInfoFields:
 * Gets 1 location and a GnssSvInfo, and verifies
 * 1. basebandCN0DbHz is valid.
 * Gets 1 location and a (non-empty) GnssSvInfo, and verifies basebandCN0DbHz is valid.
 */
TEST_P(GnssHalTest, TestGnssSvInfoFields) {
    gnss_cb_->location_cbq_.reset();
    gnss_cb_->sv_info_list_cbq_.reset();
    StartAndCheckFirstLocation(/* min_interval_msec= */ 1000, /* low_power_mode= */ false);
    int location_called_count = gnss_cb_->location_cbq_.calledCount();

    // Tolerate 1 less sv status to handle edge cases in reporting.
    int sv_info_list_cbq_size = gnss_cb_->sv_info_list_cbq_.size();
    EXPECT_GE(sv_info_list_cbq_size, 0);
    ALOGD("Observed %d GnssSvStatus, while awaiting one location (%d received)",
          sv_info_list_cbq_size, location_called_count);

    // Get the last sv_info_list
    std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_vec_list;
    gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_vec_list, sv_info_list_cbq_size, 1);
    hidl_vec<IGnssCallback_2_1::GnssSvInfo> last_sv_info_list = sv_info_vec_list.back();

          gnss_cb_->sv_info_list_cbq_.size(), location_called_count);

    // Wait for up to kNumSvInfoLists events for kTimeoutSeconds for each event.
    int kTimeoutSeconds = 2;
    int kNumSvInfoLists = 4;
    std::list<hidl_vec<IGnssCallback_2_1::GnssSvInfo>> sv_info_lists;
    hidl_vec<IGnssCallback_2_1::GnssSvInfo> last_sv_info_list;

    do {
        EXPECT_GT(gnss_cb_->sv_info_list_cbq_.retrieve(sv_info_lists, kNumSvInfoLists,
                                                       kTimeoutSeconds),
                  0);
        last_sv_info_list = sv_info_lists.back();
    } while (last_sv_info_list.size() == 0);

    ALOGD("last_sv_info size = %d", (int)last_sv_info_list.size());
    bool nonZeroCn0Found = false;
    for (auto sv_info : last_sv_info_list) {
        ASSERT_TRUE(sv_info.basebandCN0DbHz >= 0.0 && sv_info.basebandCN0DbHz <= 65.0);
        EXPECT_TRUE(sv_info.basebandCN0DbHz >= 0.0 && sv_info.basebandCN0DbHz <= 65.0);
        if (sv_info.basebandCN0DbHz > 0.0) {
            nonZeroCn0Found = true;
        }
    }
    // Assert at least one value is non-zero. Zero is ok in status as it's possibly
    // reporting a searched but not found satellite.
    ASSERT_TRUE(nonZeroCn0Found);
    EXPECT_TRUE(nonZeroCn0Found);
    StopAndClearLocations();
}

+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ cc_test {
        "libkeymint_vts_test_utils",
        "libpuresoftkeymasterdevice",
    ],
    test_config: "VtsRemotelyProvisionedComponentTests.xml",
    test_suites: [
        "general-tests",
        "vts",
+34 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<configuration description="Runs VtsHalRemotelyProvisionedComponentTargetTest.">
    <option name="test-suite-tag" value="apct" />
    <option name="test-suite-tag" value="apct-native" />

    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>

    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
        <option name="cleanup" value="true" />
        <option name="push-file"
            key="VtsHalRemotelyProvisionedComponentTargetTest"
            value="/data/local/tmp/VtsHalRemotelyProvisionedComponentTargetTest" />
    </target_preparer>

    <test class="com.android.tradefed.testtype.GTest" >
        <option name="native-test-device-path" value="/data/local/tmp" />
        <option name="module-name" value="VtsHalRemotelyProvisionedComponentTargetTest" />
        <option name="native-test-timeout" value="900000"/> <!-- 15 minutes -->
    </test>
</configuration>