---
title: "SpatialExternalSurfaceProtection"
description: "Specifies if the Surface should be backed by android.hardware.HardwareBuffers with the USAGE_PROTECTED_CONTENT flag set."
type: "class"
lastmod: "2026-05-08T01:17:01.387449Z"
---
## API Reference

> Source set: Android

```kotlin
public value class SpatialExternalSurfaceProtection
private constructor(internal val value: SurfaceEntity.SurfaceProtection)
```

Specifies if the Surface should be backed by `android.hardware.HardwareBuffer`s with the
USAGE_PROTECTED_CONTENT flag set. These buffers support hardware paths for decoding protected
content.

## Companion Object

#### Properties

> Source set: Android

```kotlin
public val None: SpatialExternalSurfaceProtection
```

The Surface content is not protected. Non-protected content can be decoded into this
surface. Protected content can not be decoded into this Surface. Screen captures of the
[SpatialExternalSurface](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialExternalSurface) will show the Surface content.

> Source set: Android

```kotlin
public val Protected: SpatialExternalSurfaceProtection
```

The Surface content is protected. Non-protected content can be decoded into this surface.
Protected content can be decoded into this Surface. Screen captures of the
[SpatialExternalSurface](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SpatialExternalSurface) will redact the Surface content.
