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

Commit aa9bd83d authored by Gabriel Biren's avatar Gabriel Biren
Browse files

Update the Vendor HAL and compatibility matrix to

implement V2 of the Vendor HAL interface.

Also involves adding a default implementation of the
new method createApOrBridgedApIface().

Bug: 296069900
Test: m
Change-Id: Iea8aa0b66a23125c066d72b710004496d41defcb
parent 61430f49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@
    </hal>
    <hal format="aidl" optional="true" updatable-via-apex="true">
        <name>android.hardware.wifi</name>
        <version>1</version>
        <version>1-2</version>
        <interface>
            <name>IWifi</name>
            <instance>default</instance>
+5 −4
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ cc_library_static {
        "libwifi-hal",
        "libwifi-system-iface",
        "libxml2",
        "android.hardware.wifi-V1-ndk",
        "android.hardware.wifi-V2-ndk",
    ],

    export_include_dirs: ["."],
@@ -132,7 +132,7 @@ cc_binary {
        "libwifi-hal",
        "libwifi-system-iface",
        "libxml2",
        "android.hardware.wifi-V1-ndk",
        "android.hardware.wifi-V2-ndk",
    ],
    static_libs: ["android.hardware.wifi-service-lib"],
    init_rc: ["android.hardware.wifi-service.rc"],
@@ -161,7 +161,7 @@ cc_binary {
        "libwifi-hal",
        "libwifi-system-iface",
        "libxml2",
        "android.hardware.wifi-V1-ndk",
        "android.hardware.wifi-V2-ndk",
    ],
    static_libs: ["android.hardware.wifi-service-lib"],
    init_rc: ["android.hardware.wifi-service-lazy.rc"],
@@ -192,7 +192,8 @@ cc_test {
    static_libs: [
        "libgmock",
        "libgtest",
        "android.hardware.wifi-V1-ndk",
        "android.hardware.wifi-V2-ndk",
        "android.hardware.wifi.common-V1-ndk",
        "android.hardware.wifi-service-lib",
    ],
    shared_libs: [
+1 −0
Original line number Diff line number Diff line
<manifest version="1.0" type="device">
	<hal format="aidl">
		<name>android.hardware.wifi</name>
		<version>2</version>
		<fqname>IWifi/default</fqname>
	</hal>
</manifest>
+20 −0
Original line number Diff line number Diff line
@@ -369,6 +369,14 @@ ndk::ScopedAStatus WifiChip::createBridgedApIface(std::shared_ptr<IWifiApIface>*
                           &WifiChip::createBridgedApIfaceInternal, _aidl_return);
}

ndk::ScopedAStatus WifiChip::createApOrBridgedApIface(
        IfaceConcurrencyType in_ifaceType, const std::vector<common::OuiKeyedData>& in_vendorData,
        std::shared_ptr<IWifiApIface>* _aidl_return) {
    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                           &WifiChip::createApOrBridgedApIfaceInternal, _aidl_return, in_ifaceType,
                           in_vendorData);
}

ndk::ScopedAStatus WifiChip::getApIfaceNames(std::vector<std::string>* _aidl_return) {
    return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
                           &WifiChip::getApIfaceNamesInternal, _aidl_return);
@@ -854,6 +862,18 @@ WifiChip::createBridgedApIfaceInternal() {
    return {iface, ndk::ScopedAStatus::ok()};
}

std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus>
WifiChip::createApOrBridgedApIfaceInternal(
        IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& /* vendorData */) {
    if (ifaceType == IfaceConcurrencyType::AP) {
        return createApIfaceInternal();
    } else if (ifaceType == IfaceConcurrencyType::AP_BRIDGED) {
        return createBridgedApIfaceInternal();
    } else {
        return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
    }
}

std::pair<std::vector<std::string>, ndk::ScopedAStatus> WifiChip::getApIfaceNamesInternal() {
    if (ap_ifaces_.empty()) {
        return {std::vector<std::string>(), ndk::ScopedAStatus::ok()};
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <aidl/android/hardware/wifi/BnWifiChip.h>
#include <aidl/android/hardware/wifi/IWifiRttController.h>
#include <aidl/android/hardware/wifi/common/OuiKeyedData.h>
#include <android-base/macros.h>

#include <list>
@@ -96,6 +97,10 @@ class WifiChip : public BnWifiChip {
    ndk::ScopedAStatus requestFirmwareDebugDump(std::vector<uint8_t>* _aidl_return) override;
    ndk::ScopedAStatus createApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
    ndk::ScopedAStatus createBridgedApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
    ndk::ScopedAStatus createApOrBridgedApIface(
            IfaceConcurrencyType in_ifaceType,
            const std::vector<common::OuiKeyedData>& in_vendorData,
            std::shared_ptr<IWifiApIface>* _aidl_return) override;
    ndk::ScopedAStatus getApIfaceNames(std::vector<std::string>* _aidl_return) override;
    ndk::ScopedAStatus getApIface(const std::string& in_ifname,
                                  std::shared_ptr<IWifiApIface>* _aidl_return) override;
@@ -176,6 +181,8 @@ class WifiChip : public BnWifiChip {
    ndk::ScopedAStatus createVirtualApInterface(const std::string& apVirtIf);
    std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApIfaceInternal();
    std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createBridgedApIfaceInternal();
    std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApOrBridgedApIfaceInternal(
            IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& vendorData);
    std::pair<std::vector<std::string>, ndk::ScopedAStatus> getApIfaceNamesInternal();
    std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> getApIfaceInternal(
            const std::string& ifname);