# Copyright 2023 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Functionalities to reliably reboot the device."""
import enum
from typing import Optional
class BootMode(enum.Enum): """Specifies boot mode for device."""
REGULAR = enum.auto()
RECOVERY = enum.auto()
BOOTLOADER = enum.auto()
class StateTransitionError(Exception): """Raised when target does not transition to desired state."""
Args:
target_id: Optional target_id of device.
mode: Desired boot mode.
must_boot: Forces device to boot, regardless of current state.
Raises:
StateTransitionError: When final state of device isnot desired. """ # Avoid cycle dependency. # This file will be replaced with serial_boot_device quite soon, later one # should be much more reliable comparing to ffx target list and ssh. So # changing the file structure is not necessary in the current situation. # pylint: disable=cyclic-import, import-outside-toplevel # pylint: disable=wrong-import-position import serial_boot_device ifnot serial_boot_device.boot_device(target_id, serial_num, mode,
must_boot): raise StateTransitionError(
f'Could not get device to desired state {mode}.')
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.