Merge "Fix NetworkCapabilities MTS on S, CTS on S+module" am: 7262180c07 am: 6180b47f92
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1796369 Change-Id: Id02a4659d9e27a6fffc075cdaac878c94a436f42
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -75,6 +75,7 @@ import android.util.Range;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.testutils.CompatUtil;
|
||||
import com.android.testutils.ConnectivityModuleTest;
|
||||
import com.android.testutils.DevSdkIgnoreRule;
|
||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
|
||||
|
||||
@@ -1168,7 +1169,7 @@ public class NetworkCapabilitiesTest {
|
||||
assertEquals(0, nc.getCapabilities().length);
|
||||
}
|
||||
|
||||
@Test @IgnoreUpTo(Build.VERSION_CODES.R)
|
||||
@Test @IgnoreUpTo(Build.VERSION_CODES.R) @ConnectivityModuleTest
|
||||
public void testRestrictCapabilitiesForTestNetwork() {
|
||||
final int ownerUid = 1234;
|
||||
final int[] administratorUids = {1001, ownerUid};
|
||||
|
||||
Reference in New Issue
Block a user