Add I2R and R2I 11az LTF repetition count

Add IEEE 802.11az LTF repetition count for both I2R and R2I in 11az
RTT ranging result. Also remove the LTF repetition count from RTT
capabilities and config. The reason for removing is that vendor
software can pick the optimized value without an input from
framework.

Bug: 295619650
Test: m
Change-Id: I54b3ba9f490a9de83ac63b1dcde1e1cb4e1bd8fc
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 56ef2d2..83f3f7e 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
@@ -46,5 +46,4 @@
   android.hardware.wifi.RttBw azBwSupport;
   boolean ntbInitiatorSupported;
   boolean ntbResponderSupported;
-  int maxTxLtfRepetitionCount;
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
index b7830bd..16a14ea 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
@@ -50,5 +50,4 @@
   android.hardware.wifi.RttBw bw;
   int ntbMinMeasurementTimeMillis;
   int ntbMaxMeasurementTimeMillis;
-  int txLtfRepetitionCount;
 }
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
index 30f5f58..93a04ac 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
@@ -59,7 +59,8 @@
   android.hardware.wifi.WifiInformationElement lcr;
   int channelFreqMHz;
   android.hardware.wifi.RttBw packetBw;
-  int txLtfRepetitionCount;
+  byte i2rTxLtfRepetitionCount;
+  byte r2iTxLtfRepetitionCount;
   int ntbMinMeasurementTimeMillis;
   int ntbMaxMeasurementTimeMillis;
 }
diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
index 0352ec8..c4b7d24 100644
--- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
@@ -78,9 +78,4 @@
      * Whether IEEE 802.11az Non-Trigger-based (non-TB) responder mode is supported.
      */
     boolean ntbResponderSupported;
-    /**
-     * Maximum HE LTF repetitions the IEEE 802.11az initiator is capable of transmitting in the
-     * preamble of I2R NDP.
-     */
-    int maxTxLtfRepetitionCount;
 }
diff --git a/wifi/aidl/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
index e970656..97b3acf 100644
--- a/wifi/aidl/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
@@ -128,9 +128,4 @@
      * IEEE 802.11az Non-Trigger-based (non-TB) maximum measurement time in milliseconds.
      */
     int ntbMaxMeasurementTimeMillis;
-    /**
-     * Multiple transmissions of HE-LTF symbols in an HE Ranging NDP. A value of 1 indicates no
-     * repetition.
-     */
-    int txLtfRepetitionCount;
 }
diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl
index 2cb0afa..034b0da 100644
--- a/wifi/aidl/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl
@@ -146,9 +146,15 @@
      */
     RttBw packetBw;
     /**
-     * IEEE 802.11az Transmit LTF repetitions used to get this result.
+     * Multiple transmissions of HE-LTF symbols in an HE (I2R) Ranging NDP. An HE-LTF repetition
+     * value of 1 indicates no repetitions.
      */
-    int txLtfRepetitionCount;
+    byte i2rTxLtfRepetitionCount;
+    /**
+     * Multiple transmissions of HE-LTF symbols in an HE (R2I) Ranging NDP. An HE-LTF repetition
+     * value of 1 indicates no repetitions.
+     */
+    byte r2iTxLtfRepetitionCount;
     /**
      * Minimum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the
      * IEEE 802.11az responder.
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index b62b3a0..42f484b 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -2741,7 +2741,6 @@
     if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config->rtt_config))) {
         return false;
     }
-    legacy_config->tx_ltf_repetition_count = aidl_config.txLtfRepetitionCount;
     legacy_config->ntb_min_measurement_time_millis = aidl_config.ntbMinMeasurementTimeMillis;
     legacy_config->ntb_max_measurement_time_millis = aidl_config.ntbMaxMeasurementTimeMillis;
     return true;
@@ -2891,7 +2890,6 @@
     aidl_capabilities->azBwSupport = RttBw::BW_UNSPECIFIED;
     aidl_capabilities->ntbInitiatorSupported = false;
     aidl_capabilities->ntbResponderSupported = false;
-    aidl_capabilities->maxTxLtfRepetitionCount = 0;
     return true;
 }
 
@@ -2919,7 +2917,6 @@
             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;
-    aidl_capabilities->maxTxLtfRepetitionCount = legacy_capabilities_v3.max_tx_ltf_repetition_count;
     return true;
 }
 
@@ -2994,7 +2991,8 @@
         }
         aidl_result.channelFreqMHz = 0;
         aidl_result.packetBw = RttBw::BW_UNSPECIFIED;
-        aidl_result.txLtfRepetitionCount = 0;
+        aidl_result.i2rTxLtfRepetitionCount = 0;
+        aidl_result.r2iTxLtfRepetitionCount = 0;
         aidl_result.ntbMinMeasurementTimeMillis = 0;
         aidl_result.ntbMaxMeasurementTimeMillis = 0;
         aidl_results->push_back(aidl_result);
@@ -3017,7 +3015,8 @@
         aidl_result.channelFreqMHz =
                 legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0;
         aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw);
-        aidl_result.txLtfRepetitionCount = 0;
+        aidl_result.i2rTxLtfRepetitionCount = 0;
+        aidl_result.r2iTxLtfRepetitionCount = 0;
         aidl_result.ntbMinMeasurementTimeMillis = 0;
         aidl_result.ntbMaxMeasurementTimeMillis = 0;
         aidl_results->push_back(aidl_result);
@@ -3041,7 +3040,8 @@
                                              ? legacy_result->rtt_result.frequency
                                              : 0;
         aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->rtt_result.packet_bw);
-        aidl_result.txLtfRepetitionCount = legacy_result->tx_ltf_repetition_count;
+        aidl_result.i2rTxLtfRepetitionCount = legacy_result->i2r_tx_ltf_repetition_count;
+        aidl_result.r2iTxLtfRepetitionCount = legacy_result->r2i_tx_ltf_repetition_count;
         aidl_result.ntbMinMeasurementTimeMillis = legacy_result->ntb_min_measurement_time_millis;
         aidl_result.ntbMaxMeasurementTimeMillis = legacy_result->ntb_max_measurement_time_millis;
         aidl_results->push_back(aidl_result);