diff --git a/tests/cts/hostside/Android.bp b/tests/cts/hostside/Android.bp index 0f87dc2bfe..3050d9a15e 100644 --- a/tests/cts/hostside/Android.bp +++ b/tests/cts/hostside/Android.bp @@ -27,6 +27,16 @@ java_defaults { name: "CtsHostsideNetworkTestsAllAppDefaults", platform_apis: true, min_sdk_version: "30", + // Set target SDK to 10000 so that all the test helper apps are always subject to the most + // recent (and possibly most restrictive) target SDK behaviour. Also, this matches the target + // SDK of the tests themselves, and of other tests such as CtsNetTestCases. + // Note that some of the test helper apps (e.g., CtsHostsideNetworkCapTestsAppSdk33) override + // this with older SDK versions. + // Also note that unlike android_test targets, "current" does not work: the target SDK is set to + // something like "VanillaIceCream" instead of 100000. This means that the tests will not run on + // released devices with errors such as "Requires development platform VanillaIceCream but this + // is a release platform". + target_sdk_version: "10000", } java_test_host {