From 0ee85f3bf8459dbe686bc3b26882c99123edf3ae Mon Sep 17 00:00:00 2001 From: junyulai Date: Fri, 22 Jan 2021 16:43:01 +0800 Subject: [PATCH] [FUI16] Expose setSubscriberId in NetworkAgentConfig as system API The wifi (mainline module) need to set the subscriberId for specific wifi network. Bug: 176396812 Test: TreeHugger Change-Id: Ib568ce0c2d1b629e1c20e7ac8d8b78579cf4825c --- core/api/module-lib-current.txt | 8 ++++++++ core/java/android/net/NetworkAgentConfig.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 061d4ccbc473e..0ec1e092368cf 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -18,6 +18,14 @@ package android.net { method public int getResourceId(); } + public final class NetworkAgentConfig implements android.os.Parcelable { + method @Nullable public String getSubscriberId(); + } + + public static final class NetworkAgentConfig.Builder { + method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String); + } + public final class NetworkCapabilities implements android.os.Parcelable { field public static final int TRANSPORT_TEST = 7; // 0x7 } diff --git a/core/java/android/net/NetworkAgentConfig.java b/core/java/android/net/NetworkAgentConfig.java index fe1268d79b891..664c2650ff0c3 100644 --- a/core/java/android/net/NetworkAgentConfig.java +++ b/core/java/android/net/NetworkAgentConfig.java @@ -16,6 +16,8 @@ package android.net; +import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; + import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; @@ -125,6 +127,7 @@ public final class NetworkAgentConfig implements Parcelable { * @return the subscriber ID, or null if none. * @hide */ + @SystemApi(client = MODULE_LIBRARIES) @Nullable public String getSubscriberId() { return subscriberId; @@ -275,6 +278,7 @@ public final class NetworkAgentConfig implements Parcelable { * @hide */ @NonNull + @SystemApi(client = MODULE_LIBRARIES) public Builder setSubscriberId(@Nullable String subscriberId) { mConfig.subscriberId = subscriberId; return this;