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

Commit 3d4707af authored by Cody Kesting's avatar Cody Kesting Committed by Gerrit Code Review
Browse files

Merge "Make DataConnection VCN managed by default."

parents a849c283 cbe06935
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1753,10 +1753,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(