class ShutdownWatcherRegister
Defined at line 4388 of file fidling/gen/sdk/fidl/fuchsia.hardware.power.statecontrol/fuchsia.hardware.power.statecontrol/hlcpp/fuchsia/hardware/power/statecontrol/cpp/fidl.h
Allows components to register a callback that will be executed when reboots or shutdowns occur.
The main purpose of this protocol is to be able to track shutdown reasons and provide signals
to critical platform components that cannot rely on Component Framework's orderly shutdown.
Before relying on this protocol, consider using Component Framework's orderly shutdown
pattern or component lifecycle hooks.
Public Members
static const char[] Name_
Public Methods
void ~ShutdownWatcherRegister ()
void RegisterWatcher (::fidl::InterfaceHandle< ::fuchsia::hardware::power::statecontrol::ShutdownWatcher> watcher, RegisterWatcherCallback callback)
Registers a watcher to be notified when the `Admin.Shutdown` method is called.
Once the watcher has been successfully registered with the server, then
the request will be completed and the ShutdownWatcherRegister
channel will be left open (though a client is free to close it at this
time).
If there is an error in registering the watcher, then the
ShutdownWatcherRegister channel will be closed without completing
the request.
The provided `watcher` channel will be used at most once to notify the
watcher of an impending shutdown and allow it the chance to respond.
Watchers can unregister by closing their `ShutdownWatcher` channel.
void RegisterTerminalStateWatcher (::fidl::InterfaceHandle< ::fuchsia::hardware::power::statecontrol::TerminalStateWatcher> watcher, RegisterTerminalStateWatcherCallback callback)
Registers a watcher to be notified when the system begins a transition to a terminal state
regardless of the trigger.
The [`TerminalStateWatcher`] is notified for all reboots, power-offs, and kernel-initiated
shutdowns. It does not provide reasons or options.
Once the watcher has been successfully registered with the server, then
the request will be completed and the ShutdownWatcherRegister
channel will be left open (though a client is free to close it at this
time).
If there is an error in registering the watcher, then the
ShutdownWatcherRegister channel will be closed without completing
the request.
The provided `watcher` channel will be used at most once to notify the
watcher of an impending shutdown and allow it the chance to respond.
Watchers can unregister by closing their `TerminalStateWatcher` channel.
Protected Methods
void handle_unknown_method (uint64_t ordinal, bool method_has_response)
Friends
class ShutdownWatcherRegister_Stub