Merge "Fix NetworkCapabilities MTS on S, CTS on S+module"
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
|
* Test networks have strong restrictions on what capabilities they can have. Enforce these
|
||||||
* restrictions.
|
* restrictions.
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ import android.util.Range;
|
|||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.testutils.CompatUtil;
|
import com.android.testutils.CompatUtil;
|
||||||
|
import com.android.testutils.ConnectivityModuleTest;
|
||||||
import com.android.testutils.DevSdkIgnoreRule;
|
import com.android.testutils.DevSdkIgnoreRule;
|
||||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
|
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
|
||||||
|
|
||||||
@@ -1168,7 +1169,7 @@ public class NetworkCapabilitiesTest {
|
|||||||
assertEquals(0, nc.getCapabilities().length);
|
assertEquals(0, nc.getCapabilities().length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test @IgnoreUpTo(Build.VERSION_CODES.R)
|
@Test @IgnoreUpTo(Build.VERSION_CODES.R) @ConnectivityModuleTest
|
||||||
public void testRestrictCapabilitiesForTestNetwork() {
|
public void testRestrictCapabilitiesForTestNetwork() {
|
||||||
final int ownerUid = 1234;
|
final int ownerUid = 1234;
|
||||||
final int[] administratorUids = {1001, ownerUid};
|
final int[] administratorUids = {1001, ownerUid};
|
||||||
|
|||||||
Reference in New Issue
Block a user