summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2019-06-05 05:00:14 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-06-05 05:00:14 +0000
commit79e58ad90120166ca81b9717f2a4abe915b2a647 (patch)
tree78394a6d0d780f12cc219d30b871eda41dee1d5d /core/java/android
parenta8abb52707c7134cfbef2f05d618b0b9d9f4d631 (diff)
parent091de3f0a6f4f5dbd9117cb586a908f3fbdcf204 (diff)
Merge "Allow passing in acceptUnvalidated without explicitlySelected"
Diffstat (limited to 'core/java/android')
-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 aeb464b8d6a8..ed088d0a6756 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -433,7 +433,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);
}
/**