Check null NetworkSpecifier before redacting am: 4ad09c4a74
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15121422 Change-Id: I9092bfd9eedf04b68fc5f6d8091dcff733d943b7
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user