APIs for power aspects of the session.
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.
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
Name | Type |
---|---|
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
Name | Type |
---|---|
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.
Take
Take the lease.
Request
<EMPTY>
Response
Name | Type |
---|---|
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 BlockingListener
s affects
the suspend and resume processes, as the ListenerRegistry
MUST
wait for the BlockingListener
s to respond.
Note, however, that the ListenerRegistry
MAY apply a timeout
to the responses.
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
Name | Type |
---|---|
listener |
client_end:BlockingListener
|
Response
Name | Type |
---|---|
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
Field | Type | Description | Default |
---|---|---|---|
lease |
handle<handle>
|
A lease on the power element. This is secretly a 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.
Name | Value | Description |
---|---|---|
ALREADY_TAKEN |
1 |
The lease is already taken. |
UNAVAILABLE |
2 |
The lease is not available due to errors or configuration. |
UNIONS
BlockingListener_OnResumeStarted_Result strict
Defined in fuchsia.session.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
BlockingListener_OnResumeStarted_Response
|
|
3 |
framework_err |
internal
|
BlockingListener_OnSuspendFailed_Result strict
Defined in fuchsia.session.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
BlockingListener_OnSuspendFailed_Response
|
|
3 |
framework_err |
internal
|
Handoff_Take_Result strict resource
Defined in fuchsia.session.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
Handoff_Take_Response
|
|
2 |
err |
HandoffError
|
|
3 |
framework_err |
internal
|
ListenerRegistry_RegisterBlockingListener_Result strict
Defined in fuchsia.session.power/power.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
ListenerRegistry_RegisterBlockingListener_Response
|
|
3 |
framework_err |
internal
|