<br />

Added: 7

## **PROTOCOLS**

## Listener

*Defined in [fuchsia.ui.activity/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/provider.fidl;l=25)*

The Listener protocol subscribes to changes in the system's activity
state. Clients which care about the activity state of the system are
expected to implement this protocol and subscribe via Provider.WatchState.

<br />

### OnStateChanged

Callback that is invoked whenever the system state changes.
The Listener is expected to acknowledge each call explicitly and will
not receive new state until this acknowledgement is done.
Deprecated: 9

#### Request

| Name | Type |
|---|---|
| `state` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.activity#State` |
| `transition_time` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Time` |

#### Response

\<EMPTY\>

## Provider

*Defined in [fuchsia.ui.activity/provider.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/provider.fidl;l=11)*

The Provider protocol offers a subscription interface through
which clients can watch for changes in the system's activity state.

<br />

### WatchState

Subscribe to changes in the system's state.
The server will always invoke listener.OnStateChanged at least once with
the initial state, and after that invoke listener.OnStateChanged
whenever the system's state changes.
Deprecated: 9

#### Request

| Name | Type |
|---|---|
| `listener` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.ui.activity#Listener` |

## **ENUMS**

### State [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.ui.activity/state.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/state.fidl;l=8)*

State is an enumeration of the activity states the system may be in.

<br />

| Name | Value | Description |
|---|---|---|
| ### UNKNOWN | `0` |   |
| ### IDLE | `1` | IDLE implies that the system is not currently being used by a user. In other words, the system is not ACTIVE. |
| ### ACTIVE | `2` | ACTIVE implies that a user has recently or is currently using the system. Activity can be signalled by discrete interactions (cursor, keyboard, touchscreen), or by ongoing activities (video playback). The specific meaning of "recently" is an implementation detail of the Activity Service, but a typical value is 15 minutes. |

## **TABLES**

### GenericActivity

*Defined in [fuchsia.ui.activity/activity.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/activity.fidl;l=20)*

GenericActivity is a user or system activity of unspecified type, e.g.
a keyboard press or an alarm going off.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `label` | `string` | Brief human-readable label for the activity, for logging/debugging. e.g. "cursor", "key", "video" |

## **UNIONS**

### DiscreteActivity [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.ui.activity/activity.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/activity.fidl;l=7)*

DiscreteActivity is an activity which occurs at a point in time.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `generic` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.activity#GenericActivity` | Activities that require no special handling. |

<br />

### OngoingActivity [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.ui.activity/activity.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/activity.fidl;l=13)*

OngoingActivity is an activity which has a definite start and end time.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `generic` | `https://fuchsia.dev/reference/fidl/fuchsia.ui.activity#GenericActivity` | Activities that require no special handling. |

<br />

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [OngoingActivityId](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.activity/tracker.fidl;l=8) | `uint32` |   |