summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authormarkchien <markchien@google.com>2020-03-18 08:43:07 +0800
committerChalard Jean <jchalard@google.com>2020-03-24 09:19:26 +0000
commitb6858e591968dbd94a8c4f2c5068747fd58e1b6d (patch)
tree7c2c58fc82569ba47c8f179069d18c905498eeaf /core/java
parent6982a7dc690508f5c428b05ac2e94a86920ed5e8 (diff)
Expose netId by adding getter API
Bug: 151156820 Test: m atest TetetheringTests Clean CP from ag/10747732 Change-Id: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899 Merged-In: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
Diffstat (limited to 'core/java')
-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 2bac7a97b717..3d641f5a0029 100644
--- a/core/java/android/net/Network.java
+++ b/core/java/android/net/Network.java
@@ -65,7 +65,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
@@ -171,6 +171,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