| // Copyright 2020 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. |
| library fuchsia.feedback; |
| using zx; |
| |
| /// Get information about why a device last shutdown. The term reboot is used instead of shutdown |
| /// since many developers phrase their questions about shutdowns in terms of reboots and most |
| /// components are interested in knowing why the system just rebooted. |
| [Discoverable] |
| protocol LastRebootInfoProvider { |
| Get() -> (LastReboot last_reboot); |
| }; |
| |
| /// Information about why a device last rebooted. |
| table LastReboot { |
| /// Whether the last reboot was graceful, i.e. the device didn't reboot in response to an error |
| /// and rebooted in a controlled manner. |
| /// |
| /// This field allows clients to know whether the last reboot was graceful without having to |
| /// parse the optional |reason| field. This is useful when |reason| is not set, i.e. because |
| /// the system doesn't know more than the fact that the reboot was graceful, or when the API |
| /// evolves to support new RebootReason values and the clients hasn't been updated yet. |
| /// |
| /// This field is always has a value if |reason| is provided. However, |reason| might not |
| /// always have a value this field is provided. |
| 1: bool graceful; |
| |
| /// Why a device last rebooted. |
| 2: RebootReason reason; |
| |
| /// The uptime of the device before it rebooted. |
| 3: zx.duration uptime; |
| }; |
| |
| /// Reasons why a device last rebooted. |
| enum RebootReason : uint16 { |
| // /////////////////////////////////////////////////////////////////////////////////////////// |
| // Ungraceful reboot reasons |
| // |graceful| has a value of false in LastReboot above. |
| |
| /// The device booted from a cold state. |
| /// |
| /// This is most likely the result of an extended period of time without power or a device |
| /// booting with Fuchsia for the first time. |
| COLD = 2; |
| |
| /// The device rebooted due to a brief loss of power. |
| /// |
| /// On some hardware this could be the result of a user disconnecting, then reconnecting their |
| /// device's power supply in rapid succession. |
| BRIEF_POWER_LOSS = 3; |
| |
| /// The device rebooted because its voltage dipped below an allowable level without going to 0. |
| BROWNOUT = 4; |
| |
| KERNEL_PANIC = 5; |
| SYSTEM_OUT_OF_MEMORY = 6; |
| HARDWARE_WATCHDOG_TIMEOUT = 7; |
| SOFTWARE_WATCHDOG_TIMEOUT = 8; |
| |
| // /////////////////////////////////////////////////////////////////////////////////////////// |
| // Graceful reboot reasons |
| // |graceful| has a value of true in LastReboot above. |
| |
| /// The device rebooted because a user of the device initiated the reboot. A user can be a |
| /// human or a program that interacts with the device on behalf of a human, such as SL4F or RCS. |
| USER_REQUEST = 9; |
| |
| /// The device rebooted because of an OTA. |
| SYSTEM_UPDATE = 10; |
| |
| /// The device rebooted because applying the OTA failed and we want to retry. |
| RETRY_SYSTEM_UPDATE = 17; |
| |
| /// The device rebooted because it was determined to be too hot. |
| HIGH_TEMPERATURE = 11; |
| |
| /// The device rebooted because of an issue with a session or because the session manager was |
| /// unable to recover from an error. |
| SESSION_FAILURE = 12; |
| |
| /// The device rebooted because the system manager (sysmgr) was unable to recover from an |
| /// error. |
| SYSMGR_FAILURE = 15; |
| |
| /// The device rebooted following a data reset to factory defaults. |
| /// See [`fuchsia.recovery.FactoryReset`]. |
| FACTORY_DATA_RESET = 14; |
| |
| /// The device rebooted because a critical component managed by sysmgr has failed. |
| // //src/sys/sysmgr/sysmgr-configuration.md defines what a critical component is. |
| CRITICAL_COMPONENT_FAILURE = 16; |
| }; |