Merge "Add a flag to indicate if a ScanData is for a scan for all channels"
am: c7b84e6d0d
Change-Id: I8c874c282db93dbb531c9c7e27540044c446144e
This commit is contained in:
@@ -286,6 +286,12 @@ public class WifiScanner {
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
private int mBucketsScanned;
|
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 */
|
/** all scan results discovered in this scan, sorted by timestamp in ascending order */
|
||||||
private ScanResult mResults[];
|
private ScanResult mResults[];
|
||||||
|
|
||||||
@@ -298,10 +304,12 @@ public class WifiScanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@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;
|
mId = id;
|
||||||
mFlags = flags;
|
mFlags = flags;
|
||||||
mBucketsScanned = bucketsScanned;
|
mBucketsScanned = bucketsScanned;
|
||||||
|
mAllChannelsScanned = allChannelsScanned;
|
||||||
mResults = results;
|
mResults = results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,6 +317,7 @@ public class WifiScanner {
|
|||||||
mId = s.mId;
|
mId = s.mId;
|
||||||
mFlags = s.mFlags;
|
mFlags = s.mFlags;
|
||||||
mBucketsScanned = s.mBucketsScanned;
|
mBucketsScanned = s.mBucketsScanned;
|
||||||
|
mAllChannelsScanned = s.mAllChannelsScanned;
|
||||||
mResults = new ScanResult[s.mResults.length];
|
mResults = new ScanResult[s.mResults.length];
|
||||||
for (int i = 0; i < s.mResults.length; i++) {
|
for (int i = 0; i < s.mResults.length; i++) {
|
||||||
ScanResult result = s.mResults[i];
|
ScanResult result = s.mResults[i];
|
||||||
@@ -330,6 +339,11 @@ public class WifiScanner {
|
|||||||
return mBucketsScanned;
|
return mBucketsScanned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public boolean isAllChannelsScanned() {
|
||||||
|
return mAllChannelsScanned;
|
||||||
|
}
|
||||||
|
|
||||||
public ScanResult[] getResults() {
|
public ScanResult[] getResults() {
|
||||||
return mResults;
|
return mResults;
|
||||||
}
|
}
|
||||||
@@ -345,6 +359,7 @@ public class WifiScanner {
|
|||||||
dest.writeInt(mId);
|
dest.writeInt(mId);
|
||||||
dest.writeInt(mFlags);
|
dest.writeInt(mFlags);
|
||||||
dest.writeInt(mBucketsScanned);
|
dest.writeInt(mBucketsScanned);
|
||||||
|
dest.writeInt(mAllChannelsScanned ? 1 : 0);
|
||||||
dest.writeInt(mResults.length);
|
dest.writeInt(mResults.length);
|
||||||
for (int i = 0; i < mResults.length; i++) {
|
for (int i = 0; i < mResults.length; i++) {
|
||||||
ScanResult result = mResults[i];
|
ScanResult result = mResults[i];
|
||||||
@@ -362,12 +377,13 @@ public class WifiScanner {
|
|||||||
int id = in.readInt();
|
int id = in.readInt();
|
||||||
int flags = in.readInt();
|
int flags = in.readInt();
|
||||||
int bucketsScanned = in.readInt();
|
int bucketsScanned = in.readInt();
|
||||||
|
boolean allChannelsScanned = in.readInt() != 0;
|
||||||
int n = in.readInt();
|
int n = in.readInt();
|
||||||
ScanResult results[] = new ScanResult[n];
|
ScanResult results[] = new ScanResult[n];
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
results[i] = ScanResult.CREATOR.createFromParcel(in);
|
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) {
|
public ScanData[] newArray(int size) {
|
||||||
|
|||||||
Reference in New Issue
Block a user