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

Commit 99d8b266 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Android (Google) Code Review
Browse files

Merge "Radio VTS: don't call deprecated methods" into main

parents 3062a446 ff1fa625
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ void RadioModemTest::SetUp() {
    ASSERT_NE(nullptr, radio_config.get());
}

bool RadioModemTest::shouldTestCdma() {
    int32_t aidl_version = 0;
    ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
    EXPECT_TRUE(aidl_status.isOk());
    if (aidl_version < 2) return true;  // < RADIO_HAL_VERSION_2_1

    return !telephony_flags::cleanup_cdma();
}

/*
 * Test IRadioModem.setRadioPower() for the response returned.
 */
@@ -244,6 +253,10 @@ TEST_P(RadioModemTest, getImei) {
 * Test IRadioModem.nvReadItem() for the response returned.
 */
TEST_P(RadioModemTest, nvReadItem) {
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
    }

    serial = GetRandomSerialNumber();

    radio_modem->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
@@ -261,6 +274,10 @@ TEST_P(RadioModemTest, nvReadItem) {
 * Test IRadioModem.nvWriteItem() for the response returned.
 */
TEST_P(RadioModemTest, nvWriteItem) {
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
    }

    serial = GetRandomSerialNumber();
    NvWriteItem item;
    memset(&item, 0, sizeof(item));
+2 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ class RadioModemTest : public RadioServiceTest {
  public:
    void SetUp() override;

    bool shouldTestCdma();

    /* radio modem service handle */
    std::shared_ptr<IRadioModem> radio_modem;
    /* radio modem response handle */
+19 −0
Original line number Diff line number Diff line
@@ -78,6 +78,15 @@ void RadioNetworkTest::SetUp() {
    ASSERT_NE(nullptr, radio_config.get());
}

bool RadioNetworkTest::shouldTestCdma() {
    int32_t aidl_version = 0;
    ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
    EXPECT_TRUE(aidl_status.isOk());
    if (aidl_version < 4) return true;  // < RADIO_HAL_VERSION_2_3

    return !telephony_flags::cleanup_cdma();
}

void RadioNetworkTest::stopNetworkScan() {
    serial = GetRandomSerialNumber();
    radio_network->stopNetworkScan(serial);
@@ -1775,6 +1784,9 @@ TEST_P(RadioNetworkTest, getDataRegistrationState) {
 * Test IRadioNetwork.getAvailableBandModes() for the response returned.
 */
TEST_P(RadioNetworkTest, getAvailableBandModes) {
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
    }
    if (telephony_flags::enforce_telephony_feature_mapping()) {
        if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
            GTEST_SKIP() << "Skipping getAvailableBandModes "
@@ -2019,6 +2031,9 @@ TEST_P(RadioNetworkTest, getAvailableNetworks) {
 * Test IRadioNetwork.setBandMode() for the response returned.
 */
TEST_P(RadioNetworkTest, setBandMode) {
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
    }
    if (telephony_flags::enforce_telephony_feature_mapping()) {
        if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
            GTEST_SKIP() << "Skipping setBandMode "
@@ -2043,6 +2058,10 @@ TEST_P(RadioNetworkTest, setBandMode) {
 * Test IRadioNetwork.setLocationUpdates() for the response returned.
 */
TEST_P(RadioNetworkTest, setLocationUpdates) {
    // While setLocationUpdates is not CDMA-related, it's guarded by the same release flag.
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping testing of deprecated setLocationUpdates method";
    }
    if (telephony_flags::enforce_telephony_feature_mapping()) {
        if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
            GTEST_SKIP() << "Skipping setLocationUpdates "
+2 −0
Original line number Diff line number Diff line
@@ -263,6 +263,8 @@ class RadioNetworkTest : public RadioServiceTest {
  public:
    void SetUp() override;

    bool shouldTestCdma();

    /* radio network service handle */
    std::shared_ptr<IRadioNetwork> radio_network;
    /* radio network response handle */
+19 −0
Original line number Diff line number Diff line
@@ -52,6 +52,15 @@ void RadioSimTest::SetUp() {
    ASSERT_NE(nullptr, radio_config.get());
}

bool RadioSimTest::shouldTestCdma() {
    int32_t aidl_version = 0;
    ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
    EXPECT_TRUE(aidl_status.isOk());
    if (aidl_version < 4) return true;  // < RADIO_HAL_VERSION_2_3

    return !telephony_flags::cleanup_cdma();
}

void RadioSimTest::updateSimCardStatus() {
    serial = GetRandomSerialNumber();
    radio_sim->getIccCardStatus(serial);
@@ -935,6 +944,13 @@ TEST_P(RadioSimTest, iccOpenLogicalChannel) {
 * Test IRadioSim.iccCloseLogicalChannel() for the response returned.
 */
TEST_P(RadioSimTest, iccCloseLogicalChannel) {
    int32_t aidl_version;
    ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
    ASSERT_OK(aidl_status);
    if (aidl_version >= 2) {  // >= RADIO_HAL_VERSION_2_1
        GTEST_SKIP() << "Skipping iccCloseLogicalChannel (deprecated)";
    }

    if (telephony_flags::enforce_telephony_feature_mapping()) {
        if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
            GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
@@ -1176,6 +1192,9 @@ TEST_P(RadioSimTest, setCdmaSubscriptionSource) {
 * Test IRadioSim.setUiccSubscription() for the response returned.
 */
TEST_P(RadioSimTest, setUiccSubscription) {
    if (!shouldTestCdma()) {
        GTEST_SKIP() << "Skipping CDMA testing (deprecated)";
    }
    if (telephony_flags::enforce_telephony_feature_mapping()) {
        if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
            GTEST_SKIP() << "Skipping setUiccSubscription "
Loading