From fb2b21a167b61bd78150d7f20f8f4269b4b4a7bd Mon Sep 17 00:00:00 2001 From: Aaron Huang Date: Thu, 27 May 2021 15:00:24 +0800 Subject: Remove IntDef annotations from NetworkPolicyManager @RestrictBackgroundStatus and @MultipathPreference are defined in connectivity mainline module. Annotate these in non-updatable platform is not going to be manageable long term. For example, if the module gets updated and the annotation gets more values then it's a problem in non-updatable platform. So, it should not have IntDef cross module boundaries. The javadoc already document the return type. Bug: 183972925 Test: build Change-Id: I371e61fc1ba4d6137139bcfbf1d57fdebe00a257 --- Android.bp | 1 - core/java/android/net/NetworkPolicyManager.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/Android.bp b/Android.bp index 6c5acd2b416b..2321cc5dd61d 100644 --- a/Android.bp +++ b/Android.bp @@ -322,7 +322,6 @@ java_defaults { libs: [ "app-compat-annotations", "ext", - "framework-connectivity-annotations", "framework-updatable-stubs-module_libs_api", "unsupportedappusage", ], diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java index d8050ed5329d..7ebb646ba3eb 100644 --- a/core/java/android/net/NetworkPolicyManager.java +++ b/core/java/android/net/NetworkPolicyManager.java @@ -34,8 +34,6 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; -import android.net.ConnectivityAnnotations.MultipathPreference; -import android.net.ConnectivityAnnotations.RestrictBackgroundStatus; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.os.Build; @@ -465,7 +463,6 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) - @RestrictBackgroundStatus public int getRestrictBackgroundStatus(int uid) { try { return mService.getRestrictBackgroundStatus(uid); @@ -591,7 +588,6 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) - @MultipathPreference public int getMultipathPreference(@NonNull Network network) { try { return mService.getMultipathPreference(network); -- cgit v1.2.3-59-g8ed1b