vts: Use global hostapd_ since teardown will call terminate function
aosp/1427815 add invoke terminate function in teardown function.
It will cause Create Test case fail since Create killed global hostapd_
service to re-generate the local one.
Use global hostapd_ to replace local variable to make teardown function
work normally.
Bug: 169248773
Test: atest -c VtsHalWifiHostapdV1_2TargetTest
Test: atest -c VtsHalWifiHostapdV1_1TargetTest
Test: atest -c VtsHalWifiHostapdV1_0TargetTest
Change-Id: I6300a626db76e68873bbc34c489a9a8ee2d55e7a
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
index 21d2064..2b46058 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
@@ -145,8 +145,8 @@
stopHostapd(wifi_instance_name_);
startHostapdAndWaitForHidlService(wifi_instance_name_,
hostapd_instance_name_);
- sp<IHostapd> hostapd = IHostapd::getService(hostapd_instance_name_);
- EXPECT_NE(nullptr, hostapd.get());
+ hostapd_ = IHostapd::getService(hostapd_instance_name_);
+ EXPECT_NE(nullptr, hostapd_.get());
}
/**