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

Commit 5dc0eb2b authored by Oleh Cherpak's avatar Oleh Cherpak Committed by Automerger Merge Worker
Browse files

vts: hostapd: Remove optional service registration am: 09f373d6 am: 10a678b8

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12131483

Change-Id: I17cd12f6a4866c4082fb8d80bc4bdb875711ae29
parents b55fb597 10a678b8
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