[AWARE] Support a mix of 1.0 and 1.2 Callback registration
Allow clients to register both 1.0 and 1.2 callback objects. Only
execute the new callbacks for 1.2 callback objects.
Purpose: allow 1.0 VTS tests to run as-is.
Bug: 71581915
Test: atest VtsHalWifiNanV1_0TargetTest
Test: act.py -c <path>/wifi_aware.json -tc ThroughputTest:test_iperf_single_ndp_aware_only_ib
Change-Id: I1e049498a0eaa176a6074c552b1a3c6f23d18fd0
diff --git a/wifi/1.2/default/wifi_nan_iface.h b/wifi/1.2/default/wifi_nan_iface.h
index a2dcf3a..dba527b 100644
--- a/wifi/1.2/default/wifi_nan_iface.h
+++ b/wifi/1.2/default/wifi_nan_iface.h
@@ -132,7 +132,7 @@
uint32_t ndpInstanceId);
WifiStatus registerEventCallback_1_2Internal(
- const sp<IWifiNanIfaceEventCallback>& callback);
+ const sp<V1_2::IWifiNanIfaceEventCallback>& callback);
WifiStatus enableRequest_1_2Internal(
uint16_t cmd_id, const NanEnableRequest& msg1,
const NanConfigRequestSupplemental& msg2);
@@ -140,13 +140,18 @@
uint16_t cmd_id, const NanConfigRequest& msg,
const NanConfigRequestSupplemental& msg2);
- std::set<sp<IWifiNanIfaceEventCallback>> getEventCallbacks();
+ // all 1_0 and descendant callbacks
+ std::set<sp<V1_0::IWifiNanIfaceEventCallback>> getEventCallbacks();
+ // all 1_2 and descendant callbacks
+ std::set<sp<V1_2::IWifiNanIfaceEventCallback>> getEventCallbacks_1_2();
std::string ifname_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
bool is_valid_;
- hidl_callback_util::HidlCallbackHandler<IWifiNanIfaceEventCallback>
+ hidl_callback_util::HidlCallbackHandler<V1_0::IWifiNanIfaceEventCallback>
event_cb_handler_;
+ hidl_callback_util::HidlCallbackHandler<V1_2::IWifiNanIfaceEventCallback>
+ event_cb_handler_1_2_;
DISALLOW_COPY_AND_ASSIGN(WifiNanIface);
};