Merge "Add a flag to indicate if a ScanData is for a scan for all channels" am: c7b84e6d0d
am: d8a5904abe
Change-Id: I92f3dc3aa1f3f110426965ec232e2a8b0b5f068b
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user