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

Commit 09f373d6 authored by Oleh Cherpak's avatar Oleh Cherpak Committed by Roshan Pius
Browse files

vts: hostapd: Remove optional service registration



Wifi VendorHAL is optional for Soft AP mode to function.
Tests should be runnable even on devices without VendorHAL.

Test: run vts -m VtsHalWifiHostapdV1_1Target
Bug: 148907288
Bug: 158343986

Signed-off-by: default avatarOleh Cherpak <oleh.cherpak@globallogic.com>
Change-Id: Id65d09d39d93e540a24e58fda233fd2faf8c3258
Merged-In: Id65d09d39d93e540a24e58fda233fd2faf8c3258
parent ec37ce49
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -89,8 +89,12 @@ bool configureChipToSupportIfaceTypeInternal(const sp<IWifiChip>& wifi_chip,
}
}  // namespace

sp<IWifi> getWifi(const std::string& instance_name) {
    return IWifi::getService(instance_name);
}

sp<IWifiChip> getWifiChip(const std::string& instance_name) {
    sp<IWifi> wifi = IWifi::getService(instance_name);
    sp<IWifi> wifi = getWifi(instance_name);
    if (!wifi.get()) {
        return nullptr;
    }
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@
// Note: We only have a single instance of each of these objects currently.
// These helper functions should be modified to return vectors if we support
// multiple instances.
android::sp<android::hardware::wifi::V1_0::IWifi> getWifi(
    const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiChip> getWifiChip(
    const std::string& instance_name);
android::sp<android::hardware::wifi::V1_0::IWifiApIface> getWifiApIface(
+13 −5
Original line number Diff line number Diff line
@@ -47,16 +47,24 @@ namespace {
// Helper function to initialize the driver and firmware to AP mode
// using the vendor HAL HIDL interface.
void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
    if (getWifi(wifi_instance_name) != nullptr) {
        sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
        ChipModeId mode_id;
        EXPECT_TRUE(configureChipToSupportIfaceType(
            wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::AP, &mode_id));
    } else {
        LOG(WARNING) << __func__ << ": Vendor HAL not supported";
    }
}

// Helper function to deinitialize the driver and firmware
// using the vendor HAL HIDL interface.
void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
    if (getWifi(wifi_instance_name) != nullptr) {
        stopWifi(wifi_instance_name);
    } else {
        LOG(WARNING) << __func__ << ": Vendor HAL not supported";
    }
}
}  // namespace