summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author James Mattis <jmattis@google.com> 2022-02-04 23:05:27 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-02-04 23:05:27 +0000
commite4ad2e515e4521fbd70ce274eb12c333b9e94fbd (patch)
treeab2b58aaef63b820aad60285d2cd1958470293ee
parentf4a4508e6477acac3b5107d91ae3dbcf228c4851 (diff)
parente8308b2d7aaec64c7c75b361dd2e64adfdd6e6a0 (diff)
Merge "Adding permission for Ethernet Network Management"
-rw-r--r--core/api/system-current.txt1
-rw-r--r--core/res/AndroidManifest.xml5
-rw-r--r--packages/ConnectivityT/framework-t/src/android/net/EthernetManager.java3
3 files changed, 9 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 3c483f4a2a6a..a0d1557ad0e0 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -145,6 +145,7 @@ package android {
field public static final String MANAGE_CONTENT_CAPTURE = "android.permission.MANAGE_CONTENT_CAPTURE";
field public static final String MANAGE_CONTENT_SUGGESTIONS = "android.permission.MANAGE_CONTENT_SUGGESTIONS";
field public static final String MANAGE_DEBUGGING = "android.permission.MANAGE_DEBUGGING";
+ field public static final String MANAGE_ETHERNET_NETWORKS = "android.permission.MANAGE_ETHERNET_NETWORKS";
field public static final String MANAGE_FACTORY_RESET_PROTECTION = "android.permission.MANAGE_FACTORY_RESET_PROTECTION";
field public static final String MANAGE_HOTWORD_DETECTION = "android.permission.MANAGE_HOTWORD_DETECTION";
field public static final String MANAGE_IPSEC_TUNNELS = "android.permission.MANAGE_IPSEC_TUNNELS";
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 7f95ca912366..111b694d65f3 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1945,6 +1945,11 @@
<permission android:name="android.permission.CONTROL_OEM_PAID_NETWORK_PREFERENCE"
android:protectionLevel="signature" />
+ <!-- @SystemApi @hide Allows an application to manage ethernet networks.
+ <p>Not for use by third-party or privileged applications. -->
+ <permission android:name="android.permission.MANAGE_ETHERNET_NETWORKS"
+ android:protectionLevel="signature" />
+
<!-- ======================================= -->
<!-- Permissions for short range, peripheral networks -->
<!-- ======================================= -->
diff --git a/packages/ConnectivityT/framework-t/src/android/net/EthernetManager.java b/packages/ConnectivityT/framework-t/src/android/net/EthernetManager.java
index f472d563c477..e0ce081c0276 100644
--- a/packages/ConnectivityT/framework-t/src/android/net/EthernetManager.java
+++ b/packages/ConnectivityT/framework-t/src/android/net/EthernetManager.java
@@ -358,6 +358,7 @@ public class EthernetManager {
return proxy;
}
+ @RequiresPermission(android.Manifest.permission.MANAGE_ETHERNET_NETWORKS)
private void updateConfiguration(
@NonNull String iface,
@NonNull EthernetNetworkUpdateRequest request,
@@ -372,6 +373,7 @@ public class EthernetManager {
}
}
+ @RequiresPermission(android.Manifest.permission.MANAGE_ETHERNET_NETWORKS)
private void connectNetwork(
@NonNull String iface,
@Nullable @CallbackExecutor Executor executor,
@@ -385,6 +387,7 @@ public class EthernetManager {
}
}
+ @RequiresPermission(android.Manifest.permission.MANAGE_ETHERNET_NETWORKS)
private void disconnectNetwork(
@NonNull String iface,
@Nullable @CallbackExecutor Executor executor,