summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Remi NGUYEN VAN <reminv@google.com> 2020-03-09 07:42:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-03-09 07:42:25 +0000
commitb3d7fe48adeddbef8a7c238b65cc37be49346978 (patch)
treead3d0681b4c7ee4f0b8231e92e1451fbc5999f99
parente09d5feef22152f2ab52b955c6f74d95b6fa76d0 (diff)
parentbb5104fa138fdbf4554a14e875833759cd4d18da (diff)
Merge "Add missing RequiresPermission to EthernetManager"
-rwxr-xr-xapi/system-current.txt2
-rw-r--r--api/test-current.txt2
-rw-r--r--core/java/android/net/EthernetManager.java5
3 files changed, 7 insertions, 2 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 3bd335315b6f..b1794761aa67 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -4460,7 +4460,7 @@ package android.net {
}
public class EthernetManager {
- method @NonNull public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
}
public static interface EthernetManager.TetheredInterfaceCallback {
diff --git a/api/test-current.txt b/api/test-current.txt
index bc4425df46d8..61cac89ca91c 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -1440,7 +1440,7 @@ package android.net {
}
public class EthernetManager {
- method @NonNull public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
+ method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
}
public static interface EthernetManager.TetheredInterfaceCallback {
diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java
index 139f5bebcd89..83b5f63576f2 100644
--- a/core/java/android/net/EthernetManager.java
+++ b/core/java/android/net/EthernetManager.java
@@ -17,6 +17,7 @@
package android.net;
import android.annotation.NonNull;
+import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
@@ -248,6 +249,10 @@ public class EthernetManager {
* interface, the existing interface will be used.
* @param callback A callback to be called once the request has been fulfilled.
*/
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.NETWORK_STACK,
+ android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
+ })
@NonNull
public TetheredInterfaceRequest requestTetheredInterface(@NonNull final Executor executor,
@NonNull final TetheredInterfaceCallback callback) {