diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java index 716f1d32ec848..3190ead48da0a 100644 --- a/wifi/java/android/net/wifi/WifiScanner.java +++ b/wifi/java/android/net/wifi/WifiScanner.java @@ -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) {