# SdkSuppress

Artifact: [androidx.test:runner](https://developer.android.com/jetpack/androidx/releases/test) [View Source](https://cs.android.com/search?q=file:androidx/test/filters/SdkSuppress.java+class:androidx.test.filters.SdkSuppress)

*** ** * ** ***


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

<br />

*** ** * ** ***

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

Test(s) will be skipped when executed on Android platforms with SDK API level:

- less than specified minSdkVersion OR
- greater than specified maxSdkVersion OR
- 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 methods |
|---|---|
| `abstract https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/filters/SdkSuppress#codeName()()` The android.os.Build.VERSION.CODENAME to execute on. |
| `abstract int[]` | `https://developer.android.com/reference/androidx/test/filters/SdkSuppress#excludedSdks()()` The (additional) list of SDK versions to exclude |
| `abstract int` | `https://developer.android.com/reference/androidx/test/filters/SdkSuppress#maxSdkVersion()()` The maximum API level to execute (inclusive) |
| `abstract int` | `https://developer.android.com/reference/androidx/test/filters/SdkSuppress#minSdkVersion()()` The minimum API level to execute (inclusive) |

## Public methods

### codeName

```
public abstract String codeName()
```

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

```
public abstract int[] excludedSdks()
```

The (additional) list of SDK versions to exclude

### maxSdkVersion

```
public abstract int maxSdkVersion()
```

The maximum API level to execute (inclusive)

### minSdkVersion

```
public abstract int minSdkVersion()
```

The minimum API level to execute (inclusive)