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

Commit bc4498f3 authored by Yuyang Huang's avatar Yuyang Huang Committed by David Lin
Browse files

Adapt CheckApfIsSupported for VSR-15 compatibility

This commit updates CheckApfIsSupported to align with VSR-15
requirements. APF should have minimum of 2000 bytes usable memory.

Bug: <303356901>
Test: TH
(cherry picked from https://android-review.googlesource.com/q/commit:641f0aed53c80751a8f19e551c522d7c4671691f)
Merged-In: I2a2dbc22e1532fcb11ab256830cecba9f6c54446
Change-Id: I2a2dbc22e1532fcb11ab256830cecba9f6c54446
24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
parent c4834170
Loading
Loading
Loading
Loading
+12 −8
Original line number Original line Diff line number Diff line
@@ -176,14 +176,18 @@ TEST_P(WifiStaIfaceAidlTest, CheckApfIsSupported) {
        }
        }
        StaApfPacketFilterCapabilities apf_caps = {};
        StaApfPacketFilterCapabilities apf_caps = {};
        EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
        EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
    } else {
        return;
    }

    EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
    EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
    StaApfPacketFilterCapabilities apf_caps = {};
    StaApfPacketFilterCapabilities apf_caps = {};
    EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
    EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
        // The APF version must be 4 or higher and the usable memory must be at least
        // 1024 bytes.
    EXPECT_GE(apf_caps.version, 4);
    EXPECT_GE(apf_caps.version, 4);
    // Based on VSR-14 the usable memory must be at least 1024 bytes.
    EXPECT_GE(apf_caps.maxLength, 1024);
    EXPECT_GE(apf_caps.maxLength, 1024);
    if (vendor_api_level >= __ANDROID_API_V__) {
        // Based on VSR-15 the usable memory must be at least 2000 bytes.
        EXPECT_GE(apf_caps.maxLength, 2000);
    }
    }
}
}