diff options
| author | 2021-01-12 18:48:13 +0800 | |
|---|---|---|
| committer | 2021-01-27 09:27:26 +0800 | |
| commit | 5e26cc8c564279497f76fe7e713b7de9191043cb (patch) | |
| tree | 723e0806cd262801cd7b5d441d4bb8c2ae48a10f | |
| parent | 5d496eb9b3388daed3ced89bc451b41149756b64 (diff) | |
Expose UdpEncapsulationSocket.getResourceId()
ConnectivityManager.createSocketKeepalive() will need to get
the socket resource ID as a parameter for creating a new
NattSocketKeepalive. ConnectivityManager is a part of incoming
ConnectivityService mainline, so expose getResourceId() as an
API since the hidden APIs are not accessible for a mainline
module. This API should not be exposed to apps, so make it a
MODULE_LIBRARIES system API.
Bug: 172183305
Test: make update-api
Change-Id: Ic0722352ea186fcb18a2d91cc3969f771fde9e86
| -rw-r--r-- | core/api/module-lib-current.txt | 4 | ||||
| -rw-r--r-- | core/java/android/net/IpSecManager.java | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index bc4a3ca8b244..061d4ccbc473 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -14,6 +14,10 @@ package android.net { method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_TEST_NETWORKS, android.Manifest.permission.NETWORK_STACK}) public void simulateDataStall(int, long, @NonNull android.net.Network, @NonNull android.os.PersistableBundle); } + public static final class IpSecManager.UdpEncapsulationSocket implements java.lang.AutoCloseable { + method public int getResourceId(); + } + public final class NetworkCapabilities implements android.os.Parcelable { field public static final int TRANSPORT_TEST = 7; // 0x7 } diff --git a/core/java/android/net/IpSecManager.java b/core/java/android/net/IpSecManager.java index b6ae7ecfdbe4..60923f5ea8c6 100644 --- a/core/java/android/net/IpSecManager.java +++ b/core/java/android/net/IpSecManager.java @@ -15,6 +15,8 @@ */ package android.net; +import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; + import static com.android.internal.util.Preconditions.checkNotNull; import android.annotation.NonNull; @@ -628,7 +630,7 @@ public final class IpSecManager { } /** @hide */ - @VisibleForTesting + @SystemApi(client = MODULE_LIBRARIES) public int getResourceId() { return mResourceId; } |