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

Commit 64017373 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "RTT_FR_U"

* changes:
  Add frequency/Bandwidth to AIDL RttResults
  wifi: Add frequency/Bandwidth to AIDL RttResults
parents 9d714e64 f8fc2376
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum RttBw {
  BW_UNSPECIFIED = 0,
  BW_5MHZ = 1,
  BW_10MHZ = 2,
  BW_20MHZ = 4,
+2 −0
Original line number Diff line number Diff line
@@ -57,4 +57,6 @@ parcelable RttResult {
  int negotiatedBurstNum;
  android.hardware.wifi.WifiInformationElement lci;
  android.hardware.wifi.WifiInformationElement lcr;
  int channelFreqMHz;
  android.hardware.wifi.RttBw packetBw;
}
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ package android.hardware.wifi;
@VintfStability
@Backing(type="int")
enum RttBw {
    BW_UNSPECIFIED = 0x0,
    BW_5MHZ = 0x01,
    BW_10MHZ = 0x02,
    BW_20MHZ = 0x04,
+12 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.hardware.wifi;

import android.hardware.wifi.RttBw;
import android.hardware.wifi.RttStatus;
import android.hardware.wifi.RttType;
import android.hardware.wifi.WifiInformationElement;
@@ -132,4 +133,15 @@ parcelable RttResult {
     * For 11mc only.
     */
    WifiInformationElement lcr;
    /**
     * RTT channel frequency in MHz
     * If frequency is unknown, this will be set to 0.
     */
    int channelFreqMHz;
    /**
     * RTT packet bandwidth.
     * This value is an average bandwidth of the bandwidths of measurement
     * frames. Cap the average close to a specific valid RttBw.
     */
    RttBw packetBw;
}
+26 −0
Original line number Diff line number Diff line
@@ -2363,6 +2363,8 @@ legacy_hal::wifi_rtt_bw convertAidlRttBwToLegacy(RttBw type) {
            return legacy_hal::WIFI_RTT_BW_160;
        case RttBw::BW_320MHZ:
            return legacy_hal::WIFI_RTT_BW_320;
        case RttBw::BW_UNSPECIFIED:
            return legacy_hal::WIFI_RTT_BW_UNSPECIFIED;
    };
    CHECK(false);
}
@@ -2383,6 +2385,8 @@ RttBw convertLegacyRttBwToAidl(legacy_hal::wifi_rtt_bw type) {
            return RttBw::BW_160MHZ;
        case legacy_hal::WIFI_RTT_BW_320:
            return RttBw::BW_320MHZ;
        case legacy_hal::WIFI_RTT_BW_UNSPECIFIED:
            return RttBw::BW_UNSPECIFIED;
    };
    CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2712,6 +2716,28 @@ bool convertLegacyVectorOfRttResultToAidl(
        if (!convertLegacyRttResultToAidl(*legacy_result, &aidl_result)) {
            return false;
        }
        aidl_result.channelFreqMHz = 0;
        aidl_result.packetBw = RttBw::BW_UNSPECIFIED;
        aidl_results->push_back(aidl_result);
    }
    return true;
}

bool convertLegacyVectorOfRttResultV2ToAidl(
        const std::vector<const legacy_hal::wifi_rtt_result_v2*>& legacy_results,
        std::vector<RttResult>* aidl_results) {
    if (!aidl_results) {
        return false;
    }
    *aidl_results = {};
    for (const auto legacy_result : legacy_results) {
        RttResult aidl_result;
        if (!convertLegacyRttResultToAidl(legacy_result->rtt_result, &aidl_result)) {
            return false;
        }
        aidl_result.channelFreqMHz =
                legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0;
        aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw);
        aidl_results->push_back(aidl_result);
    }
    return true;
Loading