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

Commit d52541ef authored by Jimmy Chen's avatar Jimmy Chen Committed by Android (Google) Code Review
Browse files

Merge "wifi: add interface name to ScanResult"

parents 1049f8a6 0234e4c4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -80,6 +80,12 @@ public final class ScanResult implements Parcelable {
     */
    public String capabilities;

    /**
     * The interface name on which the scan result was received.
     * @hide
     */
    public String ifaceName;

    /**
     * @hide
     * No security protocol.
@@ -939,6 +945,7 @@ public final class ScanResult implements Parcelable {
            flags = source.flags;
            radioChainInfos = source.radioChainInfos;
            this.mWifiStandard = source.mWifiStandard;
            this.ifaceName = source.ifaceName;
        }
    }

@@ -977,6 +984,7 @@ public final class ScanResult implements Parcelable {
        sb.append(", 80211mcResponder: ");
        sb.append(((flags & FLAG_80211mc_RESPONDER) != 0) ? "is supported" : "is not supported");
        sb.append(", Radio Chain Infos: ").append(Arrays.toString(radioChainInfos));
        sb.append(", interface name: ").append(ifaceName);
        return sb.toString();
    }

@@ -1056,6 +1064,7 @@ public final class ScanResult implements Parcelable {
        } else {
            dest.writeInt(0);
        }
        dest.writeString((ifaceName != null) ? ifaceName.toString() : "");
    }

    /** Implement the Parcelable interface */
@@ -1134,6 +1143,7 @@ public final class ScanResult implements Parcelable {
                        sr.radioChainInfos[i].level = in.readInt();
                    }
                }
                sr.ifaceName = in.readString();
                return sr;
            }

+6 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class ScanResultTest {
    public static final long TEST_TSF = 04660l;
    public static final @WifiAnnotations.WifiStandard int TEST_WIFI_STANDARD =
            ScanResult.WIFI_STANDARD_11AC;
    public static final String TEST_IFACE_NAME = "test_ifname";

    /**
     * Frequency to channel map. This include some frequencies used outside the US.
@@ -219,7 +220,7 @@ public class ScanResultTest {
                + "passpoint: no, ChannelBandwidth: 0, centerFreq0: 0, centerFreq1: 0, "
                + "standard: 11ac, "
                + "80211mcResponder: is not supported, "
                + "Radio Chain Infos: null", scanResult.toString());
                + "Radio Chain Infos: null, interface name: test_ifname", scanResult.toString());
    }

    /**
@@ -242,7 +243,8 @@ public class ScanResultTest {
                + "standard: 11ac, "
                + "80211mcResponder: is not supported, "
                + "Radio Chain Infos: [RadioChainInfo: id=0, level=-45, "
                + "RadioChainInfo: id=1, level=-54]", scanResult.toString());
                + "RadioChainInfo: id=1, level=-54], interface name: test_ifname",
                scanResult.toString());
    }

    /**
@@ -283,6 +285,8 @@ public class ScanResultTest {
        result.frequency = TEST_FREQUENCY;
        result.timestamp = TEST_TSF;
        result.setWifiStandard(TEST_WIFI_STANDARD);
        result.ifaceName = TEST_IFACE_NAME;

        return result;
    }