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

Commit d4d6796b authored by Les Lee's avatar Les Lee Committed by Android (Google) Code Review
Browse files

Merge "wifi: Upgrade hostapd HIDL to 1.3"

parents 62b6c51b df75bc1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@
    </hal>
    <hal format="hidl" optional="true">
        <name>android.hardware.wifi.hostapd</name>
        <version>1.0-2</version>
        <version>1.0-3</version>
        <interface>
            <name>IHostapd</name>
            <instance>default</instance>
+6 −2
Original line number Diff line number Diff line
@@ -25,11 +25,15 @@ cc_test {
        "VtsHalWifiHostapdV1_0TargetTestUtil",
        "android.hardware.wifi.hostapd@1.0",
        "android.hardware.wifi.hostapd@1.1",
        "android.hardware.wifi.hostapd@1.2",
        "android.hardware.wifi.hostapd@1.3",
        "android.hardware.wifi@1.0",
        "libgmock",
        "libwifi-system",
        "libwifi-system-iface",
    ],
    test_suites: ["general-tests", "vts"],
    test_suites: [
        "general-tests",
        "vts",
    ],
}
+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/hostapd/1.1/IHostapd.h>
#include <android/hardware/wifi/hostapd/1.3/IHostapd.h>

#include "hostapd_hidl_call_util.h"
#include "hostapd_hidl_test_utils.h"
@@ -43,6 +44,7 @@ constexpr unsigned char kNwSsid[] = {'t', 'e', 's', 't', '1',
constexpr char kNwPassphrase[] = "test12345";
constexpr int kIfaceChannel = 6;
constexpr int kIfaceInvalidChannel = 567;

}  // namespace

class HostapdHidlTest
@@ -170,10 +172,17 @@ class IfaceCallback : public IHostapdCallback {
    }
};

bool is_1_3(const sp<IHostapd>& hostapd) {
    sp<::android::hardware::wifi::hostapd::V1_3::IHostapd> hostapd_1_3 =
        ::android::hardware::wifi::hostapd::V1_3::IHostapd::castFrom(hostapd);
    return hostapd_1_3.get() != nullptr;
}

/*
 * RegisterCallback
 */
TEST_P(HostapdHidlTest, registerCallback) {
    if (is_1_3(hostapd_)) GTEST_SKIP() << "Ignore since current HIDL over 1.3";
    hostapd_->registerCallback(
        new IfaceCallback(), [](const HostapdStatus& status) {
            EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code);
+22 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen -Landroidbp.

hidl_interface {
    name: "android.hardware.wifi.hostapd@1.3",
    root: "android.hardware",
    srcs: [
        "types.hal",
        "IHostapd.hal",
        "IHostapdCallback.hal",
    ],
    interfaces: [
        "android.hardware.wifi.hostapd@1.0",
        "android.hardware.wifi.hostapd@1.1",
        "android.hardware.wifi.hostapd@1.2",
        "android.hardware.wifi.supplicant@1.0",
        "android.hidl.base@1.0",
    ],
    gen_java: true,
    apex_available: [
        "com.android.wifi",
    ],
}
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.wifi.hostapd@1.3;

import @1.2::IHostapd;
import @1.2::HostapdStatus;

import IHostapdCallback;
/**
 * Top-level object for managing SoftAPs.
 */
interface IHostapd extends @1.2::IHostapd {
    /**
     * Register for callbacks from the hostapd service.
     *
     * These callbacks are invoked for global events that are not specific
     * to any interface or network. Registration of multiple callback
     * objects is supported. These objects must be deleted when the corresponding
     * client process is dead.
     *
     * @param callback An instance of the |IHostapdCallback| HIDL interface
     *     object.
     * @return status Status of the operation.
     *     Possible status codes:
     *     |HostapdStatusCode.SUCCESS|,
     *     |HostapdStatusCode.FAILURE_UNKNOWN|
     */
    registerCallback_1_3(IHostapdCallback callback)
        generates (HostapdStatus status);
};
Loading