diff options
author | Kyounghan Lee <kyounghan.lee@samsung.com> | 2020-01-29 14:56:15 +0900 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-01-29 11:09:41 -0800 |
commit | 4c1b6780b4fd2111a23ee47e9aab0a6ec7aa8b82 (patch) | |
tree | 260c3abf5719ac00fb404efc9457e2767bd73921 | |
parent | 43f65e0f60a552d867b6aace75aeee58c0e4f08d (diff) | |
download | android_hardware_interfaces-4c1b6780b4fd2111a23ee47e9aab0a6ec7aa8b82.tar.gz android_hardware_interfaces-4c1b6780b4fd2111a23ee47e9aab0a6ec7aa8b82.tar.bz2 android_hardware_interfaces-4c1b6780b4fd2111a23ee47e9aab0a6ec7aa8b82.zip |
wifi(implementation): Clear wifi event callback objects while stopping
This fixes a deadlock between WifiNative and HalDeviceManager
because it removes about 30 times callbacks of
IWifiEventCallback#onFailure() or onStop(). Such excessive callbacks
within a short period tend to make high probabilities of the deadlock.
Note: This is a side effect of how the framework is registering multiple
callbacks. But, unfortunately there is no HAL API to unregister
callback. So, this is somewhat of a workaround fix.
Bug: 144137870
Test: Verified that the HAL no longer accumulates callbacks from
framework.
Test: Device boots up and connects to wifi networks.
Change-Id: I441e2f815a0a49c3936615f06a65a6ed5366a628
Merged-In: I441e2f815a0a49c3936615f06a65a6ed5366a628
-rw-r--r-- | wifi/1.3/default/wifi.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wifi/1.3/default/wifi.cpp b/wifi/1.3/default/wifi.cpp index 2f21819db..4229d352d 100644 --- a/wifi/1.3/default/wifi.cpp +++ b/wifi/1.3/default/wifi.cpp @@ -124,6 +124,8 @@ WifiStatus Wifi::startInternal() { } } LOG(ERROR) << "Wifi HAL start failed"; + // Clear the event callback objects since the HAL start failed. + event_cb_handler_.invalidate(); } return wifi_status; } @@ -158,6 +160,8 @@ WifiStatus Wifi::stopInternal( } LOG(ERROR) << "Wifi HAL stop failed"; } + // Clear the event callback objects since the HAL is now stopped. + event_cb_handler_.invalidate(); return wifi_status; } |