Merge "DO NOT MERGE Ignore DUN in describeImmutableDifferences" into oc-mr1-dev
am: b2f4b2e05d
Change-Id: I0236132b8b497af5b1c26aa44e6494fe0510cb6d
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user