Wifi: Handle subsystem restart notification
This commit adds the logic to handle a notification of a wifi subsystem
restart to trigger the callback to the framework for self recovery.
Bug: 159367026
Test: force a firmware restart and make sure Wifi is recovered.
Change-Id: If6b5863d1d7473917088ec5be1910fa0db5dd6ae
diff --git a/wifi/1.4/default/wifi_chip.h b/wifi/1.4/default/wifi_chip.h
index 98e18bb..e7650bd 100644
--- a/wifi/1.4/default/wifi_chip.h
+++ b/wifi/1.4/default/wifi_chip.h
@@ -50,13 +50,14 @@
*/
class WifiChip : public V1_4::IWifiChip {
public:
- WifiChip(
- ChipId chip_id,
- const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
- const std::weak_ptr<mode_controller::WifiModeController>
- mode_controller,
- const std::weak_ptr<iface_util::WifiIfaceUtil> iface_util,
- const std::weak_ptr<feature_flags::WifiFeatureFlags> feature_flags);
+ WifiChip(ChipId chip_id,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal,
+ const std::weak_ptr<mode_controller::WifiModeController>
+ mode_controller,
+ const std::weak_ptr<iface_util::WifiIfaceUtil> iface_util,
+ const std::weak_ptr<feature_flags::WifiFeatureFlags> feature_flags,
+ const std::function<void(const std::string&)>&
+ subsystemCallbackHandler);
// HIDL does not provide a built-in mechanism to let the server invalidate
// a HIDL interface object after creation. If any client process holds onto
// a reference to the object in their context, any method calls on that
@@ -282,6 +283,8 @@
hidl_callback_util::HidlCallbackHandler<IWifiChipEventCallback>
event_cb_handler_;
+ const std::function<void(const std::string&)> subsystemCallbackHandler_;
+
DISALLOW_COPY_AND_ASSIGN(WifiChip);
};