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

Commit 124b3e77 authored by Hugo Benichi's avatar Hugo Benichi Committed by android-build-merger
Browse files

Merge "DO NOT MERGE Ignore DUN in describeImmutableDifferences" into oc-mr1-dev

am: 9d5f50a9

Change-Id: I0236132b8b497af5b1c26aa44e6494fe0510cb6d
parents 6833a8dd 9d5f50a9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -772,7 +772,9 @@ public final class NetworkCapabilities implements Parcelable {

        // Ignore NOT_METERED being added or removed as it is effectively dynamic. http://b/63326103
        // TODO: properly support NOT_METERED as a mutable and requestable capability.
        final long mask = ~MUTABLE_CAPABILITIES & ~(1 << NET_CAPABILITY_NOT_METERED);
        // Ignore DUN being added or removed. http://b/65257223.
        final long mask = ~MUTABLE_CAPABILITIES
                & ~(1 << NET_CAPABILITY_NOT_METERED) & ~(1 << NET_CAPABILITY_DUN);
        long oldImmutableCapabilities = this.mNetworkCapabilities & mask;
        long newImmutableCapabilities = that.mNetworkCapabilities & mask;
        if (oldImmutableCapabilities != newImmutableCapabilities) {
+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.net;

import static android.net.NetworkCapabilities.NET_CAPABILITY_CBS;
import static android.net.NetworkCapabilities.NET_CAPABILITY_DUN;
import static android.net.NetworkCapabilities.NET_CAPABILITY_EIMS;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_METERED;
@@ -143,6 +144,14 @@ public class NetworkCapabilitiesTest {
        assertEquals("", nc1.describeImmutableDifferences(nc2));
        assertEquals("", nc1.describeImmutableDifferences(nc1));

        // DUN changing (http://b/65257223)
        nc1 = new NetworkCapabilities()
                .addCapability(NET_CAPABILITY_DUN)
                .addCapability(NET_CAPABILITY_INTERNET);
        nc2 = new NetworkCapabilities().addCapability(NET_CAPABILITY_INTERNET);
        assertEquals("", nc1.describeImmutableDifferences(nc2));
        assertEquals("", nc1.describeImmutableDifferences(nc1));

        // Immutable capability changing
        nc1 = new NetworkCapabilities()
                .addCapability(NET_CAPABILITY_INTERNET)