summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJunyu Lai <junyulai@google.com>2020-03-20 11:03:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-20 11:03:05 +0000
commite281e579cae2c7438fd68420dc06f1cab8a7caae (patch)
treed98cfbdc770f94a12f8011bcfe90063364ee4655 /core/java/android
parent97773cbe29dfef00e8229f29c18b0f4478793a91 (diff)
parent587ecb3a1ea3c88aee0ef984c83f158c4b0fbe81 (diff)
Merge "Expose netId by adding getter API" into rvc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/net/Network.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/net/Network.java b/core/java/android/net/Network.java
index 6f5471baa7ab..f807a4968d72 100644
--- a/core/java/android/net/Network.java
+++ b/core/java/android/net/Network.java
@@ -64,7 +64,7 @@ public class Network implements Parcelable {
* The unique id of the network.
* @hide
*/
- @SystemApi
+ @UnsupportedAppUsage
public final int netId;
// Objects used to perform per-network operations such as getSocketFactory
@@ -170,6 +170,17 @@ public class Network implements Parcelable {
}
/**
+ * Get the unique id of the network.
+ *
+ * @hide
+ */
+ @TestApi
+ @SystemApi
+ public int getNetId() {
+ return netId;
+ }
+
+ /**
* Returns a netid marked with the Private DNS bypass flag.
*
* This flag must be kept in sync with the NETID_USE_LOCAL_NAMESERVERS flag