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

Commit b0e56cb5 authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

Wifi: Add 802.11ax support to RTT

This CL makes modidfication to support Wifi 802.11ax to RTT procedures.

Bug: 139354972
Test: atest com.android.wifi.server
Change-Id: I3d07509b27c4be83ea7c59ee4d1f0e404db5a04d
parent dbe38831
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5131,6 +5131,7 @@ package android.net.wifi.rtt {
    field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
    field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.ResponderConfig> CREATOR;
    field public static final int PREAMBLE_HE = 3; // 0x3
    field public static final int PREAMBLE_HT = 1; // 0x1
    field public static final int PREAMBLE_LEGACY = 0; // 0x0
    field public static final int PREAMBLE_VHT = 2; // 0x2
+1 −0
Original line number Diff line number Diff line
@@ -549,6 +549,7 @@ public class ScanResult implements Parcelable {
        /**
         * Extension IDs
         */
        public static final int EID_EXT_HE_CAPABILITIES = 35;
        public static final int EID_EXT_HE_OPERATION = 36;

        @UnsupportedAppUsage
+15 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.net.wifi.rtt;

import static android.net.wifi.ScanResult.InformationElement.EID_EXTENSION_PRESENT;
import static android.net.wifi.ScanResult.InformationElement.EID_EXT_HE_CAPABILITIES;
import static android.net.wifi.ScanResult.InformationElement.EID_HT_CAPABILITIES;
import static android.net.wifi.ScanResult.InformationElement.EID_VHT_CAPABILITIES;

@@ -106,7 +108,7 @@ public final class ResponderConfig implements Parcelable {
    public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4;

    /** @hide */
    @IntDef({PREAMBLE_LEGACY, PREAMBLE_HT, PREAMBLE_VHT})
    @IntDef({PREAMBLE_LEGACY, PREAMBLE_HT, PREAMBLE_VHT, PREAMBLE_HE})
    @Retention(RetentionPolicy.SOURCE)
    public @interface PreambleType {
    }
@@ -126,6 +128,10 @@ public final class ResponderConfig implements Parcelable {
     */
    public static final int PREAMBLE_VHT = 2;

    /**
     * Preamble type: HE.
     */
    public static final int PREAMBLE_HE = 3;

    /**
     * The MAC address of the Responder. Will be null if a Wi-Fi Aware peer identifier (the
@@ -307,14 +313,21 @@ public final class ResponderConfig implements Parcelable {
        if (scanResult.informationElements != null && scanResult.informationElements.length != 0) {
            boolean htCapabilitiesPresent = false;
            boolean vhtCapabilitiesPresent = false;
            boolean heCapabilitiesPresent = false;

            for (ScanResult.InformationElement ie : scanResult.informationElements) {
                if (ie.id == EID_HT_CAPABILITIES) {
                    htCapabilitiesPresent = true;
                } else if (ie.id == EID_VHT_CAPABILITIES) {
                    vhtCapabilitiesPresent = true;
                } else if (ie.id == EID_EXTENSION_PRESENT && ie.idExt == EID_EXT_HE_CAPABILITIES) {
                    heCapabilitiesPresent = true;
                }
            }
            if (vhtCapabilitiesPresent) {

            if (heCapabilitiesPresent) {
                preamble = PREAMBLE_HE;
            } else if (vhtCapabilitiesPresent) {
                preamble = PREAMBLE_VHT;
            } else if (htCapabilitiesPresent) {
                preamble = PREAMBLE_HT;