Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbf7ccf0 authored by Gabriel Biren's avatar Gabriel Biren Committed by Android Build Coastguard Worker
Browse files

Undo NAN periodic ranging changes in the

legacy HAL and AIDL conversion method.

Bug: 383519130
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7b3bdc42ef3168fa7cf976256e55bbf83b2bcb44)
Merged-In: Ie1eda02d286fa7d5a9419952704234f729f3efbd
Change-Id: Ie1eda02d286fa7d5a9419952704234f729f3efbd
parent 6645506f
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -1862,9 +1862,7 @@ bool convertAidlNanPublishRequestToLegacy(const NanPublishRequest& aidl_request,
    legacy_request->ranging_auto_response = aidl_request.baseConfigs.rangingRequired
                                                    ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE
                                                    : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
    legacy_request->sdea_params.range_report = aidl_request.rangingResultsRequired
                                                       ? legacy_hal::NAN_ENABLE_RANGE_REPORT
                                                       : legacy_hal::NAN_DISABLE_RANGE_REPORT;
    legacy_request->sdea_params.range_report = legacy_hal::NAN_DISABLE_RANGE_REPORT;
    legacy_request->publish_type = convertAidlNanPublishTypeToLegacy(aidl_request.publishType);
    legacy_request->tx_type = convertAidlNanTxTypeToLegacy(aidl_request.txType);
    legacy_request->service_responder_policy = aidl_request.autoAcceptDataPathRequests
@@ -1993,17 +1991,6 @@ bool convertAidlNanSubscribeRequestToLegacy(const NanSubscribeRequest& aidl_requ
    legacy_request->ranging_cfg.distance_ingress_mm =
            aidl_request.baseConfigs.distanceIngressCm * 10;
    legacy_request->ranging_cfg.distance_egress_mm = aidl_request.baseConfigs.distanceEgressCm * 10;
    legacy_request->ranging_cfg.rtt_burst_size = aidl_request.baseConfigs.rttBurstSize;
    legacy_request->ranging_cfg.preamble =
            convertAidlRttPreambleToLegacy(aidl_request.baseConfigs.preamble);
    if (aidl_request.baseConfigs.channelInfo.has_value()) {
        if (!convertAidlWifiChannelInfoToLegacy(aidl_request.baseConfigs.channelInfo.value(),
                                                &legacy_request->ranging_cfg.channel_info)) {
            LOG(ERROR) << "convertAidlNanSubscribeRequestToLegacy: "
                          "Unable to convert aidl channel info to legacy";
            return false;
        }
    }
    legacy_request->ranging_auto_response = aidl_request.baseConfigs.rangingRequired
                                                    ? legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE
                                                    : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
@@ -2312,9 +2299,10 @@ bool convertLegacyNanCapabilitiesResponseToAidl(const legacy_hal::NanCapabilitie
    aidl_response->supportsPairing = legacy_response.is_pairing_supported;
    aidl_response->supportsSetClusterId = legacy_response.is_set_cluster_id_supported;
    aidl_response->supportsSuspension = legacy_response.is_suspension_supported;
    aidl_response->supportsPeriodicRanging = legacy_response.is_periodic_ranging_supported;
    aidl_response->maxSupportedBandwidth = convertLegacyRttBwToAidl(legacy_response.supported_bw);
    aidl_response->maxNumRxChainsSupported = legacy_response.num_rx_chains_supported;
    // TODO: Retrieve values from the legacy HAL
    aidl_response->supportsPeriodicRanging = false;
    aidl_response->maxSupportedBandwidth = RttBw::BW_UNSPECIFIED;
    aidl_response->maxNumRxChainsSupported = 2;

    return true;
}
+0 −9
Original line number Diff line number Diff line
@@ -477,9 +477,6 @@ typedef struct {
    bool is_pairing_supported;
    bool is_set_cluster_id_supported;
    bool is_suspension_supported;
    bool is_periodic_ranging_supported;
    wifi_rtt_bw supported_bw;
    u8 num_rx_chains_supported;
} NanCapabilities;

/*
@@ -750,12 +747,6 @@ typedef struct {
    u32 distance_ingress_mm;
    /* Egress distance in millmilliimeters (optional) */
    u32 distance_egress_mm;
    /* Number of FTM frames per burst */
    u32 rtt_burst_size;
    /* RTT Measurement Preamble */
    wifi_rtt_preamble preamble;
    /* Channel information */
    wifi_channel_info channel_info;
} NanRangingCfg;

/* NAN Ranging request's response */