Skip to content

Commit

Permalink
Change the adb reboot bootlodaer function
Browse files Browse the repository at this point in the history
  • Loading branch information
tsterbak committed Feb 8, 2023
1 parent 8919ceb commit 3cdd7af
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions openandroidinstaller/tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def run_command(
for line in p.stdout:
if enable_logging:
logger.info(line.strip())
yield line
yield line.strip()

yield p.returncode == 0

Expand All @@ -82,13 +82,10 @@ def adb_reboot_bootloader(bin_path: Path) -> bool:
"""Reboot the device into bootloader and return success."""
logger.info("Rebooting device into bootloader with adb.")
for line in run_command("adb", ["reboot", "bootloader"], bin_path):
if (type(line) == bool) and not line:
logger.error("Reboot into bootloader failed.")
yield line
if (type(line) == bool) and not line:
logger.error("Reboot into bootloader failed.")
yield False
return
sleep(1)
yield True


def adb_reboot_download(bin_path: Path) -> bool:
Expand Down

0 comments on commit 3cdd7af

Please sign in to comment.