diff options
| author | Sudheer Shanka <sudheersai@google.com> | 2021-03-25 12:41:07 +0000 |
|---|---|---|
| committer | Sudheer Shanka <sudheersai@google.com> | 2021-03-29 12:39:12 +0000 |
| commit | d3ba15beeb4709a62bad2a5f73bd71ae3bf193f1 (patch) | |
| tree | 6157511640d9388922ac36198b5f55eaf9b5472b /core/java | |
| parent | 31e7ebdd30da4d808685a50e6109d4808ebac674 (diff) | |
Remove NetworkPolicyManager.isUidBlocked() API.
It isn't used by ConnectivityService any more and even if
it needs such utility method in the future, we could create
one which is part of connectivity module and doesn't need
to be exposed as part of NetworkPolicyManager API surface.
Bug: 183696103
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Change-Id: Ie3c681f88e4b2b9bb92d2224c5ea96b074f155d5
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/NetworkPolicyManager.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/core/java/android/net/NetworkPolicyManager.java b/core/java/android/net/NetworkPolicyManager.java index 39713297e762..68606ec90dc9 100644 --- a/core/java/android/net/NetworkPolicyManager.java +++ b/core/java/android/net/NetworkPolicyManager.java @@ -18,8 +18,6 @@ package android.net; import static android.app.ActivityManager.procStateToString; import static android.content.pm.PackageManager.GET_SIGNATURES; -import static android.net.ConnectivityManager.BLOCKED_METERED_REASON_MASK; -import static android.net.ConnectivityManager.BLOCKED_REASON_NONE; import android.annotation.IntDef; import android.annotation.NonNull; @@ -787,36 +785,6 @@ public class NetworkPolicyManager { } /** - * Returns whether network access of an UID is blocked or not based on {@code blockedReasons} - * corresponding to it. - * - * {@code blockedReasons} would be a bitwise {@code OR} combination of the - * {@code BLOCKED_REASON_*} and/or {@code BLOCKED_METERED_REASON_*} constants. - * - * @param blockedReasons Value indicating the reasons for why the network access of an UID is - * blocked. If the value is equal to - * {@link ConnectivityManager#BLOCKED_REASON_NONE}, then - * it indicates that an app's network access is not blocked. - * @param meteredNetwork Value indicating whether the network is metered or not. - * @return Whether network access is blocked or not. - * @hide - */ - @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) - public static boolean isUidBlocked(int blockedReasons, boolean meteredNetwork) { - if (blockedReasons == BLOCKED_REASON_NONE) { - return false; - } - final int blockedOnAllNetworksReason = (blockedReasons & ~BLOCKED_METERED_REASON_MASK); - if (blockedOnAllNetworksReason != BLOCKED_REASON_NONE) { - return true; - } - if (meteredNetwork) { - return blockedReasons != BLOCKED_REASON_NONE; - } - return false; - } - - /** * Returns the {@code string} representation of {@code blockedReasons} argument. * * @param blockedReasons Value indicating the reasons for why the network access of an UID is |
