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
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 75e9bfe..0203874 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -1862,9 +1862,7 @@
     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 @@
     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 @@
     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;
 }
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
index cd4e86d..37368af 100644
--- a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
@@ -477,9 +477,6 @@
     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 @@
     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 */