mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
wifi(vts): Set the iface up as a part of setup
Attempts to fix a VTS test failure reported by OEM's on devices supporting concurrent AP iface. Bug: 143096362 Test: make vts && vts-tradefed run commandAndExit vts --module VtsHalWifiV1_0Host Test: Will need to ask OEM to verify the fix. Change-Id: I0958d720411258761f4ac5bcccc823b06a55d518 Merged-In: I0958d720411258761f4ac5bcccc823b06a55d518
This commit is contained in:
@@ -28,7 +28,10 @@ cc_library_static {
|
||||
shared_libs: [
|
||||
"libnativehelper",
|
||||
],
|
||||
static_libs: ["android.hardware.wifi@1.0"],
|
||||
static_libs: [
|
||||
"android.hardware.wifi@1.0",
|
||||
"libwifi-system-iface"
|
||||
],
|
||||
}
|
||||
|
||||
cc_test {
|
||||
@@ -48,6 +51,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"],
|
||||
}
|
||||
@@ -62,6 +66,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"
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user