mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "wifi(vts): Set the iface up as a part of setup"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5e477278ec
@@ -30,6 +30,7 @@ cc_library_static {
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.wifi@1.0",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
}
|
||||
|
||||
@@ -49,6 +50,7 @@ cc_test {
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
@@ -66,6 +68,7 @@ cc_test {
|
||||
static_libs: [
|
||||
"VtsHalWifiV1_0TargetTestUtil",
|
||||
"android.hardware.wifi@1.0",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
@@ -83,6 +86,7 @@ cc_test {
|
||||
static_libs: [
|
||||
"VtsHalWifiV1_0TargetTestUtil",
|
||||
"android.hardware.wifi@1.0",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
|
||||
@@ -18,12 +18,15 @@
|
||||
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
|
||||
#include <wifi_system/interface_tool.h>
|
||||
|
||||
#include "wifi_hidl_call_util.h"
|
||||
#include "wifi_hidl_test_utils.h"
|
||||
|
||||
using ::android::hardware::wifi::V1_0::IWifi;
|
||||
using ::android::hardware::wifi::V1_0::IWifiApIface;
|
||||
using ::android::hardware::wifi::V1_0::IWifiChip;
|
||||
using ::android::hardware::wifi::V1_0::IWifiIface;
|
||||
using ::android::hardware::wifi::V1_0::IWifiNanIface;
|
||||
using ::android::hardware::wifi::V1_0::IWifiP2pIface;
|
||||
using ::android::hardware::wifi::V1_0::IWifiRttController;
|
||||
@@ -36,6 +39,7 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
|
||||
using ::android::sp;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::wifi_system::InterfaceTool;
|
||||
|
||||
extern WifiHidlEnvironment* gEnv;
|
||||
|
||||
@@ -131,6 +135,16 @@ sp<IWifiChip> getWifiChip(const std::string& instance_name) {
|
||||
return status_and_chip.second;
|
||||
}
|
||||
|
||||
void setIfaceUp(const sp<IWifiIface>& iface) {
|
||||
// Set the iface up before retrurning the object.
|
||||
const auto& status_and_name = HIDL_INVOKE(iface, getName);
|
||||
if (status_and_name.first.code == WifiStatusCode::SUCCESS) {
|
||||
const auto& iface_name = status_and_name.second;
|
||||
InterfaceTool iface_tool;
|
||||
iface_tool.SetUpState(iface_name.c_str(), true);
|
||||
}
|
||||
}
|
||||
|
||||
sp<IWifiApIface> getWifiApIface(const std::string& instance_name) {
|
||||
sp<IWifiChip> wifi_chip = getWifiChip(instance_name);
|
||||
if (!wifi_chip.get()) {
|
||||
@@ -143,6 +157,7 @@ sp<IWifiApIface> getWifiApIface(const std::string& instance_name) {
|
||||
if (status_and_iface.first.code != WifiStatusCode::SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
setIfaceUp(status_and_iface.second);
|
||||
return status_and_iface.second;
|
||||
}
|
||||
|
||||
@@ -158,6 +173,7 @@ sp<IWifiNanIface> getWifiNanIface(const std::string& instance_name) {
|
||||
if (status_and_iface.first.code != WifiStatusCode::SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
setIfaceUp(status_and_iface.second);
|
||||
return status_and_iface.second;
|
||||
}
|
||||
|
||||
@@ -173,6 +189,7 @@ sp<IWifiP2pIface> getWifiP2pIface(const std::string& instance_name) {
|
||||
if (status_and_iface.first.code != WifiStatusCode::SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
setIfaceUp(status_and_iface.second);
|
||||
return status_and_iface.second;
|
||||
}
|
||||
|
||||
@@ -188,6 +205,7 @@ sp<IWifiStaIface> getWifiStaIface(const std::string& instance_name) {
|
||||
if (status_and_iface.first.code != WifiStatusCode::SUCCESS) {
|
||||
return nullptr;
|
||||
}
|
||||
setIfaceUp(status_and_iface.second);
|
||||
return status_and_iface.second;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ cc_test {
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ cc_test {
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
@@ -44,6 +45,7 @@ cc_test {
|
||||
"android.hardware.wifi@1.0",
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
}
|
||||
|
||||
@@ -28,5 +28,6 @@ cc_test {
|
||||
"android.hardware.wifi@1.1",
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
}
|
||||
|
||||
@@ -29,5 +29,6 @@ cc_test {
|
||||
"android.hardware.wifi@1.2",
|
||||
"android.hardware.wifi@1.3",
|
||||
"android.hardware.wifi@1.4",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user