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

Commit 6031b0b2 authored by Suprabh Shukla's avatar Suprabh Shukla Committed by Automerger Merge Worker
Browse files

Merge "Temporarily turn background network restrictions off" into main am:...

Merge "Temporarily turn background network restrictions off" into main am: bd32ebb3 am: 5c050eaf

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2966442



Change-Id: I5cea95f0d461d9832e9a08dee2a3914e62a77541
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a3d1540e 5c050eaf
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -340,6 +340,8 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
    static final String TAG = NetworkPolicyLogger.TAG;
    private static final boolean LOGD = NetworkPolicyLogger.LOGD;
    private static final boolean LOGV = NetworkPolicyLogger.LOGV;
    // TODO: b/304347838 - Remove once the feature is in staging.
    private static final boolean ALWAYS_RESTRICT_BACKGROUND_NETWORK = false;

    /**
     * No opportunistic quota could be calculated from user data plan or data settings.
@@ -1061,7 +1063,8 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
                    }

                    // The flag is boot-stable.
                    mBackgroundNetworkRestricted = Flags.networkBlockedForTopSleepingAndAbove();
                    mBackgroundNetworkRestricted = ALWAYS_RESTRICT_BACKGROUND_NETWORK
                            && Flags.networkBlockedForTopSleepingAndAbove();
                    if (mBackgroundNetworkRestricted) {
                        // Firewall rules and UidBlockedState will get updated in
                        // updateRulesForGlobalChangeAL below.
+5 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ import libcore.io.Streams;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.MethodRule;
@@ -2217,6 +2218,7 @@ public class NetworkPolicyManagerServiceTest {
        assertFalse(mService.isUidNetworkingBlocked(UID_B, false));
    }

    @Ignore("Temporarily disabled until the feature is enabled")
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_NETWORK_BLOCKED_FOR_TOP_SLEEPING_AND_ABOVE)
    public void testBackgroundChainOnTempAllowlistChange() throws Exception {
@@ -2246,6 +2248,7 @@ public class NetworkPolicyManagerServiceTest {
        assertTrue(mService.isUidNetworkingBlocked(UID_A, false));
    }

    @Ignore("Temporarily disabled until the feature is enabled")
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_NETWORK_BLOCKED_FOR_TOP_SLEEPING_AND_ABOVE)
    public void testUidObserverFiltersProcStateChanges() throws Exception {
@@ -2308,6 +2311,7 @@ public class NetworkPolicyManagerServiceTest {
        waitForUidEventHandlerIdle();
    }

    @Ignore("Temporarily disabled until the feature is enabled")
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_NETWORK_BLOCKED_FOR_TOP_SLEEPING_AND_ABOVE)
    public void testUidObserverFiltersStaleChanges() throws Exception {
@@ -2328,6 +2332,7 @@ public class NetworkPolicyManagerServiceTest {
        waitForUidEventHandlerIdle();
    }

    @Ignore("Temporarily disabled until the feature is enabled")
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_NETWORK_BLOCKED_FOR_TOP_SLEEPING_AND_ABOVE)
    public void testUidObserverFiltersCapabilityChanges() throws Exception {