Merge "Check null NetworkSpecifier before redacting" am: 435c4f7fc5 am: 9c5e87388d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1747893 Change-Id: I7e317ebb77d921c50e21a6a710e388e453cdfe62
This commit is contained in:
@@ -537,8 +537,10 @@ public class ConnectivityManagerTest {
|
|||||||
Objects.requireNonNull(mCm.getNetworkCapabilities(network));
|
Objects.requireNonNull(mCm.getNetworkCapabilities(network));
|
||||||
// Redact specifier of the capabilities of the snapshot before comparing since
|
// Redact specifier of the capabilities of the snapshot before comparing since
|
||||||
// the result returned from getNetworkCapabilities always get redacted.
|
// the result returned from getNetworkCapabilities always get redacted.
|
||||||
|
final NetworkSpecifier snapshotCapSpecifier =
|
||||||
|
snapshot.getNetworkCapabilities().getNetworkSpecifier();
|
||||||
final NetworkSpecifier redactedSnapshotCapSpecifier =
|
final NetworkSpecifier redactedSnapshotCapSpecifier =
|
||||||
snapshot.getNetworkCapabilities().getNetworkSpecifier().redact();
|
snapshotCapSpecifier == null ? null : snapshotCapSpecifier.redact();
|
||||||
assertEquals("", caps.describeImmutableDifferences(
|
assertEquals("", caps.describeImmutableDifferences(
|
||||||
snapshot.getNetworkCapabilities()
|
snapshot.getNetworkCapabilities()
|
||||||
.setNetworkSpecifier(redactedSnapshotCapSpecifier)));
|
.setNetworkSpecifier(redactedSnapshotCapSpecifier)));
|
||||||
|
|||||||
Reference in New Issue
Block a user