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:
Junyu Lai
2021-06-25 15:54:20 +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)));