| // Copyright 2025 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @available(added=27) |
| library fuchsia.power; |
| |
| /// An initiator of collaborative device reboots. |
| /// |
| /// Collaborative reboot is a mechanism that allows multiple actors to work |
| /// together to schedule a device reboot at a time that avoids user disruption. |
| /// Actors fulfill one of two roles: Scheduler or Initiator. The scheduler |
| /// registers the desire to reboot the device at a later point in time, while |
| /// the initiator identifies appropriate times to perform a reboot and actuates |
| /// any scheduled requests. This protocol fulfills the initiator role. |
| /// |
| /// Collaborative reboot can be used when the platform is configured to let the |
| /// product drive reboot scheduling. |
| /// |
| /// As a concrete example, this mechanism can be used to drive software updates. |
| /// When the platform identifies that there is an outstanding software update to |
| /// apply, it can download the update, and schedule a collaborative reboot. |
| /// Later, when the product identifies that it is an appropriate time for the |
| /// device to reboot (say, after it's observed a sufficient period of user |
| /// inactivity), it can initate the collaborative reboot. |
| @available(added=27) |
| @discoverable(server="platform") |
| closed protocol CollaborativeRebootInitiator { |
| /// Initiates a collaborative reboot. |
| /// |
| /// Initiates a device reboot if there is one or more pending reboot |
| /// requests from a collaborative reboot scheduler. |
| /// |
| /// Response: |
| /// - rebooting: True if there was a pending reboot request and the device |
| /// will immediately reboot. False if there were no pending |
| /// reboot requests and the device will not reboot. |
| strict PerformPendingReboot() -> (table { |
| 1: rebooting bool; |
| }); |
| }; |