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

Commit 13d5e3b7 authored by Mitchell Wills's avatar Mitchell Wills Committed by Android (Google) Code Review
Browse files

Merge "Add a flag to indicate if a ScanData is for a scan for all channels" into nyc-mr1-dev

parents 041db68b 4bfb391c
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -286,6 +286,12 @@ public class WifiScanner {
         * {@hide}
         */
        private int mBucketsScanned;
        /**
         * Indicates that the scan results received are as a result of a scan of all available
         * channels. This should only be expected to function for single scans.
         * {@hide}
         */
        private boolean mAllChannelsScanned;
        /** all scan results discovered in this scan, sorted by timestamp in ascending order */
        private ScanResult mResults[];

@@ -298,10 +304,12 @@ public class WifiScanner {
        }

        /** {@hide} */
        public ScanData(int id, int flags, int bucketsScanned, ScanResult[] results) {
        public ScanData(int id, int flags, int bucketsScanned, boolean allChannelsScanned,
                ScanResult[] results) {
            mId = id;
            mFlags = flags;
            mBucketsScanned = bucketsScanned;
            mAllChannelsScanned = allChannelsScanned;
            mResults = results;
        }

@@ -309,6 +317,7 @@ public class WifiScanner {
            mId = s.mId;
            mFlags = s.mFlags;
            mBucketsScanned = s.mBucketsScanned;
            mAllChannelsScanned = s.mAllChannelsScanned;
            mResults = new ScanResult[s.mResults.length];
            for (int i = 0; i < s.mResults.length; i++) {
                ScanResult result = s.mResults[i];
@@ -330,6 +339,11 @@ public class WifiScanner {
            return mBucketsScanned;
        }

        /** {@hide} */
        public boolean isAllChannelsScanned() {
            return mAllChannelsScanned;
        }

        public ScanResult[] getResults() {
            return mResults;
        }
@@ -345,6 +359,7 @@ public class WifiScanner {
                dest.writeInt(mId);
                dest.writeInt(mFlags);
                dest.writeInt(mBucketsScanned);
                dest.writeInt(mAllChannelsScanned ? 1 : 0);
                dest.writeInt(mResults.length);
                for (int i = 0; i < mResults.length; i++) {
                    ScanResult result = mResults[i];
@@ -362,12 +377,13 @@ public class WifiScanner {
                        int id = in.readInt();
                        int flags = in.readInt();
                        int bucketsScanned = in.readInt();
                        boolean allChannelsScanned = in.readInt() != 0;
                        int n = in.readInt();
                        ScanResult results[] = new ScanResult[n];
                        for (int i = 0; i < n; i++) {
                            results[i] = ScanResult.CREATOR.createFromParcel(in);
                        }
                        return new ScanData(id, flags, bucketsScanned, results);
                        return new ScanData(id, flags, bucketsScanned, allChannelsScanned, results);
                    }

                    public ScanData[] newArray(int size) {