Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c1b6780 authored by Kyounghan Lee's avatar Kyounghan Lee Committed by Roshan Pius
Browse files

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
parent 43f65e0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
}