SdkSuppress


@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.TYPE, ElementType.METHOD])
annotation SdkSuppress


Indicates that a specific test or class should or should not be run on certain API levels.

Test(s) will be skipped when executed on android platforms less/more than specified level (inclusive) or executed on an android platform whose SDK level is in the excludedSdks list.

If @SdkSuppress is applied at both the class and test method, the test method annotation takes precedence, and the class level @SdkSuppress is ignored.

Summary

Public functions

abstract String!

The android.os.Build.VERSION.CODENAME to execute on.

abstract IntArray<Int>!

The list of SDK versions to exclude

abstract Int

The maximum API level to execute (inclusive)

abstract Int

The minimum API level to execute (inclusive)

Public functions

codeName

abstract fun codeName(): String!

The android.os.Build.VERSION.CODENAME to execute on. This is intended to be used to run on a pre-release SDK, where the android.os.Build.VERSION.SDK_INT has not yet been finalized. This is treated as an OR operation with respect to the minSdkVersion and maxSdkVersion attributes.

For example, to filter a test so it runs on only the prerelease R SDK: @SdkSuppress(minSdkVersion = Build.VERSION_CODES.R, codeName = "R")

excludedSdks

abstract fun excludedSdks(): IntArray<Int>!

The list of SDK versions to exclude

maxSdkVersion

abstract fun maxSdkVersion(): Int

The maximum API level to execute (inclusive)

minSdkVersion

abstract fun minSdkVersion(): Int

The minimum API level to execute (inclusive)