fuchsia.session.power

APIs for power aspects of the session.

Added: HEAD

PROTOCOLS

BlockingListener

Defined in fuchsia.session.power/power.fidl

Interface implemented by components which elect to receive power-state callbacks from a Session, and have the Session block related power operations until the component replies.

Closing the server endpoint of BlockingListener will remove the blocking listener from the registry and unblock related power operations.

Added: HEAD

OnResumeStarted

Called by the ListenerRegistry to inform the component that the system has started resuming.

The callee SHOULD minimize the time it (the callee) takes to reply, since other power operations may block until the callee replies.

The caller SHOULD interpret an UNKNOWN_METHOD response as an indication that the callee has no work that would block the resume process.

Request

<EMPTY>

Response

NameType
payload BlockingListener_OnResumeStarted_Result

OnSuspendFailed

Called by the ListenerRegistry to inform the component that a suspend attempt failed.

The callee SHOULD minimize the time it (callee) takes to reply, since later suspends may block until the callee replies.

The caller SHOULD interpret an UNKNOWN_METHOD response as an indication that the callee has no work that would block future power-state changes.

Request

<EMPTY>

Response

NameType
payload BlockingListener_OnSuspendFailed_Result

Handoff

Defined in fuchsia.session.power/power.fidl

Lets the session manager handoff a power lease to a session component.

As an example, session_manager may take a lease on the ApplicationActivity power element, and offer Handoff to the session component. The session component can then take the lease from session_manager when it is started. This way a constant dependency is maintained on ApplicationActivity as the session is restarted.

Added: HEAD

Take

Take the lease.

Request

<EMPTY>

Response

NameType
payload Handoff_Take_Result

ListenerRegistry

Defined in fuchsia.session.power/power.fidl

Allows components to request callbacks on power-state changes.

The timing of acknowledgements from BlockingListeners affects the suspend and resume processes, as the ListenerRegistry MUST wait for the BlockingListeners to respond.

Note, however, that the ListenerRegistry MAY apply a timeout to the responses.

Added: HEAD

RegisterBlockingListener

Registers listener with the registry.

When the ListenerRegistry learns of power state changes, the ListenerRegistry will forward the event to the listener.

See documentation of the BlockingListener methods for details on which events are available, and the semantics of each callback.

The ListenerRegistry MUST continue to forward events to the listener, even after the ListenerRegistry connection is closed.

Replaces any existing listener that was previously registered.

Request

NameType
listener client_end:BlockingListener

Response

NameType
payload ListenerRegistry_RegisterBlockingListener_Result

STRUCTS

BlockingListener_OnResumeStarted_Response

Defined in fuchsia.session.power/power.fidl

<EMPTY>

BlockingListener_OnSuspendFailed_Response

Defined in fuchsia.session.power/power.fidl

<EMPTY>

Handoff_Take_Response resource

Defined in fuchsia.session.power/power.fidl

FieldTypeDescriptionDefault
lease handle<handle>

A lease on the power element.

This is secretly a fuchsia.power.broker.LeaseControl channel but we'd like to avoid exposing that to ffx. When that protocol is stabilized, we can replace the channel with that here.

TODO(https://fxbug.dev/339474151): This may also become an eventpair as the linked bug tracks migrating lease control channel to eventpair.

No default

ListenerRegistry_RegisterBlockingListener_Response

Defined in fuchsia.session.power/power.fidl

<EMPTY>

ENUMS

HandoffError flexible

Type: uint32

Defined in fuchsia.session.power/power.fidl

Error when taking the power lease.

Added: HEAD

NameValueDescription
1

The lease is already taken.

2

The lease is not available due to errors or configuration.

UNIONS

BlockingListener_OnResumeStarted_Result strict

Defined in fuchsia.session.power/power.fidl

OrdinalVariantTypeDescription
response BlockingListener_OnResumeStarted_Response
framework_err internal

BlockingListener_OnSuspendFailed_Result strict

Defined in fuchsia.session.power/power.fidl

OrdinalVariantTypeDescription
response BlockingListener_OnSuspendFailed_Response
framework_err internal

Handoff_Take_Result strict resource

Defined in fuchsia.session.power/power.fidl

OrdinalVariantTypeDescription
response Handoff_Take_Response
err HandoffError
framework_err internal

ListenerRegistry_RegisterBlockingListener_Result strict

Defined in fuchsia.session.power/power.fidl

OrdinalVariantTypeDescription
response ListenerRegistry_RegisterBlockingListener_Response
framework_err internal