diff --git a/framework/Android.bp b/framework/Android.bp
index 9da27d2..86b85e8 100644
--- a/framework/Android.bp
+++ b/framework/Android.bp
@@ -23,7 +23,6 @@
     default_applicable_licenses: ["frameworks_base_license"],
 }
 
-// TODO: use a java_library in the bootclasspath instead
 filegroup {
     name: "framework-connectivity-internal-sources",
     srcs: [
diff --git a/framework/api/current.txt b/framework/api/current.txt
index 4bfcda3..a8f1a4d 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -302,6 +302,7 @@
     field public static final int NET_CAPABILITY_CBS = 5; // 0x5
     field public static final int NET_CAPABILITY_DUN = 2; // 0x2
     field public static final int NET_CAPABILITY_EIMS = 10; // 0xa
+    field public static final int NET_CAPABILITY_ENTERPRISE = 29; // 0x1d
     field public static final int NET_CAPABILITY_FOREGROUND = 19; // 0x13
     field public static final int NET_CAPABILITY_FOTA = 3; // 0x3
     field public static final int NET_CAPABILITY_IA = 7; // 0x7
diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java
index 6273f4b..39ec2ed 100644
--- a/framework/src/android/net/ConnectivityManager.java
+++ b/framework/src/android/net/ConnectivityManager.java
@@ -2245,31 +2245,6 @@
         }
     }
 
-    /* TODO: These permissions checks don't belong in client-side code. Move them to
-     * services.jar, possibly in com.android.server.net. */
-
-    /** {@hide} */
-    public static final void enforceChangePermission(Context context,
-            String callingPkg, String callingAttributionTag) {
-        int uid = Binder.getCallingUid();
-        checkAndNoteChangeNetworkStateOperation(context, uid, callingPkg,
-                callingAttributionTag, true /* throwException */);
-    }
-
-    /**
-     * Check if the package is a allowed to change the network state. This also accounts that such
-     * an access happened.
-     *
-     * @return {@code true} iff the package is allowed to change the network state.
-     */
-    // TODO: Remove method and replace with direct call once R code is pushed to AOSP
-    private static boolean checkAndNoteChangeNetworkStateOperation(@NonNull Context context,
-            int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag,
-            boolean throwException) {
-        return Settings.checkAndNoteChangeNetworkStateOperation(context, uid, callingPackage,
-                throwException);
-    }
-
     /**
      * Check if the package is a allowed to write settings. This also accounts that such an access
      * happened.
@@ -2281,7 +2256,7 @@
             @NonNull String callingPackage, @Nullable String callingAttributionTag,
             boolean throwException) {
         return Settings.checkAndNoteWriteSettingsOperation(context, uid, callingPackage,
-                throwException);
+                callingAttributionTag, throwException);
     }
 
     /**
diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java
index 26d14cb..cd76f40 100644
--- a/framework/src/android/net/NetworkCapabilities.java
+++ b/framework/src/android/net/NetworkCapabilities.java
@@ -205,6 +205,7 @@
             NET_CAPABILITY_OEM_PRIVATE,
             NET_CAPABILITY_VEHICLE_INTERNAL,
             NET_CAPABILITY_NOT_VCN_MANAGED,
+            NET_CAPABILITY_ENTERPRISE,
     })
     public @interface NetCapability { }
 
@@ -415,8 +416,17 @@
     @SystemApi
     public static final int NET_CAPABILITY_NOT_VCN_MANAGED = 28;
 
+    /**
+     * Indicates that this network is intended for enterprise use.
+     * <p>
+     * 5G URSP rules may indicate that all data should use a connection dedicated for enterprise
+     * use. If the enterprise capability is requested, all enterprise traffic will be routed over
+     * the connection with this capability.
+     */
+    public static final int NET_CAPABILITY_ENTERPRISE = 29;
+
     private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
-    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_NOT_VCN_MANAGED;
+    private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_ENTERPRISE;
 
     /**
      * Network capabilities that are expected to be mutable, i.e., can change while a particular
@@ -474,7 +484,8 @@
             | (1 << NET_CAPABILITY_MCX)
             | (1 << NET_CAPABILITY_RCS)
             | (1 << NET_CAPABILITY_VEHICLE_INTERNAL)
-            | (1 << NET_CAPABILITY_XCAP);
+            | (1 << NET_CAPABILITY_XCAP)
+            | (1 << NET_CAPABILITY_ENTERPRISE);
 
     /**
      * Capabilities that force network to be restricted.
@@ -2028,8 +2039,9 @@
             case NET_CAPABILITY_PARTIAL_CONNECTIVITY: return "PARTIAL_CONNECTIVITY";
             case NET_CAPABILITY_TEMPORARILY_NOT_METERED:    return "TEMPORARILY_NOT_METERED";
             case NET_CAPABILITY_OEM_PRIVATE:          return "OEM_PRIVATE";
-            case NET_CAPABILITY_VEHICLE_INTERNAL:     return "NET_CAPABILITY_VEHICLE_INTERNAL";
+            case NET_CAPABILITY_VEHICLE_INTERNAL:     return "VEHICLE_INTERNAL";
             case NET_CAPABILITY_NOT_VCN_MANAGED:      return "NOT_VCN_MANAGED";
+            case NET_CAPABILITY_ENTERPRISE:           return "ENTERPRISE";
             default:                                  return Integer.toString(capability);
         }
     }
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 1bb91d5..9e0ea9c 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2197,8 +2197,45 @@
                 "ConnectivityService");
     }
 
+    /**
+     * Performs a strict and comprehensive check of whether a calling package is allowed to
+     * change the state of network, as the condition differs for pre-M, M+, and
+     * privileged/preinstalled apps. The caller is expected to have either the
+     * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
+     * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
+     * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
+     * permission and cannot be revoked. See http://b/23597341
+     *
+     * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
+     * of this app will be updated to the current time.
+     */
     private void enforceChangePermission(String callingPkg, String callingAttributionTag) {
-        ConnectivityManager.enforceChangePermission(mContext, callingPkg, callingAttributionTag);
+        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
+                == PackageManager.PERMISSION_GRANTED) {
+            return;
+        }
+
+        if (callingPkg == null) {
+            throw new SecurityException("Calling package name is null.");
+        }
+
+        final AppOpsManager appOpsMgr = mContext.getSystemService(AppOpsManager.class);
+        final int uid = mDeps.getCallingUid();
+        final int mode = appOpsMgr.noteOpNoThrow(AppOpsManager.OPSTR_WRITE_SETTINGS, uid,
+                callingPkg, callingAttributionTag, null /* message */);
+
+        if (mode == AppOpsManager.MODE_ALLOWED) {
+            return;
+        }
+
+        if ((mode == AppOpsManager.MODE_DEFAULT) && (mContext.checkCallingOrSelfPermission(
+                android.Manifest.permission.WRITE_SETTINGS) == PackageManager.PERMISSION_GRANTED)) {
+            return;
+        }
+
+        throw new SecurityException(callingPkg + " was not granted either of these permissions:"
+                + android.Manifest.permission.CHANGE_NETWORK_STATE + ","
+                + android.Manifest.permission.WRITE_SETTINGS + ".");
     }
 
     private void enforceSettingsPermission() {
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index e7ac3b6..10ec981 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -53,6 +53,7 @@
 import static android.net.NetworkCapabilities.NET_CAPABILITY_CBS;
 import static android.net.NetworkCapabilities.NET_CAPABILITY_DUN;
 import static android.net.NetworkCapabilities.NET_CAPABILITY_EIMS;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_ENTERPRISE;
 import static android.net.NetworkCapabilities.NET_CAPABILITY_FOREGROUND;
 import static android.net.NetworkCapabilities.NET_CAPABILITY_FOTA;
 import static android.net.NetworkCapabilities.NET_CAPABILITY_IA;
@@ -406,8 +407,6 @@
     private QosCallbackMockHelper mQosCallbackMockHelper;
     private QosCallbackTracker mQosCallbackTracker;
     private VpnManagerService mVpnManagerService;
-    private TestNetworkCallback mDefaultNetworkCallback;
-    private TestNetworkCallback mSystemDefaultNetworkCallback;
 
     // State variables required to emulate NetworkPolicyManagerService behaviour.
     private int mUidRules = RULE_NONE;
@@ -1547,7 +1546,6 @@
 
     @After
     public void tearDown() throws Exception {
-        unregisterDefaultNetworkCallbacks();
         setAlwaysOnNetworks(false);
         if (mCellNetworkAgent != null) {
             mCellNetworkAgent.disconnect();
@@ -2789,7 +2787,8 @@
         if (capability == NET_CAPABILITY_CBS || capability == NET_CAPABILITY_DUN ||
                 capability == NET_CAPABILITY_EIMS || capability == NET_CAPABILITY_FOTA ||
                 capability == NET_CAPABILITY_IA || capability == NET_CAPABILITY_IMS ||
-                capability == NET_CAPABILITY_RCS || capability == NET_CAPABILITY_XCAP) {
+                capability == NET_CAPABILITY_RCS || capability == NET_CAPABILITY_XCAP
+                || capability == NET_CAPABILITY_ENTERPRISE) {
             assertFalse(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
         } else {
             assertTrue(nc.hasCapability(NET_CAPABILITY_NOT_RESTRICTED));
@@ -2892,6 +2891,7 @@
         tryNetworkFactoryRequests(NET_CAPABILITY_IA);
         tryNetworkFactoryRequests(NET_CAPABILITY_RCS);
         tryNetworkFactoryRequests(NET_CAPABILITY_XCAP);
+        tryNetworkFactoryRequests(NET_CAPABILITY_ENTERPRISE);
         tryNetworkFactoryRequests(NET_CAPABILITY_EIMS);
         tryNetworkFactoryRequests(NET_CAPABILITY_NOT_METERED);
         tryNetworkFactoryRequests(NET_CAPABILITY_INTERNET);
@@ -3697,7 +3697,7 @@
      * @return the context's attribution tag
      */
     private String getAttributionTag() {
-        return null;
+        return mContext.getAttributionTag();
     }
 
     @Test
@@ -9462,10 +9462,6 @@
         fail("TOO_MANY_REQUESTS never thrown");
     }
 
-    private UidRange createUidRange(int userId) {
-        return UidRange.createForUser(UserHandle.of(userId));
-    }
-
     private void mockGetApplicationInfo(@NonNull final String packageName, @NonNull final int uid)
             throws Exception {
         final ApplicationInfo applicationInfo = new ApplicationInfo();
@@ -9800,54 +9796,6 @@
             assertEquals(expectedPerAppNetwork, defaultNetwork);
             assertEquals(expectedOemRequestsSize, defaultRequest.mRequests.size());
         }
-        verifyMultipleDefaultCallbacks(expectedDefaultNetwork, expectedPerAppNetwork);
-    }
-
-    /**
-     * Verify default callbacks for 'available' fire as expected. This will only run if
-     * registerDefaultNetworkCallbacks() was executed prior and will only be different if the
-     * setOemNetworkPreference() per-app API was used for the current process.
-     * @param expectedSystemDefault the expected network for the system default.
-     * @param expectedPerAppDefault the expected network for the current process's default.
-     */
-    private void verifyMultipleDefaultCallbacks(
-            @NonNull final Network expectedSystemDefault,
-            @NonNull final Network expectedPerAppDefault) {
-        if (null != mSystemDefaultNetworkCallback && null != expectedSystemDefault
-                && mService.mNoServiceNetwork.network() != expectedSystemDefault) {
-            // getLastAvailableNetwork() is used as this method can be called successively with
-            // the same network to validate therefore expectAvailableThenValidatedCallbacks
-            // can't be used.
-            assertEquals(mSystemDefaultNetworkCallback.getLastAvailableNetwork(),
-                    expectedSystemDefault);
-        }
-        if (null != mDefaultNetworkCallback && null != expectedPerAppDefault
-                && mService.mNoServiceNetwork.network() != expectedPerAppDefault) {
-            assertEquals(mDefaultNetworkCallback.getLastAvailableNetwork(),
-                    expectedPerAppDefault);
-        }
-    }
-
-    private void registerDefaultNetworkCallbacks() {
-        // Using Manifest.permission.NETWORK_SETTINGS for registerSystemDefaultNetworkCallback()
-        mServiceContext.setPermission(
-                Manifest.permission.NETWORK_SETTINGS, PERMISSION_GRANTED);
-        mSystemDefaultNetworkCallback = new TestNetworkCallback();
-        mDefaultNetworkCallback = new TestNetworkCallback();
-        mCm.registerSystemDefaultNetworkCallback(mSystemDefaultNetworkCallback,
-                new Handler(ConnectivityThread.getInstanceLooper()));
-        mCm.registerDefaultNetworkCallback(mDefaultNetworkCallback);
-        mServiceContext.setPermission(
-                Manifest.permission.NETWORK_SETTINGS, PERMISSION_DENIED);
-    }
-
-    private void unregisterDefaultNetworkCallbacks() {
-        if (null != mDefaultNetworkCallback) {
-            mCm.unregisterNetworkCallback(mDefaultNetworkCallback);
-        }
-        if (null != mSystemDefaultNetworkCallback) {
-            mCm.unregisterNetworkCallback(mSystemDefaultNetworkCallback);
-        }
     }
 
     private void setupMultipleDefaultNetworksForOemNetworkPreferenceNotCurrentUidTest(
@@ -9931,7 +9879,6 @@
         @OemNetworkPreferences.OemNetworkPreference final int networkPref =
                 OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY;
         final int expectedOemPrefRequestSize = 1;
-        registerDefaultNetworkCallbacks();
 
         // Setup the test process to use networkPref for their default network.
         setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
@@ -9946,7 +9893,6 @@
 
         // Verify that the active network is correct
         verifyActiveNetwork(TRANSPORT_ETHERNET);
-        // default NCs will be unregistered in tearDown
     }
 
     @Test
@@ -9954,7 +9900,6 @@
         @OemNetworkPreferences.OemNetworkPreference final int networkPref =
                 OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY;
         final int expectedOemPrefRequestSize = 1;
-        registerDefaultNetworkCallbacks();
 
         // Setup the test process to use networkPref for their default network.
         setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
@@ -9975,7 +9920,6 @@
                 mEthernetNetworkAgent.getNetwork());
 
         assertFalse(mCm.isActiveNetworkMetered());
-        // default NCs will be unregistered in tearDown
     }
 
     @Test
@@ -10132,6 +10076,7 @@
 
     /**
      * Test the tracked default requests clear previous OEM requests on setOemNetworkPreference().
+     * @throws Exception
      */
     @Test
     public void testSetOemNetworkPreferenceClearPreviousOemValues() throws Exception {
@@ -10159,8 +10104,9 @@
     }
 
     /**
-     * Test network priority for preference OEM_NETWORK_PREFERENCE_OEM_PAID in the following order:
+     * Test network priority for preference OEM_NETWORK_PREFERENCE_OEM_PAID following in order:
      * NET_CAPABILITY_NOT_METERED -> NET_CAPABILITY_OEM_PAID -> fallback
+     * @throws Exception
      */
     @Test
     public void testMultilayerForPreferenceOemPaidEvaluatesCorrectly()
@@ -10226,8 +10172,9 @@
     }
 
     /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK in the following order:
+     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK following in order:
      * NET_CAPABILITY_NOT_METERED -> NET_CAPABILITY_OEM_PAID
+     * @throws Exception
      */
     @Test
     public void testMultilayerForPreferenceOemPaidNoFallbackEvaluatesCorrectly()
@@ -10288,9 +10235,10 @@
     }
 
     /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY in the following order:
+     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY following in order:
      * NET_CAPABILITY_OEM_PAID
      * This preference should only apply to OEM_PAID networks.
+     * @throws Exception
      */
     @Test
     public void testMultilayerForPreferenceOemPaidOnlyEvaluatesCorrectly()
@@ -10341,9 +10289,10 @@
     }
 
     /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PRIVATE_ONLY in the following order:
+     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PRIVATE_ONLY following in order:
      * NET_CAPABILITY_OEM_PRIVATE
      * This preference should only apply to OEM_PRIVATE networks.
+     * @throws Exception
      */
     @Test
     public void testMultilayerForPreferenceOemPrivateOnlyEvaluatesCorrectly()
@@ -10393,235 +10342,7 @@
                 true /* shouldDestroyNetwork */);
     }
 
-    /**
-     * Test network priority for preference OEM_NETWORK_PREFERENCE_OEM_PAID in the following order:
-     * NET_CAPABILITY_NOT_METERED -> NET_CAPABILITY_OEM_PAID -> fallback
-     */
-    @Test
-    public void testMultipleDefaultNetworksTracksOemNetworkPreferenceOemPaidCorrectly()
-            throws Exception {
-        @OemNetworkPreferences.OemNetworkPreference final int networkPref =
-                OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PAID;
-        setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
-        final int expectedDefaultRequestSize = 2;
-        final int expectedOemPrefRequestSize = 3;
-        registerDefaultNetworkCallbacks();
-
-        // The fallback as well as the OEM preference should now be tracked.
-        assertEquals(expectedDefaultRequestSize, mService.mDefaultNetworkRequests.size());
-
-        // Test lowest to highest priority requests.
-        // Bring up metered cellular. This will satisfy the fallback network.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mCellNetworkAgent.getNetwork());
-
-        // Bring up ethernet with OEM_PAID. This will satisfy NET_CAPABILITY_OEM_PAID.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Bring up unmetered Wi-Fi. This will satisfy NET_CAPABILITY_NOT_METERED.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mWiFiNetworkAgent.getNetwork(),
-                mWiFiNetworkAgent.getNetwork());
-
-        // Disconnecting unmetered Wi-Fi will put the pref on OEM_PAID and fallback on cellular.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting cellular should keep OEM network on OEM_PAID and fallback will be null.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting OEM_PAID will put both on null as it is the last network.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                null);
-
-        // default NCs will be unregistered in tearDown
-    }
-
-    /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK in the following order:
-     * NET_CAPABILITY_NOT_METERED -> NET_CAPABILITY_OEM_PAID
-     */
-    @Test
-    public void testMultipleDefaultNetworksTracksOemNetworkPreferenceOemPaidNoFallbackCorrectly()
-            throws Exception {
-        @OemNetworkPreferences.OemNetworkPreference final int networkPref =
-                OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK;
-        setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
-        final int expectedDefaultRequestSize = 2;
-        final int expectedOemPrefRequestSize = 2;
-        registerDefaultNetworkCallbacks();
-
-        // The fallback as well as the OEM preference should now be tracked.
-        assertEquals(expectedDefaultRequestSize, mService.mDefaultNetworkRequests.size());
-
-        // Test lowest to highest priority requests.
-        // Bring up metered cellular. This will satisfy the fallback network but not the pref.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mService.mNoServiceNetwork.network());
-
-        // Bring up ethernet with OEM_PAID. This will satisfy NET_CAPABILITY_OEM_PAID.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Bring up unmetered Wi-Fi. This will satisfy NET_CAPABILITY_NOT_METERED.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mWiFiNetworkAgent.getNetwork(),
-                mWiFiNetworkAgent.getNetwork());
-
-        // Disconnecting unmetered Wi-Fi will put the OEM pref on OEM_PAID and fallback on cellular.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting cellular should keep OEM network on OEM_PAID and fallback will be null.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting OEM_PAID puts the fallback on null and the pref on the disconnected net.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                mService.mNoServiceNetwork.network());
-
-        // default NCs will be unregistered in tearDown
-    }
-
-    /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY in the following order:
-     * NET_CAPABILITY_OEM_PAID
-     * This preference should only apply to OEM_PAID networks.
-     */
-    @Test
-    public void testMultipleDefaultNetworksTracksOemNetworkPreferenceOemPaidOnlyCorrectly()
-            throws Exception {
-        @OemNetworkPreferences.OemNetworkPreference final int networkPref =
-                OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY;
-        setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
-        final int expectedDefaultRequestSize = 2;
-        final int expectedOemPrefRequestSize = 1;
-        registerDefaultNetworkCallbacks();
-
-        // The fallback as well as the OEM preference should now be tracked.
-        assertEquals(expectedDefaultRequestSize, mService.mDefaultNetworkRequests.size());
-
-        // Test lowest to highest priority requests.
-        // Bring up metered cellular. This will satisfy the fallback network.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mService.mNoServiceNetwork.network());
-
-        // Bring up ethernet with OEM_PAID. This will satisfy NET_CAPABILITY_OEM_PAID.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Bring up unmetered Wi-Fi. The OEM network shouldn't change, the fallback will take Wi-Fi.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mWiFiNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting unmetered Wi-Fi shouldn't change the OEM network with fallback on cellular.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting OEM_PAID will keep the fallback on cellular and nothing for OEM_PAID.
-        // OEM_PAID_ONLY not supporting a fallback now uses the disconnected network.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_ETHERNET, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mService.mNoServiceNetwork.network());
-
-        // Disconnecting cellular will put the fallback on null and the pref on disconnected.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                mService.mNoServiceNetwork.network());
-
-        // default NCs will be unregistered in tearDown
-    }
-
-    /**
-     * Test network priority for OEM_NETWORK_PREFERENCE_OEM_PRIVATE_ONLY in the following order:
-     * NET_CAPABILITY_OEM_PRIVATE
-     * This preference should only apply to OEM_PRIVATE networks.
-     */
-    @Test
-    public void testMultipleDefaultNetworksTracksOemNetworkPreferenceOemPrivateOnlyCorrectly()
-            throws Exception {
-        @OemNetworkPreferences.OemNetworkPreference final int networkPref =
-                OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PRIVATE_ONLY;
-        setupMultipleDefaultNetworksForOemNetworkPreferenceCurrentUidTest(networkPref);
-        final int expectedDefaultRequestSize = 2;
-        final int expectedOemPrefRequestSize = 1;
-        registerDefaultNetworkCallbacks();
-
-        // The fallback as well as the OEM preference should now be tracked.
-        assertEquals(expectedDefaultRequestSize, mService.mDefaultNetworkRequests.size());
-
-        // Test lowest to highest priority requests.
-        // Bring up metered cellular. This will satisfy the fallback network.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mService.mNoServiceNetwork.network());
-
-        // Bring up ethernet with OEM_PRIVATE. This will satisfy NET_CAPABILITY_OEM_PRIVATE.
-        startOemManagedNetwork(false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Bring up unmetered Wi-Fi. The OEM network shouldn't change, the fallback will take Wi-Fi.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, true);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mWiFiNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting unmetered Wi-Fi shouldn't change the OEM network with fallback on cellular.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_WIFI, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mEthernetNetworkAgent.getNetwork());
-
-        // Disconnecting OEM_PRIVATE will keep the fallback on cellular.
-        // OEM_PRIVATE_ONLY not supporting a fallback now uses to the disconnected network.
-        stopOemManagedNetwork();
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                mCellNetworkAgent.getNetwork(),
-                mService.mNoServiceNetwork.network());
-
-        // Disconnecting cellular will put the fallback on null and pref on disconnected.
-        setOemNetworkPreferenceAgentConnected(TRANSPORT_CELLULAR, false);
-        verifyMultipleDefaultNetworksTracksCorrectly(expectedOemPrefRequestSize,
-                null,
-                mService.mNoServiceNetwork.network());
-
-        // default NCs will be unregistered in tearDown
+    private UidRange createUidRange(int userId) {
+        return UidRange.createForUser(UserHandle.of(userId));
     }
 }
diff --git a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
index ff8c632..d01dc03 100644
--- a/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
+++ b/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
@@ -20,6 +20,7 @@
 
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.clearInvocations;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.eq;
 import static org.mockito.Mockito.mock;
@@ -39,6 +40,7 @@
 import android.net.NetworkInfo;
 import android.os.UserHandle;
 import android.telephony.TelephonyManager;
+import android.util.DisplayMetrics;
 
 import androidx.test.filters.SmallTest;
 import androidx.test.runner.AndroidJUnit4;
@@ -88,6 +90,7 @@
 
     @Mock Context mCtx;
     @Mock Resources mResources;
+    @Mock DisplayMetrics mDisplayMetrics;
     @Mock PackageManager mPm;
     @Mock TelephonyManager mTelephonyManager;
     @Mock NotificationManager mNotificationManager;
@@ -99,6 +102,17 @@
 
     NetworkNotificationManager mManager;
 
+
+    @BeforeClass
+    public static void setUpClass() {
+        Notification.DevFlags.sForceDefaults = true;
+    }
+
+    @AfterClass
+    public static void tearDownClass() {
+        Notification.DevFlags.sForceDefaults = false;
+    }
+
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
@@ -109,6 +123,7 @@
         mCellNai.networkInfo = mNetworkInfo;
         mVpnNai.networkCapabilities = VPN_CAPABILITIES;
         mVpnNai.networkInfo = mNetworkInfo;
+        mDisplayMetrics.density = 2.275f;
         doReturn(true).when(mVpnNai).isVPN();
         when(mCtx.getResources()).thenReturn(mResources);
         when(mCtx.getPackageManager()).thenReturn(mPm);
@@ -120,6 +135,7 @@
                 .thenReturn(mNotificationManager);
         when(mNetworkInfo.getExtraInfo()).thenReturn(TEST_EXTRA_INFO);
         when(mResources.getColor(anyInt(), any())).thenReturn(0xFF607D8B);
+        when(mResources.getDisplayMetrics()).thenReturn(mDisplayMetrics);
 
         mManager = new NetworkNotificationManager(mCtx, mTelephonyManager);
     }
@@ -142,15 +158,15 @@
     public void testTitleOfPrivateDnsBroken() {
         // Test the title of mobile data.
         verifyTitleByNetwork(100, mCellNai, R.string.mobile_no_internet);
-        reset(mResources);
+        clearInvocations(mResources);
 
         // Test the title of wifi.
         verifyTitleByNetwork(101, mWifiNai, R.string.wifi_no_internet);
-        reset(mResources);
+        clearInvocations(mResources);
 
         // Test the title of other networks.
         verifyTitleByNetwork(102, mVpnNai, R.string.other_networks_no_internet);
-        reset(mResources);
+        clearInvocations(mResources);
     }
 
     @Test
