<div class='sourceset sourceset-android'>Android</div>

```kotlin
public class AnchorPolicy(
    public val isEnabled: Boolean = true,
    @Suppress("PrimitiveInCollection")
    public val anchorPlaneOrientations: Set<PlaneOrientation> = emptySet(),
    @Suppress("PrimitiveInCollection")
    public val anchorPlaneSemantics: Set<PlaneSemantic> = emptySet(),
) : DragPolicy()
```

Represents the anchoring behavior of a spatial object.

An AnchorPolicy object can be placed and re-anchored on detected surfaces in the environment.
This class defines properties that control how anchoring behaves, such as whether it's enabled
and what types of planes it can anchor to.

This functionality requires the
[android.permission.SCENE_UNDERSTANDING_COARSE]`androidx.xr.runtime.manifest.SCENE_UNDERSTANDING_COARSE`
permission. If this permission is not granted, anchoring will be disabled and the element will
behave as if this policy was not applied.