summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-06-04 18:00:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-06-04 18:00:31 +0000
commite2fb127e41f5eb3e605be29ceb07cfcfc4411cb2 (patch)
tree1c4c56847f57c2cd4fe9118a113cb9e0864c4bbd /core/java
parentdee07f5d7f03d5944a5f79fd736892fba08bba64 (diff)
parent0e33bd116782f92dc77f65104ec6706e46548742 (diff)
Merge "Allow passing in acceptUnvalidated without explicitlySelected" into qt-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/NetworkAgent.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index f416fc795990..9cd4f5399924 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -434,7 +434,24 @@ public abstract class NetworkAgent extends Handler {
* {@link #saveAcceptUnvalidated} to respect the user's choice.
*/
public void explicitlySelected(boolean acceptUnvalidated) {
- queueOrSendMessage(EVENT_SET_EXPLICITLY_SELECTED, acceptUnvalidated ? 1 : 0, 0);
+ explicitlySelected(true /* explicitlySelected */, acceptUnvalidated);
+ }
+
+ /**
+ * Called by the bearer to indicate this network was manually selected by the user.
+ * This should be called before the NetworkInfo is marked CONNECTED so that this
+ * Network can be given special treatment at that time. If {@code acceptUnvalidated} is
+ * {@code true}, then the system will switch to this network. If it is {@code false} and the
+ * network cannot be validated, the system will ask the user whether to switch to this network.
+ * If the user confirms and selects "don't ask again", then the system will call
+ * {@link #saveAcceptUnvalidated} to persist the user's choice. Thus, if the transport ever
+ * calls this method with {@code acceptUnvalidated} set to {@code false}, it must also implement
+ * {@link #saveAcceptUnvalidated} to respect the user's choice.
+ */
+ public void explicitlySelected(boolean explicitlySelected, boolean acceptUnvalidated) {
+ queueOrSendMessage(EVENT_SET_EXPLICITLY_SELECTED,
+ explicitlySelected ? 1 : 0,
+ acceptUnvalidated ? 1 : 0);
}
/**