diff --git a/framework/api/module-lib-current.txt b/framework/api/module-lib-current.txt index 8da421dd6c..5cfab5d471 100644 --- a/framework/api/module-lib-current.txt +++ b/framework/api/module-lib-current.txt @@ -132,6 +132,7 @@ package android.net { } public final class NetworkCapabilities implements android.os.Parcelable { + method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public java.util.Set getAccessUids(); method @Nullable public java.util.Set> getUids(); method public boolean hasForbiddenCapability(int); field public static final long REDACT_ALL = -1L; // 0xffffffffffffffffL @@ -143,6 +144,7 @@ package android.net { } public static final class NetworkCapabilities.Builder { + method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setAccessUids(@NonNull java.util.Set); method @NonNull public android.net.NetworkCapabilities.Builder setUids(@Nullable java.util.Set>); } diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java index a39e192065..4254a66c88 100644 --- a/framework/src/android/net/NetworkCapabilities.java +++ b/framework/src/android/net/NetworkCapabilities.java @@ -1853,13 +1853,13 @@ public final class NetworkCapabilities implements Parcelable { * the UID doesn't hold the USE_RESTRICTED_NETWORKS permission. This is defined by the * network agent in charge of creating the network. * - * Only network factories and the system server can see these UIDs, since the system + * The UIDs are only visible to network factories and the system server, since the system * server makes sure to redact them before sending a NetworkCapabilities to a process * that doesn't hold the permission. * * @hide */ - // @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public @NonNull Set getAccessUids() { return new ArraySet<>(mAccessUids); @@ -3021,9 +3021,9 @@ public final class NetworkCapabilities implements Parcelable { * the associated subscription. Failure to comply with these rules will see this member * cleared. *

- * Only network factories and the system server can see these UIDs, since the system server - * makes sure to redact them before sending a {@link NetworkCapabilities} instance to a - * process that doesn't hold the {@link android.Manifest.permission.NETWORK_FACTORY} + * These UIDs are only visible to network factories and the system server, since the system + * server makes sure to redact them before sending a {@link NetworkCapabilities} instance + * to a process that doesn't hold the {@link android.Manifest.permission.NETWORK_FACTORY} * permission. *

* This list cannot be null, but it can be empty to mean that no UID without the @@ -3035,7 +3035,7 @@ public final class NetworkCapabilities implements Parcelable { * @hide */ @NonNull - // @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public Builder setAccessUids(@NonNull Set uids) { Objects.requireNonNull(uids);