fuchsia.ui.activity

PROTOCOLS

Control

Defined in fuchsia.ui.activity/control.fidl

The Control protocol can be used to override the activity state of the Activity Service.

State provided through this interface takes precedence over state which is determined based on activity sent through the Tracker API.

Once a state has been assigned through this protocol, the Activity Service will no longer determine state based on input to the Tracker protocol, and instead will only report state transitions occuring through the Control protocol.

SetState

Sets the Activity Service's state to |state|. All listeners registered through the Provider protocol will immediately be notified of the new state.

Request

NameType
state State

Provider

Defined in fuchsia.ui.activity/provider.fidl

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

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.

Request

NameType
listener Listener

Listener

Defined in fuchsia.ui.activity/provider.fidl

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.

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.

Request

NameType
state State
transition_time zx/time

Response

NameType

Tracker

Defined in fuchsia.ui.activity/tracker.fidl

The Tracker protocol collects evidence of user activity and uses this evidence to set the system's activity state.

ReportDiscreteActivity

Reports a discrete activity such as a keystroke. |event_time| is in nanoseconds in the CLOCK_MONOTONIC time base.

Request

NameType
activity DiscreteActivity
event_time zx/time

StartOngoingActivity

Reports the start of an ongoing activity such as media playback. Returns a unique |activity_id| which is expected to be later passed to EndOngoingActivity. |start_time| is in nanoseconds in the CLOCK_MONOTONIC time base.

Request

NameType
activity OngoingActivity
start_time zx/time

Response

NameType
activity_id OngoingActivityId

EndOngoingActivity

Reports the end of an ongoing activity such as media playback. |activity_id| is the nonce which was returned by StartOngoingActivity. |end_time| is in nanoseconds in the CLOCK_MONOTONIC time base.

Request

NameType
activity_id OngoingActivityId
end_time zx/time

ENUMS

LidState

Type: uint32

Defined in fuchsia.ui.activity/activity.fidl

LidState is an enumeration of states that a clamshell-like device's lid may be in.

NameValueDescription
UNKNOWN 0
OPEN 1
CLOSED 2
FLIPPED 3

State

Type: uint32

Defined in fuchsia.ui.activity/state.fidl

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

NameValueDescription
UNKNOWN 0
IDLE 1
ACTIVE 2

TABLES

GenericActivity

Defined in fuchsia.ui.activity/activity.fidl

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

OrdinalNameTypeDescription
1 label string

Brief human-readable label for the activity, for logging/debugging. e.g. "cursor", "key", "video"

LidActivity

Defined in fuchsia.ui.activity/activity.fidl

LidActivity is an event originating from a change in the state of the lid of a clamshell-like device.

OrdinalNameTypeDescription
1 state LidState

XUNIONS

DiscreteActivity

Defined in fuchsia.ui.activity/activity.fidl

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

NameTypeDescription
generic GenericActivity

Activities that require no special handling.

lid LidActivity

An activity originating from opening or closing the lid of a clamshell-format device.

OngoingActivity

Defined in fuchsia.ui.activity/activity.fidl

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

NameTypeDescription
generic GenericActivity

Activities that require no special handling.

TYPE ALIASES

NameValueDescription
OngoingActivityId uint32