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

Commit 6271c5e6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "wifi(implementation): Remove support for STA + STA in chip combination"

parents 72f409ce aceecb06
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ class MockWifiLegacyHal : public WifiLegacyHal {
    MOCK_METHOD2(stop, wifi_error(std::unique_lock<std::recursive_mutex>*,
                                  const std::function<void()>&));
    MOCK_METHOD2(setDfsFlag, wifi_error(const std::string&, bool));
    MOCK_METHOD2(registerRadioModeChangeCallbackHandler,
                 wifi_error(const std::string&,
                            const on_radio_mode_change_callback&));
    MOCK_METHOD2(nanRegisterCallbackHandlers,
                 wifi_error(const std::string&, const NanCallbackHandlers&));
    MOCK_METHOD2(nanDisableRequest,
+6 −33
Original line number Diff line number Diff line
@@ -395,10 +395,10 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateAp_ShouldSucceed) {
    ASSERT_FALSE(createIface(IfaceType::AP).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaSta_ShouldSucceed) {
TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaSta_ShouldFail) {
    findModeAndConfigureForIfaceType(IfaceType::AP);
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    ASSERT_TRUE(createIface(IfaceType::STA).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_ShouldSucceed) {
@@ -407,35 +407,18 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaAp_ShouldSucceed) {
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest, CreateStaStaAp_ShouldFail) {
    findModeAndConfigureForIfaceType(IfaceType::AP);
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    ASSERT_TRUE(createIface(IfaceType::AP).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest,
       CreateStaAp_AfterStaRemove_ShouldSucceed) {
       CreateSta_AfterStaApRemove_ShouldSucceed) {
    findModeAndConfigureForIfaceType(IfaceType::STA);
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    const auto sta_iface_name = createIface(IfaceType::STA);
    ASSERT_FALSE(sta_iface_name.empty());
    ASSERT_TRUE(createIface(IfaceType::AP).empty());

    // After removing STA iface, AP iface creation should succeed.
    removeIface(IfaceType::STA, sta_iface_name);
    ASSERT_FALSE(createIface(IfaceType::AP).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest,
       CreateStaSta_AfterApRemove_ShouldSucceed) {
    findModeAndConfigureForIfaceType(IfaceType::STA);
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
    const auto ap_iface_name = createIface(IfaceType::AP);
    ASSERT_FALSE(ap_iface_name.empty());

    ASSERT_TRUE(createIface(IfaceType::STA).empty());

    // After removing AP  iface, STA iface creation should succeed.
    // After removing AP & STA iface, STA iface creation should succeed.
    removeIface(IfaceType::STA, sta_iface_name);
    removeIface(IfaceType::AP, ap_iface_name);
    ASSERT_FALSE(createIface(IfaceType::STA).empty());
}
@@ -523,16 +506,6 @@ TEST_F(WifiChipV2_AwareIfaceCombinationTest,
    ASSERT_FALSE(createIface(IfaceType::P2P).empty());
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest,
       CreateStaSta_EnsureDifferentIfaceNames) {
    findModeAndConfigureForIfaceType(IfaceType::AP);
    const auto sta1_iface_name = createIface(IfaceType::STA);
    const auto sta2_iface_name = createIface(IfaceType::STA);
    ASSERT_FALSE(sta1_iface_name.empty());
    ASSERT_FALSE(sta2_iface_name.empty());
    ASSERT_NE(sta1_iface_name, sta2_iface_name);
}

TEST_F(WifiChipV2_AwareIfaceCombinationTest,
       CreateStaAp_EnsureDifferentIfaceNames) {
    findModeAndConfigureForIfaceType(IfaceType::AP);
+2 −3
Original line number Diff line number Diff line
@@ -1171,7 +1171,7 @@ void WifiChip::populateModes() {
    // (conditional on isDualInterfaceSupported()):
    //    Interface Combination 1: Will support 1 STA and 1 P2P or NAN(optional)
    //                             concurrent iface operations.
    //    Interface Combination 2: Will support 1 STA and 1 STA or AP concurrent
    //    Interface Combination 2: Will support 1 STA and 1 AP concurrent
    //                             iface operations.
    // If Aware is enabled (conditional on isAwareSupported()), the iface
    // combination will be modified to support either P2P or NAN in place of
@@ -1181,8 +1181,7 @@ void WifiChip::populateModes() {
        const IWifiChip::ChipIfaceCombinationLimit
            chip_iface_combination_limit_1 = {{IfaceType::STA}, 1};
        const IWifiChip::ChipIfaceCombinationLimit
            chip_iface_combination_limit_2 = {{IfaceType::STA, IfaceType::AP},
                                              1};
            chip_iface_combination_limit_2 = {{IfaceType::AP}, 1};
        IWifiChip::ChipIfaceCombinationLimit chip_iface_combination_limit_3;
        if (feature_flags_.lock()->isAwareSupported()) {
            chip_iface_combination_limit_3 = {{IfaceType::P2P, IfaceType::NAN},
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ class WifiLegacyHal {
    wifi_error deregisterErrorAlertCallbackHandler(
        const std::string& iface_name);
    // Radio mode functions.
    wifi_error registerRadioModeChangeCallbackHandler(
    virtual wifi_error registerRadioModeChangeCallbackHandler(
        const std::string& iface_name,
        const on_radio_mode_change_callback& on_user_change_callback);
    // RTT functions.