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

Commit 7a910576 authored by Cody Kesting's avatar Cody Kesting Committed by Automerger Merge Worker
Browse files

Merge "Make DataConnection VCN managed by default." am: 3d4707af am: 93b946a4 am: b2d86fc1

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1598054

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If1dddf2f6e08ccb786f3a23fbfc0e3674c2e25f4
parents a59057a5 b2d86fc1
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1808,10 +1808,13 @@ public class DataConnection extends StateMachine {

        builder.setAdministratorUids(mAdministratorUids);

        // Check for VCN-specified Network policy before returning NetworkCapabilities
        if (!isVcnManaged(builder.build())) {
        // Always start with NOT_VCN_MANAGED, then remove if VcnManager indicates this is part of a
        // VCN.
        builder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED);
        if (isVcnManaged(builder.build())) {
            builder.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED);
        }

        return builder.build();
    }

+7 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import static com.android.internal.telephony.dataconnection.DcTrackerTest.FAKE_P
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.atLeastOnce;
@@ -387,7 +388,12 @@ public class DataConnectionTest extends TelephonyTest {
        verify(mSimulatedCommandsVerifier, times(1))
                .registerForLceInfo(any(Handler.class),
                        eq(DataConnection.EVENT_LINK_CAPACITY_CHANGED), eq(null));
        verify(mVcnManager, atLeastOnce()).getUnderlyingNetworkPolicy(any(), any());
        verify(mVcnManager, atLeastOnce())
                .getUnderlyingNetworkPolicy(
                        argThat(caps ->
                                caps.hasCapability(
                                        NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED)),
                        any());

        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(