template <>

class Server

Defined at line 766 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/natural_messaging.h

Public Methods

void GetPowerElements (GetPowerElementsCompleter::Sync & completer)

Gets the power elements owned by the activity governor.

If an error occurs while the server is registering a power element with

the power broker or an error occurs while creating a token for a power

element, then the channel to `ActivityGovernor` will be closed by the

server and no response will be returned.

void Server ()

Defined at line 769 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/natural_messaging.h

void TakeWakeLease (TakeWakeLeaseRequest & request, TakeWakeLeaseCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

The hardware platform will not suspend as long as a valid

[`LeaseToken`] exists.

If an error occurs while creating a token for the wake lease, then the

channel to `ActivityGovernor` will be closed by the server and no

response will be returned.

void AcquireWakeLease (AcquireWakeLeaseRequest & request, AcquireWakeLeaseCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

The hardware platform will not suspend as long as a valid

[`LeaseToken`] exists.

void AcquireWakeLeaseWithToken (AcquireWakeLeaseWithTokenRequest & request, AcquireWakeLeaseWithTokenCompleter::Sync & completer)

Creates a lease that blocks suspension of the hardware platform.

WARNING: Suspension can only be considered blocked after the client

receives the response to this call. This means, for example, an

interrupt should only be ack'ed or a different wake lease dropped only

**after** getting an error-free response.

The hardware platform will remain resumed until `server_token` observes

`PEER_CLOSED`, indicating all handles to the client side of the

`LeaseToken` are closed.

void TakeApplicationActivityLease (TakeApplicationActivityLeaseRequest & request, TakeApplicationActivityLeaseCompleter::Sync & completer)

Creates a lease that blocks the system from dropping below the Application

Activity 'Active' state. In particular, this blocks suspension of the

hardware platform.

This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.

If an error occurs while creating a token for the activity lease, then the

channel to `ActivityGovernor` will be closed by the server and no

response will be returned.

void RegisterSuspendBlocker (RegisterSuspendBlockerRequest & request, RegisterSuspendBlockerCompleter::Sync & completer)

Registers a suspend blocker.

On successful registration, a wake lease token is returned. This token

prevents hardware platform suspension while it exists. Clients are

expected to perform any initialization of the given `suspend_blocker`

server while holding this token. Additionally, this means the first call

`suspend_blocker` will get is `BeforeSuspend`.

To unregister, close the `SuspendBlocker` channel.

If any required field of the table is missing, the error

[`RegisterSuspendBlockerError.INVALID_ARGS`] is returned.

If an error occurs while registering `suspend_blocker`, it will be

dropped, closing the channel.

Handler bind_handler (async_dispatcher_t * dispatcher)

|bind_handler| returns a handler that binds incoming connections to this

server implementation.

The returned handler borrows the server instance.

The server must outlive the provided |dispatcher|. Only after

the dispatcher is shutdown will it be safe to destroy the servers.

The server should not be moved.

void ~Server ()

Defined at line 770 of file fidling/gen/sdk/fidl/fuchsia.power.system/fuchsia.power.system/cpp/fidl/fuchsia.power.system/cpp/natural_messaging.h