From 11f3924f185aee2175b985b78aa28a45884bc077 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Mon, 9 Mar 2020 13:56:18 +0900 Subject: [PATCH] Add missing RequiresPermission to EthernetManager The method requires NETWORK_STACK or MAINLINE_NETWORK_STACK permissions, but the annotation was missing. Test: m Fixes: 150877670 Change-Id: I2af74cbcfa642f05f5e7bf85b2a8e8c38595f6ca --- core/java/android/net/EthernetManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java index 139f5bebcd..83b5f63576 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) {