Revert "Expose uids related APIs in NetworkRequest and NetworkCa..."

Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I45e08f89533af0d6851add38fecb5c6c114615ae
diff --git a/framework/api/module-lib-current.txt b/framework/api/module-lib-current.txt
index 6339094..bb29647 100644
--- a/framework/api/module-lib-current.txt
+++ b/framework/api/module-lib-current.txt
@@ -27,18 +27,9 @@
   }
 
   public final class NetworkCapabilities implements android.os.Parcelable {
-    method @Nullable public java.util.Set<android.util.Range<java.lang.Integer>> getUids();
     field public static final int TRANSPORT_TEST = 7; // 0x7
   }
 
-  public static final class NetworkCapabilities.Builder {
-    method @NonNull public android.net.NetworkCapabilities.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
-  }
-
-  public static class NetworkRequest.Builder {
-    method @NonNull public android.net.NetworkRequest.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
-  }
-
   public class ParseException extends java.lang.RuntimeException {
     ctor public ParseException(@NonNull String);
     ctor public ParseException(@NonNull String, @NonNull Throwable);
diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java
index 182bc71..ba9f21b 100644
--- a/framework/src/android/net/NetworkCapabilities.java
+++ b/framework/src/android/net/NetworkCapabilities.java
@@ -22,7 +22,6 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.RequiresPermission;
-import android.annotation.SuppressLint;
 import android.annotation.SystemApi;
 import android.compat.annotation.UnsupportedAppUsage;
 import android.net.ConnectivityManager.NetworkCallback;
@@ -1478,13 +1477,8 @@
     /**
      * Get the list of UIDs this network applies to.
      * This returns a copy of the set so that callers can't modify the original object.
-     *
-     * @return the list of UIDs this network applies to. If {@code null}, then the network applies
-     *         to all UIDs.
      * @hide
      */
-    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
-    @SuppressLint("NullableCollection")
     public @Nullable Set<Range<Integer>> getUids() {
         return UidRange.toIntRanges(mUids);
     }
@@ -2668,21 +2662,6 @@
         }
 
         /**
-         * Set the list of UIDs this network applies to.
-         *
-         * @param uids the list of UIDs this network applies to, or {@code null} if this network
-         *             applies to all UIDs.
-         * @return this builder
-         * @hide
-         */
-        @NonNull
-        @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
-        public Builder setUids(@Nullable Set<Range<Integer>> uids) {
-            mCaps.setUids(uids);
-            return this;
-        }
-
-        /**
          * Builds the instance of the capabilities.
          *
          * @return the built instance of NetworkCapabilities.
diff --git a/framework/src/android/net/NetworkRequest.java b/framework/src/android/net/NetworkRequest.java
index cf131f0..4ebbf06 100644
--- a/framework/src/android/net/NetworkRequest.java
+++ b/framework/src/android/net/NetworkRequest.java
@@ -36,7 +36,6 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.RequiresPermission;
-import android.annotation.SuppressLint;
 import android.annotation.SystemApi;
 import android.compat.annotation.UnsupportedAppUsage;
 import android.net.NetworkCapabilities.NetCapability;
@@ -283,9 +282,6 @@
          * @return The builder to facilitate chaining.
          * @hide
          */
-        @NonNull
-        @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
-        @SuppressLint("MissingGetterMatchingBuilder")
         public Builder setUids(@Nullable Set<Range<Integer>> uids) {
             mNetworkCapabilities.setUids(uids);
             return this;