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

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

Merge "wifi: ScanResult: add carrier network indicator" into oc-mr1-dev

parents a6b8e450 d3ad1540
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -431,6 +431,28 @@ public class ScanResult implements Parcelable {
     */
    public AnqpInformationElement[] anqpElements;

    /**
     * Flag indicating if this AP is a carrier AP. The determination is based
     * on the AP's SSID and if AP is using EAP security.
     *
     * @hide
     */
    public boolean isCarrierAp;

    /**
     * The EAP type {@link WifiEnterpriseConfig.Eap} associated with this AP if it is a carrier AP.
     *
     * @hide
     */
    public int carrierApEapType;

    /**
     * The name of the carrier that's associated with this AP if it is a carrier AP.
     *
     * @hide
     */
    public String carrierName;

    /** {@hide} */
    public ScanResult(WifiSsid wifiSsid, String BSSID, long hessid, int anqpDomainId,
            byte[] osuProviders, String caps, int level, int frequency, long tsf) {
@@ -455,6 +477,9 @@ public class ScanResult implements Parcelable {
        this.centerFreq0 = UNSPECIFIED;
        this.centerFreq1 = UNSPECIFIED;
        this.flags = 0;
        this.isCarrierAp = false;
        this.carrierApEapType = UNSPECIFIED;
        this.carrierName = null;
    }

    /** {@hide} */
@@ -473,6 +498,9 @@ public class ScanResult implements Parcelable {
        this.centerFreq0 = UNSPECIFIED;
        this.centerFreq1 = UNSPECIFIED;
        this.flags = 0;
        this.isCarrierAp = false;
        this.carrierApEapType = UNSPECIFIED;
        this.carrierName = null;
    }

    /** {@hide} */
@@ -498,6 +526,9 @@ public class ScanResult implements Parcelable {
        } else {
            this.flags = 0;
        }
        this.isCarrierAp = false;
        this.carrierApEapType = UNSPECIFIED;
        this.carrierName = null;
    }

    /** {@hide} */
@@ -537,6 +568,9 @@ public class ScanResult implements Parcelable {
            venueName = source.venueName;
            operatorFriendlyName = source.operatorFriendlyName;
            flags = source.flags;
            isCarrierAp = source.isCarrierAp;
            carrierApEapType = source.carrierApEapType;
            carrierName = source.carrierName;
        }
    }

@@ -577,6 +611,9 @@ public class ScanResult implements Parcelable {
        sb.append(", centerFreq1: ").append(centerFreq1);
        sb.append(", 80211mcResponder: ");
        sb.append(((flags & FLAG_80211mc_RESPONDER) != 0) ? "is supported" : "is not supported");
        sb.append(", Carrier AP: ").append(isCarrierAp ? "yes" : "no");
        sb.append(", Carrier AP EAP Type: ").append(carrierApEapType);
        sb.append(", Carrier name: ").append(carrierName);
        return sb.toString();
    }

@@ -646,6 +683,9 @@ public class ScanResult implements Parcelable {
        } else {
            dest.writeInt(0);
        }
        dest.writeInt(isCarrierAp ? 1 : 0);
        dest.writeInt(carrierApEapType);
        dest.writeString(carrierName);
    }

    /** Implement the Parcelable interface {@hide} */
@@ -715,6 +755,9 @@ public class ScanResult implements Parcelable {
                                new AnqpInformationElement(vendorId, elementId, payload);
                    }
                }
                sr.isCarrierAp = in.readInt() != 0;
                sr.carrierApEapType = in.readInt();
                sr.carrierName = in.readString();
                return sr;
            }