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

Commit 725f145e authored by Vinit Deshpande's avatar Vinit Deshpande Committed by Android (Google) Code Review
Browse files

Merge "Address API review comments" into mnc-dev

parents 9f49dcda a0d929e5
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -19085,6 +19085,8 @@ package android.net.wifi {
  public class ScanResult implements android.os.Parcelable {
    method public int describeContents();
    method public boolean is80211mcResponder();
    method public boolean isPasspointNetwork();
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String BSSID;
    field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
@@ -19092,18 +19094,19 @@ package android.net.wifi {
    field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
    field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
    field public static final long FLAG_80211mc_RESPONDER = 2L; // 0x2L
    field public static final long FLAG_PASSPOINT_NETWORK = 1L; // 0x1L
    field public java.lang.String SSID;
    field public java.lang.String capabilities;
    field public int centerFreq0;
    field public int centerFreq1;
    field public int channelWidth;
    field public long flags;
    field public int frequency;
    field public boolean is80211McRTTResponder;
    field public int level;
    field public java.lang.String operatorFriendlyName;
    field public boolean passpointNetwork;
    field public java.lang.CharSequence operatorFriendlyName;
    field public long timestamp;
    field public java.lang.String venueName;
    field public java.lang.CharSequence venueName;
  }
  public final class SupplicantState extends java.lang.Enum implements android.os.Parcelable {
@@ -19146,7 +19149,7 @@ package android.net.wifi {
    field public java.lang.String preSharedKey;
    field public int priority;
    field public java.lang.String providerFriendlyName;
    field public java.util.HashSet<java.lang.Long> roamingConsortiumIds;
    field public java.lang.Long[] roamingConsortiumIds;
    field public int status;
    field public java.lang.String[] wepKeys;
    field public int wepTxKeyIndex;
@@ -19208,7 +19211,7 @@ package android.net.wifi {
    method public java.lang.String getAnonymousIdentity();
    method public java.security.cert.X509Certificate getCaCertificate();
    method public java.security.cert.X509Certificate getClientCertificate();
    method public java.lang.String getDomainSubjectMatch();
    method public java.lang.String getDomainSuffixMatch();
    method public int getEapMethod();
    method public java.lang.String getIdentity();
    method public java.lang.String getPassword();
+9 −6
Original line number Diff line number Diff line
@@ -20827,6 +20827,8 @@ package android.net.wifi {
  public class ScanResult implements android.os.Parcelable {
    method public int describeContents();
    method public boolean is80211mcResponder();
    method public boolean isPasspointNetwork();
    method public void writeToParcel(android.os.Parcel, int);
    field public java.lang.String BSSID;
    field public static final int CHANNEL_WIDTH_160MHZ = 3; // 0x3
@@ -20834,18 +20836,19 @@ package android.net.wifi {
    field public static final int CHANNEL_WIDTH_40MHZ = 1; // 0x1
    field public static final int CHANNEL_WIDTH_80MHZ = 2; // 0x2
    field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4; // 0x4
    field public static final long FLAG_80211mc_RESPONDER = 2L; // 0x2L
    field public static final long FLAG_PASSPOINT_NETWORK = 1L; // 0x1L
    field public java.lang.String SSID;
    field public java.lang.String capabilities;
    field public int centerFreq0;
    field public int centerFreq1;
    field public int channelWidth;
    field public long flags;
    field public int frequency;
    field public boolean is80211McRTTResponder;
    field public int level;
    field public java.lang.String operatorFriendlyName;
    field public boolean passpointNetwork;
    field public java.lang.CharSequence operatorFriendlyName;
    field public long timestamp;
    field public java.lang.String venueName;
    field public java.lang.CharSequence venueName;
  }
  public final class SupplicantState extends java.lang.Enum implements android.os.Parcelable {
@@ -20895,7 +20898,7 @@ package android.net.wifi {
    field public java.lang.String preSharedKey;
    field public int priority;
    field public java.lang.String providerFriendlyName;
    field public java.util.HashSet<java.lang.Long> roamingConsortiumIds;
    field public java.lang.Long[] roamingConsortiumIds;
    field public int status;
    field public java.lang.String[] wepKeys;
    field public int wepTxKeyIndex;
@@ -20972,7 +20975,7 @@ package android.net.wifi {
    method public java.lang.String getAnonymousIdentity();
    method public java.security.cert.X509Certificate getCaCertificate();
    method public java.security.cert.X509Certificate getClientCertificate();
    method public java.lang.String getDomainSubjectMatch();
    method public java.lang.String getDomainSuffixMatch();
    method public int getEapMethod();
    method public java.lang.String getIdentity();
    method public java.lang.String getPassword();
+1 −1
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ public class WifiTracker {
                        accessPoint.update(mLastInfo, mLastNetworkInfo);
                    }

                    if (result.passpointNetwork) {
                    if (result.isPasspointNetwork()) {
                        WifiConfiguration config = mWifiManager.getMatchingWifiConfig(result);
                        if (config != null) {
                            accessPoint.update(config);
+77 −42
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.net.wifi;

import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

/**
 * Describes information about a detected access point. In addition
@@ -80,25 +81,28 @@ public class ScanResult implements Parcelable {
    public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 4;

   /**
    * AP Channel bandwidth
    * AP Channel bandwidth; one of {@link #CHANNEL_WIDTH_20MHZ}, {@link #CHANNEL_WIDTH_40MHZ},
    * {@link #CHANNEL_WIDTH_80MHZ}, {@link #CHANNEL_WIDTH_160MHZ}
    * or {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ}.
    */
    public int channelWidth;

    /**
     * Not used if the AP bandwidth is 20 MHz
     * If the AP use 40, 80 or 160 MHz, this is the center frequency
     * if the AP use 80 + 80 MHz, this is the center frequency of the first segment
     * If the AP use 40, 80 or 160 MHz, this is the center frequency (in MHz)
     * if the AP use 80 + 80 MHz, this is the center frequency of the first segment (in MHz)
     */
    public int centerFreq0;

    /**
     * Only used if the AP bandwidth is 80 + 80 MHz
     * if the AP use 80 + 80 MHz, this is the center frequency of the second segment
     * if the AP use 80 + 80 MHz, this is the center frequency of the second segment (in MHz)
     */
    public int centerFreq1;

    /**
     * Whether the AP support 802.11mc Responder
     * @deprecated use is80211mcResponder() instead
     * @hide
     */
    public boolean is80211McRTTResponder;

@@ -123,7 +127,7 @@ public class ScanResult implements Parcelable {
    /**
     * @hide
     * Update RSSI of the scan result
     * @param previousRSSI
     * @param previousRssi
     * @param previousSeen
     * @param maxAge
     */
@@ -206,26 +210,56 @@ public class ScanResult implements Parcelable {
    public int distanceCm;

    /**
     * The standard deviation of the distance to the AP, if available.
     * The standard deviation of the distance to the access point, if available.
     * Else {@link UNSPECIFIED}.
     * {@hide}
     */
    public int distanceSdCm;

    public static final long FLAG_PASSPOINT_NETWORK               = 0x0000000000000001;
    public static final long FLAG_80211mc_RESPONDER               = 0x0000000000000002;

    /**
     * Indicates if the scan result represents a passpoint AP
     * Defines flags; such as {@link #FLAG_PASSPOINT_NETWORK}.
     */
    public boolean passpointNetwork;
    public long flags;

    /**
     * Indicates if venue name
     * sets a flag in {@link #flags} field
     * @param flag flag to set
     * @hide
     */
    public String venueName;
    public void setFlag(long flag) {
        flags |= flag;
    }

    /**
     * Indicates operator name
     * clears a flag in {@link #flags} field
     * @param flag flag to set
     * @hide
     */
    public String operatorFriendlyName;
    public void clearFlag(long flag) {
        flags &= ~flag;
    }

    public boolean is80211mcResponder() {
        return (flags & FLAG_80211mc_RESPONDER) != 0;
    }

    public boolean isPasspointNetwork() {
        return (flags & FLAG_PASSPOINT_NETWORK) != 0;
    }

    /**
     * Indicates venue name (such as 'San Francisco Airport') published by access point; only
     * available on passpoint network and if published by access point.
     */
    public CharSequence venueName;

    /**
     * Indicates passpoint operator name published by access point.
     */
    public CharSequence operatorFriendlyName;

    /**
     * {@hide}
@@ -267,7 +301,7 @@ public class ScanResult implements Parcelable {
     **/
    public byte[] bytes;

    /** information element from beacon
    /** information elements from beacon
     * @hide
     */
    public static class InformationElement {
@@ -303,8 +337,7 @@ public class ScanResult implements Parcelable {
        this.channelWidth = UNSPECIFIED;
        this.centerFreq0 = UNSPECIFIED;
        this.centerFreq1 = UNSPECIFIED;
        this.is80211McRTTResponder = false;
        this.passpointNetwork = false;
        this.flags = 0;
    }

    /** {@hide} */
@@ -322,8 +355,7 @@ public class ScanResult implements Parcelable {
        this.channelWidth = UNSPECIFIED;
        this.centerFreq0 = UNSPECIFIED;
        this.centerFreq1 = UNSPECIFIED;
        this.is80211McRTTResponder = false;
        this.passpointNetwork = false;
        this.flags = 0;
    }

    /** {@hide} */
@@ -342,8 +374,11 @@ public class ScanResult implements Parcelable {
        this.channelWidth = channelWidth;
        this.centerFreq0 = centerFreq0;
        this.centerFreq1 = centerFreq1;
        this.is80211McRTTResponder = is80211McRTTResponder;
        this.passpointNetwork = false;
        if (is80211McRTTResponder) {
            this.flags = FLAG_80211mc_RESPONDER;
        } else {
            this.flags = 0;
        }
    }

    /** copy constructor {@hide} */
@@ -358,7 +393,6 @@ public class ScanResult implements Parcelable {
            channelWidth = source.channelWidth;
            centerFreq0 = source.centerFreq0;
            centerFreq1 = source.centerFreq1;
            is80211McRTTResponder = source.is80211McRTTResponder;
            timestamp = source.timestamp;
            distanceCm = source.distanceCm;
            distanceSdCm = source.distanceSdCm;
@@ -369,9 +403,9 @@ public class ScanResult implements Parcelable {
            numUsage = source.numUsage;
            numIpConfigFailures = source.numIpConfigFailures;
            isAutoJoinCandidate = source.isAutoJoinCandidate;
            passpointNetwork = source.passpointNetwork;
            venueName = source.venueName;
            operatorFriendlyName = source.operatorFriendlyName;
            flags = source.flags;
        }
    }

@@ -405,15 +439,16 @@ public class ScanResult implements Parcelable {
        sb.append(", distanceSd: ").append((distanceSdCm != UNSPECIFIED ? distanceSdCm : "?")).
                append("(cm)");

        sb.append(", passpoint: ").append(passpointNetwork ? "yes" : "no");
        sb.append(", passpoint: ");
        sb.append(((flags & FLAG_PASSPOINT_NETWORK) != 0) ? "yes" : "no");
        if (autoJoinStatus != 0) {
            sb.append(", status: ").append(autoJoinStatus);
        }
        sb.append(", ChannelBandwidth: ").append(channelWidth);
        sb.append(", centerFreq0: ").append(centerFreq0);
        sb.append(", centerFreq1: ").append(centerFreq1);
        sb.append(", 80211mcResponder: ").append(is80211McRTTResponder?
                "is supported":"is not supported");
        sb.append(", 80211mcResponder: ");
        sb.append(((flags & FLAG_80211mc_RESPONDER) != 0) ? "is supported" : "is not supported");
        return sb.toString();
    }

@@ -440,7 +475,6 @@ public class ScanResult implements Parcelable {
        dest.writeInt(channelWidth);
        dest.writeInt(centerFreq0);
        dest.writeInt(centerFreq1);
        dest.writeInt(is80211McRTTResponder ? 1 : 0);
        dest.writeLong(seen);
        dest.writeInt(autoJoinStatus);
        dest.writeInt(untrusted ? 1 : 0);
@@ -448,9 +482,9 @@ public class ScanResult implements Parcelable {
        dest.writeInt(numUsage);
        dest.writeInt(numIpConfigFailures);
        dest.writeInt(isAutoJoinCandidate);
        dest.writeInt(passpointNetwork ? 1 : 0);
        dest.writeString(venueName);
        dest.writeString(operatorFriendlyName);
        dest.writeString((venueName != null) ? venueName.toString() : "");
        dest.writeString((operatorFriendlyName != null) ? operatorFriendlyName.toString() : "");
        dest.writeLong(this.flags);

        if (informationElements != null) {
            dest.writeInt(informationElements.length);
@@ -474,18 +508,19 @@ public class ScanResult implements Parcelable {
                }
                ScanResult sr = new ScanResult(
                    wifiSsid,
                    in.readString(),
                    in.readString(),
                    in.readInt(),
                    in.readInt(),
                    in.readLong(),
                    in.readInt(),
                    in.readInt(),
                    in.readInt(),
                    in.readInt(),
                    in.readInt(),
                    in.readInt() == 1
                    in.readString(),                    /* BSSID */
                    in.readString(),                    /* capabilities */
                    in.readInt(),                       /* level */
                    in.readInt(),                       /* frequency */
                    in.readLong(),                      /* timestamp */
                    in.readInt(),                       /* distanceCm */
                    in.readInt(),                       /* distanceSdCm */
                    in.readInt(),                       /* channelWidth */
                    in.readInt(),                       /* centerFreq0 */
                    in.readInt(),                       /* centerFreq1 */
                    false                               /* rtt responder, fixed with flags below */
                );

                sr.seen = in.readLong();
                sr.autoJoinStatus = in.readInt();
                sr.untrusted = in.readInt() != 0;
@@ -493,9 +528,9 @@ public class ScanResult implements Parcelable {
                sr.numUsage = in.readInt();
                sr.numIpConfigFailures = in.readInt();
                sr.isAutoJoinCandidate = in.readInt();
                sr.passpointNetwork = in.readInt() == 1;
                sr.venueName = in.readString();
                sr.operatorFriendlyName = in.readString();
                sr.flags = in.readLong();
                int n = in.readInt();
                if (n != 0) {
                    sr.informationElements = new InformationElement[n];
+9 −11
Original line number Diff line number Diff line
@@ -344,14 +344,15 @@ public class WifiConfiguration implements Parcelable {
    public String FQDN;

    /**
     * Service provider name, for Passpoint credential.
     * Name of passpoint credential provider
     */
    public String providerFriendlyName;

    /**
     * Roaming Consortium Id, for Passpoint credential.
     * Roaming Consortium Id list for passpoint credential; identifies a set of networks where
     * passpoint credential will be considered valid
     */
    public HashSet<Long> roamingConsortiumIds;
    public Long[] roamingConsortiumIds;

    /**
     * @hide
@@ -906,7 +907,7 @@ public class WifiConfiguration implements Parcelable {
        SSID = null;
        BSSID = null;
        FQDN = null;
        roamingConsortiumIds = new HashSet<Long>();
        roamingConsortiumIds = new Long[0];
        priority = 0;
        hiddenSSID = false;
        disableReason = DISABLED_UNKNOWN_REASON;
@@ -1437,11 +1438,7 @@ public class WifiConfiguration implements Parcelable {
            SSID = source.SSID;
            BSSID = source.BSSID;
            FQDN = source.FQDN;
            roamingConsortiumIds = new HashSet<Long>();
            for (Long roamingConsortiumId : source.roamingConsortiumIds) {
                roamingConsortiumIds.add(roamingConsortiumId);
            }

            roamingConsortiumIds = source.roamingConsortiumIds.clone();
            providerFriendlyName = source.providerFriendlyName;
            preSharedKey = source.preSharedKey;

@@ -1546,7 +1543,7 @@ public class WifiConfiguration implements Parcelable {
        dest.writeString(autoJoinBSSID);
        dest.writeString(FQDN);
        dest.writeString(providerFriendlyName);
        dest.writeInt(roamingConsortiumIds.size());
        dest.writeInt(roamingConsortiumIds.length);
        for (Long roamingConsortiumId : roamingConsortiumIds) {
            dest.writeLong(roamingConsortiumId);
        }
@@ -1622,8 +1619,9 @@ public class WifiConfiguration implements Parcelable {
                config.FQDN = in.readString();
                config.providerFriendlyName = in.readString();
                int numRoamingConsortiumIds = in.readInt();
                config.roamingConsortiumIds = new Long[numRoamingConsortiumIds];
                for (int i = 0; i < numRoamingConsortiumIds; i++) {
                    config.roamingConsortiumIds.add(in.readLong());
                    config.roamingConsortiumIds[i] = in.readLong();
                }
                config.preSharedKey = in.readString();
                for (int i = 0; i < config.wepKeys.length; i++) {
Loading