Fix NetworkCapabilities MTS on S, CTS on S+module

restrictCapabilitiesForTestNetwork was renamed after S release to be
included in a mainline release, but this causes the MTS test to fail on
S if the Connectivity module is not updated, and CTS to fail if the
connectivity module is updated.

Mark the test as @ConnectivityModuleTest so it can be skipped on
non-connectivity module MTS tests (such as NetworkStack tests), and add
back the previous method name to keep CTS passing.

Bug: 196755836
Test: atest NetworkCapabilitiesTest
Change-Id: Ibd6c2e62e5949ec6d93e9f6e4fc05129c29b94f8
This commit is contained in:
Remi NGUYEN VAN
2021-08-16 18:03:37 +09:00
parent 932df54493
commit 5b8e2e9935
2 changed files with 15 additions and 1 deletions

View File

@@ -813,6 +813,19 @@ public final class NetworkCapabilities implements Parcelable {
}
}
/**
* @see #restrictCapabilitiesForTestNetwork(int)
* @deprecated Use {@link #restrictCapabilitiesForTestNetwork(int)} (without the typo) instead.
* @hide
*/
@Deprecated
public void restrictCapabilitesForTestNetwork(int creatorUid) {
// Do not remove without careful consideration: this method has a typo in its name but is
// called by the first S CTS releases, therefore it cannot be removed from the connectivity
// module as long as such CTS releases are valid for testing S devices.
restrictCapabilitiesForTestNetwork(creatorUid);
}
/**
* Test networks have strong restrictions on what capabilities they can have. Enforce these
* restrictions.