Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb2b21a1 authored by Aaron Huang's avatar Aaron Huang
Browse files

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
parent 018e1142
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -322,7 +322,6 @@ java_defaults {
    libs: [
        "app-compat-annotations",
        "ext",
        "framework-connectivity-annotations",
        "framework-updatable-stubs-module_libs_api",
        "unsupportedappusage",
    ],
+0 −4
Original line number Diff line number Diff line
@@ -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);