Merge "Remove NetworkPermissionConfig package" into tm-dev am: 662443c6d2

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/NetworkStack/+/17822090

Change-Id: I6856f5dfb24e3da6a163251545b20384fbba075b
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/Android.bp b/Android.bp
index ec7f8b0..7ecfed3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -347,11 +347,9 @@
     manifest: "AndroidManifest_InProcess.xml",
     // InProcessNetworkStack is a replacement for NetworkStack
     overrides: ["NetworkStack", "NetworkStackNext"],
-    // The permission configuration *must* be included to ensure security of the device
     // The InProcessNetworkStack goes together with the PlatformCaptivePortalLogin, which replaces
     // the default CaptivePortalLogin.
     required: [
-        "PlatformNetworkPermissionConfig",
         "PlatformCaptivePortalLogin",
     ],
 }
@@ -379,9 +377,7 @@
     static_libs: ["NetworkStackNextManifestBase"],
     certificate: "networkstack",
     manifest: "AndroidManifest_Next.xml",
-    // The permission configuration *must* be included to ensure security of the device
     required: [
-        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
     lint: { strict_updatability_linting: true },
@@ -394,9 +390,7 @@
     static_libs: ["NetworkStackApiStableLib"],
     certificate: "networkstack",
     manifest: "AndroidManifest.xml",
-    // The permission configuration *must* be included to ensure security of the device
     required: [
-        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
     updatable: true,
@@ -475,9 +469,7 @@
     static_libs: ["NetworkStackApiStableLib"],
     certificate: "networkstack",
     manifest: ":NetworkStackTestAndroidManifest",
-    // The permission configuration *must* be included to ensure security of the device
     required: [
-        "NetworkPermissionConfig",
         "privapp_whitelist_com.android.networkstack",
     ],
 }
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8750795..b27c78f 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -23,6 +23,8 @@
   android:versionName="s_aml_319999900"
   coreApp="true"
 >
+    <permission android:name="android.permission.MAINLINE_NETWORK_STACK"
+                android:protectionLevel="signature"/>
     <!-- Permissions must be defined here, and not in the base manifest, as the network stack
          running in the system server process does not need any permission, and having privileged
          permissions added would cause crashes on startup unless they are also added to the
diff --git a/AndroidManifest_InProcess.xml b/AndroidManifest_InProcess.xml
index 6c64d87..d8c5feb 100644
--- a/AndroidManifest_InProcess.xml
+++ b/AndroidManifest_InProcess.xml
@@ -21,6 +21,8 @@
           android:sharedUserId="android.uid.system"
           android:process="system"
           coreApp="true">
+    <permission android:name="android.permission.MAINLINE_NETWORK_STACK"
+                android:protectionLevel="signature"/>
     <application>
         <service android:name="com.android.server.NetworkStackService"
                  android:process="system"