summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mitchell Wills <mwills@google.com> 2016-01-27 22:58:16 -0800
committer Mitchell Wills <mwills@google.com> 2016-01-28 23:10:30 -0800
commit9eeba37851ef432cca7e35675a6b64b2b83b802c (patch)
tree57081e73ad72e7f84ecaa770f4a27fae8401839b
parenta3fc54f0d879cbf0bdbb5bd2fe5043dd19232191 (diff)
Add a hidden anqp field to ScanResult
This allows ScanResults from WifiScanner to contain anqp data Bug: 26525037 Change-Id: I54beb3c4e0b8bff06a8255d2dc53439941be3c66
-rw-r--r--wifi/java/android/net/wifi/ScanResult.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index dc067896623b..1f0533959e01 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -18,7 +18,9 @@ package android.net.wifi;
import android.os.Parcel;
import android.os.Parcelable;
-import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
/**
* Describes information about a detected access point. In addition
@@ -301,6 +303,12 @@ public class ScanResult implements Parcelable {
/**
* @hide
+ * anqp lines from supplicant BSS response
+ */
+ public List<String> anqpLines;
+
+ /**
+ * @hide
* storing the raw bytes of full result IEs
**/
public byte[] bytes;
@@ -518,6 +526,15 @@ public class ScanResult implements Parcelable {
} else {
dest.writeInt(0);
}
+
+ if (anqpLines != null) {
+ dest.writeInt(anqpLines.size());
+ for (int i = 0; i < anqpLines.size(); i++) {
+ dest.writeString(anqpLines.get(i));
+ }
+ } else {
+ dest.writeInt(0);
+ }
}
/** Implement the Parcelable interface {@hide} */
@@ -565,6 +582,14 @@ public class ScanResult implements Parcelable {
in.readByteArray(sr.informationElements[i].bytes);
}
}
+
+ n = in.readInt();
+ if (n != 0) {
+ sr.anqpLines = new ArrayList<String>();
+ for (int i = 0; i < n; i++) {
+ sr.anqpLines.add(in.readString());
+ }
+ }
return sr;
}