# A2uiActionInterceptor

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/processor/A2uiActionInterceptor.kt+class:androidx.a2ui.model.processor.A2uiActionInterceptor) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
public fun interface A2uiActionInterceptor
```

<br />

*** ** * ** ***

Intercepts, transforms, or drops `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiUserAction`s before they are processed by the core layer.

This acts as a middleware pipeline. Multiple interceptors can be registered. The output of one interceptor is passed as the input to the next in the chain. The order of registration dictates the order of execution. It can process both local function actions and server event actions.

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiUserAction` | `https://developer.android.com/reference/androidx/a2ui/model/processor/A2uiActionInterceptor#onInterceptAction(androidx.a2ui.model.protocol.A2uiUserAction)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiUserAction action)` Called before a user action is handled by the core layer. |

## Public methods

### onInterceptAction

```
abstract A2uiUserAction onInterceptAction(@NonNull A2uiUserAction action)
```

Called before a user action is handled by the core layer.

Note: This method blocks the processing pipeline for the surface. Implementations should be lightweight.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiUserAction action` | the incoming user action details. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/a2ui/model/protocol/A2uiUserAction` | The original action, a transformed/modified action to pass to the next interceptor, or `null` to consume the action entirely and stop further processing. |