summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeremy Joslin <jjoslin@google.com> 2016-04-15 20:14:01 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-04-15 20:14:03 +0000
commite9f5cd3784b0c13c34c40a9bc01dcadb6e7bc8b3 (patch)
treebc8783d99fe0257613ed2b8701e69cca324e6064
parentb8563f1ae4c56da7ca7839739c1427ed0ca6a281 (diff)
parentfc8601310d9af6e8ac16a118b16a1ae414e93900 (diff)
Merge "Added useExternalScores field to WifiConfiguration." into nyc-dev
-rw-r--r--api/system-current.txt1
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java17
2 files changed, 17 insertions, 1 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 39b1c2ce008b..0ba3fd8a53cc 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -26577,6 +26577,7 @@ package android.net.wifi {
field public java.lang.String providerFriendlyName;
field public long[] roamingConsortiumIds;
field public int status;
+ field public boolean useExternalScores;
field public java.lang.String[] wepKeys;
field public int wepTxKeyIndex;
}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index b8ef150a361c..9d0c20ce4c5d 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -691,6 +691,16 @@ public class WifiConfiguration implements Parcelable {
/**
* @hide
+ * Setting this value will force scan results associated with this configuration to
+ * be included in the bucket of networks that are externally scored.
+ * If not set, associated scan results will be treated as legacy saved networks and
+ * will take precedence over networks in the scored category.
+ */
+ @SystemApi
+ public boolean useExternalScores;
+
+ /**
+ * @hide
* Number of time the scorer overrode a the priority based choice, when comparing two
* WifiConfigurations, note that since comparing WifiConfiguration happens very often
* potentially at every scan, this number might become very large, even on an idle
@@ -1333,6 +1343,7 @@ public class WifiConfiguration implements Parcelable {
didSelfAdd = false;
ephemeral = false;
meteredHint = false;
+ useExternalScores = false;
validatedInternetAccess = false;
mIpConfiguration = new IpConfiguration();
lastUpdateUid = -1;
@@ -1433,8 +1444,9 @@ public class WifiConfiguration implements Parcelable {
if (this.validatedInternetAccess) sbuf.append(" validatedInternetAccess");
if (this.ephemeral) sbuf.append(" ephemeral");
if (this.meteredHint) sbuf.append(" meteredHint");
+ if (this.useExternalScores) sbuf.append(" useExternalScores");
if (this.didSelfAdd || this.selfAdded || this.validatedInternetAccess
- || this.ephemeral || this.meteredHint) {
+ || this.ephemeral || this.meteredHint || this.useExternalScores) {
sbuf.append("\n");
}
sbuf.append(" KeyMgmt:");
@@ -1859,6 +1871,7 @@ public class WifiConfiguration implements Parcelable {
validatedInternetAccess = source.validatedInternetAccess;
ephemeral = source.ephemeral;
meteredHint = source.meteredHint;
+ useExternalScores = source.useExternalScores;
if (source.visibility != null) {
visibility = new Visibility(source.visibility);
}
@@ -1939,6 +1952,7 @@ public class WifiConfiguration implements Parcelable {
dest.writeInt(validatedInternetAccess ? 1 : 0);
dest.writeInt(ephemeral ? 1 : 0);
dest.writeInt(meteredHint ? 1 : 0);
+ dest.writeInt(useExternalScores ? 1 : 0);
dest.writeInt(creatorUid);
dest.writeInt(lastConnectUid);
dest.writeInt(lastUpdateUid);
@@ -2009,6 +2023,7 @@ public class WifiConfiguration implements Parcelable {
config.validatedInternetAccess = in.readInt() != 0;
config.ephemeral = in.readInt() != 0;
config.meteredHint = in.readInt() != 0;
+ config.useExternalScores = in.readInt() != 0;
config.creatorUid = in.readInt();
config.lastConnectUid = in.readInt();
config.lastUpdateUid = in.readInt();