Revert "Remove dependencies on the HIDL Vendor HAL from"
This reverts commit fc6bd8c564604a27aacfb4c7aea39bb7c12efd64.
Reason for revert: Blocking Wembley team
Bug: 261042084
Test: Local test as in 261042084#comment8
Change-Id: I9103fa8bdcdea48648574f034c51ea8f2b9c25cc
diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp
index a9fdec8..e61d397 100644
--- a/wifi/hostapd/aidl/vts/functional/Android.bp
+++ b/wifi/hostapd/aidl/vts/functional/Android.bp
@@ -20,10 +20,20 @@
"libvndksupport",
],
static_libs: [
- "android.hardware.wifi-V1-ndk",
"android.hardware.wifi.hostapd-V1-ndk",
- "libwifi-system-iface",
- "VtsHalWifiTargetTestUtil",
+ "VtsHalWifiV1_0TargetTestUtil",
+ "VtsHalWifiV1_5TargetTestUtil",
+ "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",
+ "android.hardware.wifi@1.1",
+ "android.hardware.wifi@1.2",
+ "android.hardware.wifi@1.3",
+ "android.hardware.wifi@1.4",
+ "android.hardware.wifi@1.5",
],
test_suites: [
"general-tests",
diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
index 65ffa7b..bd2649f 100644
--- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
+++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
@@ -13,7 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <aidl/android/hardware/wifi/IWifi.h>
+#include <android/hardware/wifi/1.0/IWifi.h>
+#include <android/hardware/wifi/hostapd/1.3/IHostapd.h>
#include <VtsCoreUtil.h>
#include <aidl/Gtest.h>
@@ -23,11 +24,12 @@
#include <android/binder_manager.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
+#include <hidl/ServiceManagement.h>
+#include <hostapd_hidl_call_util.h>
+#include <hostapd_hidl_test_utils.h>
+#include <wifi_hidl_test_utils.h>
+#include <wifi_hidl_test_utils_1_5.h>
-#include "wifi_aidl_test_utils.h"
-
-using aidl::android::hardware::wifi::IWifi;
-using aidl::android::hardware::wifi::IWifiApIface;
using aidl::android::hardware::wifi::hostapd::BandMask;
using aidl::android::hardware::wifi::hostapd::BnHostapdCallback;
using aidl::android::hardware::wifi::hostapd::ChannelBandwidth;
@@ -42,8 +44,6 @@
using android::ProcessState;
namespace {
-const std::string kWifiInstanceNameStr = std::string() + IWifi::descriptor + "/default";
-const char* kWifiInstanceName = kWifiInstanceNameStr.c_str();
const unsigned char kNwSsid[] = {'t', 'e', 's', 't', '1', '2', '3', '4', '5'};
const std::string kPassphrase = "test12345";
const std::string kInvalidMinPassphrase = "test";
@@ -75,13 +75,17 @@
"/system/bin/cmd wifi get-softap-supported-features",
"wifi_softap_wpa3_sae_supported");
isBridgedSupport = testing::checkSubstringInCommandOutput(
- "/system/bin/cmd wifi get-softap-supported-features",
- "wifi_softap_bridged_ap_supported");
+ "/system/bin/cmd wifi get-softap-supported-features",
+ "wifi_softap_bridged_ap_supported");
+ const std::vector<std::string> instances = android::hardware::getAllHalInstanceNames(
+ ::android::hardware::wifi::V1_0::IWifi::descriptor);
+ EXPECT_NE(0, instances.size());
+ wifiInstanceName = instances[0];
}
virtual void TearDown() override {
- if (getWifi(kWifiInstanceName) != nullptr) {
- stopWifiService(kWifiInstanceName);
+ if (getWifi(wifiInstanceName) != nullptr) {
+ stopWifi(wifiInstanceName);
}
hostapd->terminate();
// Wait 3 seconds to allow terminate to complete
@@ -89,23 +93,24 @@
}
std::shared_ptr<IHostapd> hostapd;
+ std::string wifiInstanceName;
bool isAcsSupport;
bool isWpa3SaeSupport;
bool isBridgedSupport;
std::string setupApIfaceAndGetName(bool isBridged) {
- std::shared_ptr<IWifiApIface> wifi_ap_iface;
+ android::sp<::android::hardware::wifi::V1_0::IWifiApIface> wifi_ap_iface;
if (isBridged) {
- wifi_ap_iface = getBridgedWifiApIface(kWifiInstanceName);
+ wifi_ap_iface = getBridgedWifiApIface_1_5(wifiInstanceName);
} else {
- wifi_ap_iface = getWifiApIface(kWifiInstanceName);
+ wifi_ap_iface = getWifiApIface_1_5(wifiInstanceName);
}
EXPECT_NE(nullptr, wifi_ap_iface.get());
- std::string ap_iface_name;
- auto status = wifi_ap_iface->getName(&ap_iface_name);
- EXPECT_TRUE(status.isOk());
- return ap_iface_name;
+ const auto& status_and_name = HIDL_INVOKE(wifi_ap_iface, getName);
+ EXPECT_EQ(android::hardware::wifi::V1_0::WifiStatusCode::SUCCESS,
+ status_and_name.first.code);
+ return status_and_name.second;
}
IfaceParams getIfaceParamsWithoutAcs(std::string iface_name) {