From c4d9f87f66130c1e0b598fd0903ea2f99e8dfb5e Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Thu, 15 Jun 2017 08:39:23 -0700 Subject: [PATCH] [AWARE] Actually shut-down functionality when destroying NAN iface Destroying the interface doesn't actually execute any functions on the legacy HAL - i.e. on the HAL side. This may leave state around - a problem when next "re-enabling" the interface as well as possibly a power issue. Add code to actually disable Aware and to destroy interfaces. There is no need to check on current status since calls will simply fail quietly if there's nothing to disable and nothing to destroy. Bug: 62632805 Test: integration non-concurrence test cases NonConcurrencyTest Change-Id: I11e5bd6f3ed47f6d709ff360c9f4adf5f40234a5 --- wifi/1.0/default/wifi_nan_iface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp index 1072015a2f..88fb5b201c 100644 --- a/wifi/1.0/default/wifi_nan_iface.cpp +++ b/wifi/1.0/default/wifi_nan_iface.cpp @@ -420,6 +420,11 @@ WifiNanIface::WifiNanIface( } void WifiNanIface::invalidate() { + // send commands to HAL to actually disable and destroy interfaces + legacy_hal_.lock()->nanDisableRequest(0xFFFF); + legacy_hal_.lock()->nanDataInterfaceDelete(0xFFFE, "aware_data0"); + legacy_hal_.lock()->nanDataInterfaceDelete(0xFFFD, "aware_data1"); + legacy_hal_.reset(); event_cb_handler_.invalidate(); is_valid_ = false;