# WindowSdkExtensions

# WindowSdkExtensions

Artifact:[androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window)  
[View Source](https://cs.android.com/search?q=file:androidx/window/WindowSdkExtensions.kt+class:androidx.window.WindowSdkExtensions)  
Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/window#1.2.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/window/WindowSdkExtensions "View this page in Java")

<br />

```
abstract class WindowSdkExtensions
```

<br />

*** ** * ** ***

This class provides information about the extension SDK versions for window features present on this device. Use[extensionVersion](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#extensionVersion())to get the version of the extension. The extension version advances as the platform evolves and new APIs are added, so is suitable to use for determining API availability at runtime.

Window Manager Jetpack APIs that require window SDK extensions support are denoted with[RequiresWindowSdkExtension](https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension). The caller must check whether the device's extension version is greater than or equal to the minimum level reported in[RequiresWindowSdkExtension](https://developer.android.com/reference/kotlin/androidx/window/RequiresWindowSdkExtension).  

```kotlin
import androidx.window.WindowSdkExtensions
import androidx.window.embedding.SplitAttributes
import androidx.window.embedding.SplitController
import androidx.window.samples.embedding.context

// For example, SplitController#setSplitAttributesCalculator requires extension version 2.
// Callers must check the current extension version before invoking the API, or exception will
// be thrown.
if (WindowSdkExtensions.getInstance().extensionVersion >= 2) {
    SplitController.getInstance(context).setSplitAttributesCalculator(splitAttributesCalculator)
}
```

## Summary

|                                      ### Public companion functions                                       |
|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WindowSdkExtensions](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions) | [getInstance](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#getInstance())`()` Returns a[WindowSdkExtensions](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions)instance. |

|                               ### Public properties                                |
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [extensionVersion](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions#extensionVersion()) Reports the device's extension version |

## Public companion functions

### getInstance

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/window#1.2.0)  

```
fun getInstance(): WindowSdkExtensions
```

Returns a[WindowSdkExtensions](https://developer.android.com/reference/kotlin/androidx/window/WindowSdkExtensions)instance.  

## Public properties

### extensionVersion

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/window#1.2.0)  

```
open val extensionVersion: Int
```

Reports the device's extension version

When Window SDK Extensions is not present on the device, the extension version will be 0.