From f8e4a123d891f417589bc08fbb097817a8540225 Mon Sep 17 00:00:00 2001 From: Gabriel Biren Date: Wed, 27 Dec 2023 00:43:21 +0000 Subject: [PATCH] Address ANAPIC feedback for Supplicant V3 and Vendor HAL V2. Comments addressed include: - Indicate version where methods were deprecated. - Bitmasks should use an int rather than an enum. - Use 'us' suffix instead of 'micros' for consistency with the rest of the interface. Bug: 317404786 Test: m Change-Id: I026479aaa3f358913f61c6505ff9dccb0edc5ae8 --- .../hardware/wifi/RttCapabilities.aidl | 4 +-- .../hardware/wifi/TwtCapabilities.aidl | 8 ++--- .../android/hardware/wifi/TwtRequest.aidl | 8 ++--- .../android/hardware/wifi/TwtSession.aidl | 4 +-- .../hardware/wifi/TwtSessionStats.aidl | 2 +- .../hardware/wifi/RttCapabilities.aidl | 4 +-- .../hardware/wifi/TwtCapabilities.aidl | 8 ++--- .../android/hardware/wifi/TwtRequest.aidl | 8 ++--- .../android/hardware/wifi/TwtSession.aidl | 4 +-- .../hardware/wifi/TwtSessionStats.aidl | 2 +- wifi/aidl/default/aidl_struct_util.cpp | 34 +++++++++---------- .../ISupplicantP2pIfaceCallback.aidl | 2 +- .../ISupplicantStaIfaceCallback.aidl | 2 +- ...rovisionDiscoveryCompletedEventParams.aidl | 2 +- .../ISupplicantP2pIfaceCallback.aidl | 2 +- .../ISupplicantStaIfaceCallback.aidl | 2 +- ...rovisionDiscoveryCompletedEventParams.aidl | 5 ++- 17 files changed, 50 insertions(+), 51 deletions(-) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl index 83f3f7e30d..af1647dd5d 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl @@ -42,8 +42,8 @@ parcelable RttCapabilities { android.hardware.wifi.RttPreamble preambleSupport; android.hardware.wifi.RttBw bwSupport; byte mcVersion; - android.hardware.wifi.RttPreamble azPreambleSupport; - android.hardware.wifi.RttBw azBwSupport; + int azPreambleSupport; + int azBwSupport; boolean ntbInitiatorSupported; boolean ntbResponderSupported; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl index d6ed62e943..75f3e83829 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl @@ -38,8 +38,8 @@ parcelable TwtCapabilities { boolean isTwtResponderSupported; boolean isBroadcastTwtSupported; boolean isFlexibleTwtScheduleSupported; - int minWakeDurationMicros; - int maxWakeDurationMicros; - long minWakeIntervalMicros; - long maxWakeIntervalMicros; + int minWakeDurationUs; + int maxWakeDurationUs; + long minWakeIntervalUs; + long maxWakeIntervalUs; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl index 06c7ae2433..1e1c39a914 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl @@ -35,8 +35,8 @@ package android.hardware.wifi; @VintfStability parcelable TwtRequest { int mloLinkId; - int minWakeDurationMicros; - int maxWakeDurationMicros; - long minWakeIntervalMicros; - long maxWakeIntervalMicros; + int minWakeDurationUs; + int maxWakeDurationUs; + long minWakeIntervalUs; + long maxWakeIntervalUs; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl index 4e5ca44f17..0b88d8e75d 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl @@ -36,8 +36,8 @@ package android.hardware.wifi; parcelable TwtSession { int sessionId; int mloLinkId; - int wakeDurationMicros; - long wakeIntervalMicros; + int wakeDurationUs; + long wakeIntervalUs; android.hardware.wifi.TwtSession.TwtNegotiationType negotiationType; boolean isTriggerEnabled; boolean isAnnounced; diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl index 528444a84b..f62b614146 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl @@ -38,6 +38,6 @@ parcelable TwtSessionStats { int avgRxPktCount; int avgTxPktSize; int avgRxPktSize; - int avgEospDurationMicros; + int avgEospDurationUs; int eospCount; } diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl index c4b7d24b6f..89b70c9e00 100644 --- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl +++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl @@ -64,12 +64,12 @@ parcelable RttCapabilities { * Bit mask indicating what preamble is supported by IEEE 802.11az initiator. * Combination of |RttPreamble| values. */ - RttPreamble azPreambleSupport; + int azPreambleSupport; /** * Bit mask indicating what BW is supported by IEEE 802.11az initiator. * Combination of |RttBw| values. */ - RttBw azBwSupport; + int azBwSupport; /** * Whether the initiator supports IEEE 802.11az Non-Trigger-based (non-TB) measurement. */ diff --git a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl index 4012c3ed73..5d68a5727f 100644 --- a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl +++ b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl @@ -40,17 +40,17 @@ parcelable TwtCapabilities { /** * Minimum TWT wake duration in microseconds. */ - int minWakeDurationMicros; + int minWakeDurationUs; /** * Maximum TWT wake duration in microseconds. */ - int maxWakeDurationMicros; + int maxWakeDurationUs; /** * Minimum TWT wake interval in microseconds. */ - long minWakeIntervalMicros; + long minWakeIntervalUs; /** * Maximum TWT wake interval in microseconds. */ - long maxWakeIntervalMicros; + long maxWakeIntervalUs; } diff --git a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl index b063da3911..cdb9a7dea0 100644 --- a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl @@ -28,17 +28,17 @@ parcelable TwtRequest { /** * Minimum TWT wake duration in microseconds. */ - int minWakeDurationMicros; + int minWakeDurationUs; /** * Maximum TWT wake duration in microseconds. */ - int maxWakeDurationMicros; + int maxWakeDurationUs; /** * Minimum TWT wake interval in microseconds. */ - long minWakeIntervalMicros; + long minWakeIntervalUs; /** * Maximum TWT wake interval in microseconds. */ - long maxWakeIntervalMicros; + long maxWakeIntervalUs; } diff --git a/wifi/aidl/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/android/hardware/wifi/TwtSession.aidl index 6b780f8343..2d7e819df7 100644 --- a/wifi/aidl/android/hardware/wifi/TwtSession.aidl +++ b/wifi/aidl/android/hardware/wifi/TwtSession.aidl @@ -41,12 +41,12 @@ parcelable TwtSession { /** * TWT service period in microseconds. */ - int wakeDurationMicros; + int wakeDurationUs; /** * Time interval in microseconds between two successive TWT service periods. */ - long wakeIntervalMicros; + long wakeIntervalUs; /** * TWT negotiation type. diff --git a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl index e2e2d12b7e..ba70426da1 100644 --- a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl +++ b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl @@ -44,7 +44,7 @@ parcelable TwtSessionStats { /** * Average End of Service period in microseconds. */ - int avgEospDurationMicros; + int avgEospDurationUs; /** * Count of early terminations. diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 7e7929d392..836ce1a9b6 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -2886,8 +2886,8 @@ bool convertLegacyRttCapabilitiesToAidl( aidl_capabilities->bwSupport = convertLegacyRttBwBitmapToAidl(legacy_capabilities.bw_support); aidl_capabilities->mcVersion = legacy_capabilities.mc_version; // Initialize 11az parameters to default - aidl_capabilities->azPreambleSupport = RttPreamble::INVALID; - aidl_capabilities->azBwSupport = RttBw::BW_UNSPECIFIED; + aidl_capabilities->azPreambleSupport = (int)RttPreamble::INVALID; + aidl_capabilities->azBwSupport = (int)RttBw::BW_UNSPECIFIED; aidl_capabilities->ntbInitiatorSupported = false; aidl_capabilities->ntbResponderSupported = false; return true; @@ -2912,9 +2912,9 @@ bool convertLegacyRttCapabilitiesV3ToAidl( convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.rtt_capab.bw_support); aidl_capabilities->mcVersion = legacy_capabilities_v3.rtt_capab.mc_version; aidl_capabilities->azPreambleSupport = - convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support); + (int)convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support); aidl_capabilities->azBwSupport = - convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support); + (int)convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support); aidl_capabilities->ntbInitiatorSupported = legacy_capabilities_v3.ntb_initiator_supported; aidl_capabilities->ntbResponderSupported = legacy_capabilities_v3.ntb_responder_supported; return true; @@ -3587,13 +3587,13 @@ bool convertTwtCapabilitiesToAidl(legacy_hal::wifi_twt_capabilities legacy_twt_c if (legacy_twt_capabs.min_wake_duration_micros > legacy_twt_capabs.max_wake_duration_micros) { return false; } - aidl_twt_capabs->minWakeDurationMicros = legacy_twt_capabs.min_wake_duration_micros; - aidl_twt_capabs->maxWakeDurationMicros = legacy_twt_capabs.max_wake_duration_micros; + aidl_twt_capabs->minWakeDurationUs = legacy_twt_capabs.min_wake_duration_micros; + aidl_twt_capabs->maxWakeDurationUs = legacy_twt_capabs.max_wake_duration_micros; if (legacy_twt_capabs.min_wake_interval_micros > legacy_twt_capabs.max_wake_interval_micros) { return false; } - aidl_twt_capabs->minWakeIntervalMicros = legacy_twt_capabs.min_wake_interval_micros; - aidl_twt_capabs->maxWakeIntervalMicros = legacy_twt_capabs.max_wake_interval_micros; + aidl_twt_capabs->minWakeIntervalUs = legacy_twt_capabs.min_wake_interval_micros; + aidl_twt_capabs->maxWakeIntervalUs = legacy_twt_capabs.max_wake_interval_micros; return true; } @@ -3603,16 +3603,16 @@ bool convertAidlTwtRequestToLegacy(const TwtRequest aidl_twt_request, return false; } legacy_twt_request->mlo_link_id = aidl_twt_request.mloLinkId; - if (aidl_twt_request.minWakeDurationMicros > aidl_twt_request.maxWakeDurationMicros) { + if (aidl_twt_request.minWakeDurationUs > aidl_twt_request.maxWakeDurationUs) { return false; } - legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationMicros; - legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationMicros; - if (aidl_twt_request.minWakeIntervalMicros > aidl_twt_request.maxWakeIntervalMicros) { + legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationUs; + legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationUs; + if (aidl_twt_request.minWakeIntervalUs > aidl_twt_request.maxWakeIntervalUs) { return false; } - legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalMicros; - legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalMicros; + legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalUs; + legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalUs; return true; } @@ -3664,8 +3664,8 @@ bool convertLegacyHalTwtSessionToAidl(legacy_hal::wifi_twt_session twt_session, aidl_twt_session->sessionId = twt_session.session_id; aidl_twt_session->mloLinkId = twt_session.mlo_link_id; - aidl_twt_session->wakeDurationMicros = twt_session.wake_duration_micros; - aidl_twt_session->wakeIntervalMicros = twt_session.wake_interval_micros; + aidl_twt_session->wakeDurationUs = twt_session.wake_duration_micros; + aidl_twt_session->wakeIntervalUs = twt_session.wake_interval_micros; switch (twt_session.negotiation_type) { case WIFI_TWT_NEGO_TYPE_INDIVIDUAL: aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::INDIVIDUAL; @@ -3696,7 +3696,7 @@ bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats tw aidl_twt_stats->avgRxPktCount = twt_stats.avg_pkt_num_rx; aidl_twt_stats->avgTxPktSize = twt_stats.avg_tx_pkt_size; aidl_twt_stats->avgRxPktSize = twt_stats.avg_rx_pkt_size; - aidl_twt_stats->avgEospDurationMicros = twt_stats.avg_eosp_dur_us; + aidl_twt_stats->avgEospDurationUs = twt_stats.avg_eosp_dur_us; aidl_twt_stats->eospCount = twt_stats.eosp_count; return true; diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 851e85107b..4811565b44 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -35,7 +35,7 @@ package android.hardware.wifi.supplicant; @VintfStability interface ISupplicantP2pIfaceCallback { /** - * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDeviceFoundWithParams. + * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onDeviceFoundWithParams. */ oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo); oneway void onDeviceLost(in byte[] p2pDeviceAddress); diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 898c2d4dd7..9fa8f56cd5 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -54,7 +54,7 @@ interface ISupplicantStaIfaceCallback { oneway void onExtRadioWorkTimeout(in int id); oneway void onHs20DeauthImminentNotice(in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url); /** - * @deprecated No longer in use. + * @deprecated This callback is deprecated from AIDL v3. */ oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data); oneway void onHs20SubscriptionRemediation(in byte[] bssid, in android.hardware.wifi.supplicant.OsuMethod osuMethod, in String url); diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl index 0ff06536b3..46366cc8d3 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl @@ -37,7 +37,7 @@ parcelable P2pProvisionDiscoveryCompletedEventParams { byte[6] p2pDeviceAddress; boolean isRequest; android.hardware.wifi.supplicant.P2pProvDiscStatusCode status; - android.hardware.wifi.supplicant.WpsConfigMethods configMethods; + int configMethods; String generatedPin; String groupInterfaceName; @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData; diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl index 11cd867933..b9273a83ea 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl @@ -40,7 +40,7 @@ oneway interface ISupplicantP2pIfaceCallback { /** * Used to indicate that a P2P device has been found. *

- * @deprecated This callback is deprecated from AIDL v2, newer HAL should call + * @deprecated This callback is deprecated from AIDL v3, newer HAL should call * onDeviceFoundWithParams. * * @param srcAddress MAC address of the device found. This must either diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 58893ebf66..172fcda26f 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -198,7 +198,7 @@ oneway interface ISupplicantStaIfaceCallback { /** * Used to indicate the result of Hotspot 2.0 Icon query. * - * @deprecated No longer in use. + * @deprecated This callback is deprecated from AIDL v3. * * @param bssid BSSID of the access point. * @param fileName Name of the file that was requested. diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl index b559216611..05152a9454 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl @@ -18,7 +18,6 @@ package android.hardware.wifi.supplicant; import android.hardware.wifi.common.OuiKeyedData; import android.hardware.wifi.supplicant.P2pProvDiscStatusCode; -import android.hardware.wifi.supplicant.WpsConfigMethods; /** * Parameters passed as a part of P2P provision discovery frame notification. @@ -34,8 +33,8 @@ parcelable P2pProvisionDiscoveryCompletedEventParams { boolean isRequest; /** Status of the provision discovery */ P2pProvDiscStatusCode status; - /** Mask of WPS configuration methods supported */ - WpsConfigMethods configMethods; + /** Mask of |WpsConfigMethods| indicating the supported methods */ + int configMethods; /** 8-digit pin generated */ String generatedPin; /**