Merge "Check null NetworkSpecifier before redacting" am: 435c4f7fc5 am: 9c5e87388d am: 6efa057bf5

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1747893

Change-Id: I5ebb779b147125295d355ca6d3654a13202175f5
This commit is contained in:
Junyu Lai
2021-06-25 16:10:58 +00:00
committed by Automerger Merge Worker

View File

@@ -537,8 +537,10 @@ public class ConnectivityManagerTest {
Objects.requireNonNull(mCm.getNetworkCapabilities(network));
// Redact specifier of the capabilities of the snapshot before comparing since
// the result returned from getNetworkCapabilities always get redacted.
final NetworkSpecifier snapshotCapSpecifier =
snapshot.getNetworkCapabilities().getNetworkSpecifier();
final NetworkSpecifier redactedSnapshotCapSpecifier =
snapshot.getNetworkCapabilities().getNetworkSpecifier().redact();
snapshotCapSpecifier == null ? null : snapshotCapSpecifier.redact();
assertEquals("", caps.describeImmutableDifferences(
snapshot.getNetworkCapabilities()
.setNetworkSpecifier(redactedSnapshotCapSpecifier)));