Merge "Convert NAN enums that are used as bitmaps to an int." into udc-dev

This commit is contained in:
TreeHugger Robot
2023-03-03 21:51:58 +00:00
committed by Android (Google) Code Review
7 changed files with 20 additions and 23 deletions

View File

@@ -47,7 +47,7 @@ parcelable NanCapabilities {
int maxAppInfoLen;
int maxQueuedTransmitFollowupMsgs;
int maxSubscribeInterfaceAddresses;
android.hardware.wifi.NanCipherSuiteType supportedCipherSuites;
int supportedCipherSuites;
boolean instantCommunicationModeSupportFlag;
boolean supports6g;
boolean supportsHe;

View File

@@ -51,7 +51,7 @@ parcelable NanDiscoveryCommonConfig {
android.hardware.wifi.NanDataPathSecurityConfig securityConfig;
boolean rangingRequired;
int rangingIntervalMs;
android.hardware.wifi.NanRangingIndication configRangingIndications;
int configRangingIndications;
char distanceIngressCm;
char distanceEgressCm;
boolean enableSessionSuspendability;

View File

@@ -47,7 +47,7 @@ parcelable NanMatchInd {
boolean peerRequiresSecurityEnabledInNdp;
boolean peerRequiresRanging;
int rangingMeasurementInMm;
android.hardware.wifi.NanRangingIndication rangingIndicationType;
int rangingIndicationType;
byte[] scid;
android.hardware.wifi.NanPairingConfig peerPairingConfig;
android.hardware.wifi.NanIdentityResolutionAttribute peerNira;

View File

@@ -16,8 +16,6 @@
package android.hardware.wifi;
import android.hardware.wifi.NanCipherSuiteType;
/**
* NDP Capabilities response.
*/
@@ -78,9 +76,9 @@ parcelable NanCapabilities {
*/
int maxSubscribeInterfaceAddresses;
/**
* The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
* Bitmap of |NanCipherSuiteType| values indicating the set of supported cipher suites.
*/
NanCipherSuiteType supportedCipherSuites;
int supportedCipherSuites;
/**
* Flag to indicate if instant communication mode is supported.
*/

View File

@@ -18,7 +18,6 @@ package android.hardware.wifi;
import android.hardware.wifi.NanDataPathSecurityConfig;
import android.hardware.wifi.NanMatchAlg;
import android.hardware.wifi.NanRangingIndication;
/**
* Configurations of NAN discovery sessions. Common to publish and subscribe discovery.
@@ -143,10 +142,11 @@ parcelable NanDiscoveryCommonConfig {
*/
int rangingIntervalMs;
/**
* The type of ranging feedback to be provided by discovery session matches
* |IWifiNanIfaceEventCallback.eventMatch|. Only relevant if |rangingRequired| is true.
* Bitmap of |NanRangingIndication| values indicating the type of ranging feedback
* to be provided by discovery session matches in |IWifiNanIfaceEventCallback.eventMatch|.
* Only relevant if |rangingRequired| is true.
*/
NanRangingIndication configRangingIndications;
int configRangingIndications;
/**
* The ingress and egress distance in cm. If ranging is enabled (|rangingEnabled| is true) then
* |configRangingIndications| is used to determine whether ingress and/or egress (or neither)

View File

@@ -19,7 +19,6 @@ package android.hardware.wifi;
import android.hardware.wifi.NanCipherSuiteType;
import android.hardware.wifi.NanIdentityResolutionAttribute;
import android.hardware.wifi.NanPairingConfig;
import android.hardware.wifi.NanRangingIndication;
/**
* Match indication structure.
@@ -81,8 +80,9 @@ parcelable NanMatchInd {
*/
byte rssiValue;
/**
* Cipher type for data-paths constructed in the context of this discovery session. Valid if
* |peerRequiresSecurityEnabledInNdp| is true.
* One of |NanCipherSuiteType| indicating the cipher type for data-paths constructed
* in the context of this discovery session.
* Valid if |peerRequiresSecurityEnabledInNdp| is true.
*/
NanCipherSuiteType peerCipherType;
/**
@@ -117,10 +117,11 @@ parcelable NanMatchInd {
*/
int rangingMeasurementInMm;
/**
* The ranging event(s) which triggered the ranging. e.g. can indicate that continuous ranging
* was requested, or else that an ingress event occurred.
* Bitmap of |NanRangingIndication| values indicating the ranging event(s) which triggered the
* ranging. e.g. can indicate that continuous ranging was requested, or else that an ingress
* event occurred.
*/
NanRangingIndication rangingIndicationType;
int rangingIndicationType;
/**
* Security Context Identifier attribute contains PMKID. Shall be included in NDP setup and
* response messages. Security Context Identifier identifies the Security Context. For NAN

View File

@@ -1787,7 +1787,7 @@ bool convertAidlNanPublishRequestToLegacy(const NanPublishRequest& aidl_request,
: legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs;
legacy_request->ranging_cfg.config_ranging_indications =
static_cast<uint32_t>(aidl_request.baseConfigs.configRangingIndications);
aidl_request.baseConfigs.configRangingIndications;
legacy_request->ranging_cfg.distance_ingress_mm =
aidl_request.baseConfigs.distanceIngressCm * 10;
legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
@@ -1919,7 +1919,7 @@ bool convertAidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& aidl_requ
: legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = aidl_request.baseConfigs.rangingIntervalMs;
legacy_request->ranging_cfg.config_ranging_indications =
static_cast<uint32_t>(aidl_request.baseConfigs.configRangingIndications);
aidl_request.baseConfigs.configRangingIndications;
legacy_request->ranging_cfg.distance_ingress_mm =
aidl_request.baseConfigs.distanceIngressCm * 10;
legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
@@ -2202,8 +2202,7 @@ bool convertLegacyNanCapabilitiesResponseToAidl(const legacy_hal::NanCapabilitie
aidl_response->maxQueuedTransmitFollowupMsgs =
legacy_response.max_queued_transmit_followup_msgs;
aidl_response->maxSubscribeInterfaceAddresses = legacy_response.max_subscribe_address;
aidl_response->supportedCipherSuites =
static_cast<NanCipherSuiteType>(legacy_response.cipher_suites_supported);
aidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported;
aidl_response->instantCommunicationModeSupportFlag = legacy_response.is_instant_mode_supported;
aidl_response->supports6g = legacy_response.is_6g_supported;
aidl_response->supportsHe = legacy_response.is_he_supported;
@@ -2244,8 +2243,7 @@ bool convertLegacyNanMatchIndToAidl(const legacy_hal::NanMatchInd& legacy_ind,
aidl_ind->peerRequiresRanging =
legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE;
aidl_ind->rangingMeasurementInMm = legacy_ind.range_info.range_measurement_mm;
aidl_ind->rangingIndicationType =
static_cast<NanRangingIndication>(legacy_ind.range_info.ranging_event_type);
aidl_ind->rangingIndicationType = legacy_ind.range_info.ranging_event_type;
aidl_ind->scid = std::vector<uint8_t>(legacy_ind.scid, legacy_ind.scid + legacy_ind.scid_len);
if (!convertLegacyNiraToAidl(legacy_ind.nira, &aidl_ind->peerNira)) {