From f6abe359a88b10e96f5c34750df2726679496321 Mon Sep 17 00:00:00 2001 From: Sherri Lin Date: Fri, 30 Dec 2022 16:17:47 +0100 Subject: [PATCH] [Aware] Support set cluster id in AIDL Bug: 262872131 Test: ates android.net.wifi Change-Id: I08000c8200861c7fed191a079c5348158de41771 --- .../current/android/hardware/wifi/NanCapabilities.aidl | 1 + .../android/hardware/wifi/NanConfigRequestSupplemental.aidl | 1 + wifi/aidl/android/hardware/wifi/NanCapabilities.aidl | 4 ++++ .../android/hardware/wifi/NanConfigRequestSupplemental.aidl | 4 ++++ wifi/aidl/default/aidl_struct_util.cpp | 3 +++ 5 files changed, 13 insertions(+) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl index 5b59945ac3..cb5a95cc6c 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanCapabilities.aidl @@ -52,4 +52,5 @@ parcelable NanCapabilities { boolean supports6g; boolean supportsHe; boolean supportsPairing; + boolean supportsSetClusterId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl index 682699e7f4..99f2af771e 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequestSupplemental.aidl @@ -40,4 +40,5 @@ parcelable NanConfigRequestSupplemental { boolean enableRanging; boolean enableInstantCommunicationMode; int instantModeChannel; + int clusterId; } diff --git a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl index 0955b4cd9d..4160176a29 100644 --- a/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl +++ b/wifi/aidl/android/hardware/wifi/NanCapabilities.aidl @@ -97,4 +97,8 @@ parcelable NanCapabilities { * Flag to indicate if NAN pairing is supported. */ boolean supportsPairing; + /** + * Flag to indicate if NAN setting cluster ID is supported. + */ + boolean supportsSetClusterId; } diff --git a/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl b/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl index eb01a9f731..338a549aeb 100644 --- a/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl +++ b/wifi/aidl/android/hardware/wifi/NanConfigRequestSupplemental.aidl @@ -60,4 +60,8 @@ parcelable NanConfigRequestSupplemental { * Controls which channel NAN instant communication mode operates on. */ int instantModeChannel; + /** + * Controls which cluster to join. + */ + int clusterId; } diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 5e80ff9572..6869ac3c04 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -1706,6 +1706,8 @@ bool convertAidlNanConfigRequestToLegacy(const NanConfigRequest& aidl_request1, legacy_request->enable_instant_mode = aidl_request2.enableInstantCommunicationMode; legacy_request->config_instant_mode_channel = 1; legacy_request->instant_mode_channel = aidl_request2.instantModeChannel; + legacy_request->config_cluster_id = 1; + legacy_request->cluster_id_val = aidl_request2.clusterId; return true; } @@ -2245,6 +2247,7 @@ bool convertLegacyNanCapabilitiesResponseToAidl(const legacy_hal::NanCapabilitie aidl_response->supports6g = legacy_response.is_6g_supported; aidl_response->supportsHe = legacy_response.is_he_supported; aidl_response->supportsPairing = legacy_response.is_pairing_supported; + aidl_response->supportsSetClusterId = legacy_response.is_set_cluster_id_supported; return true; }