summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lorenzo Colitti <lorenzo@google.com> 2015-05-19 23:31:49 +0900
committer Lorenzo Colitti <lorenzo@google.com> 2015-05-20 00:35:24 +0900
commit84b83c5a95c9822683eec5a348893c1afba17444 (patch)
tree37fcdbf42f4e2bda5e4ebeb71ceb307d401459cf
parent7597dc7c4dfe49ba7c5d0e7568873521b90c6682 (diff)
Add a hidden method to clear the capabilities of a NetworkRequest
Change-Id: I41d4f2229259d0bf9d68aa00f92f3bf4e2e71fbc
-rw-r--r--core/java/android/net/NetworkRequest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/net/NetworkRequest.java b/core/java/android/net/NetworkRequest.java
index 7838b47d975b..e61594ce8b3a 100644
--- a/core/java/android/net/NetworkRequest.java
+++ b/core/java/android/net/NetworkRequest.java
@@ -115,6 +115,18 @@ public class NetworkRequest implements Parcelable {
}
/**
+ * Completely clears all the {@code NetworkCapabilities} from this builder instance,
+ * removing even the capabilities that are set by default when the object is constructed.
+ *
+ * @return The builder to facilitate chaining.
+ * @hide
+ */
+ public Builder clearCapabilities() {
+ mNetworkCapabilities.clearAll();
+ return this;
+ }
+
+ /**
* Adds the given transport requirement to this builder. These represent
* the set of allowed transports for the request. Only networks using one
* of these transports will satisfy the request. If no particular transports