Skip to content

Commit 3cdd7af

Browse files
committed
Change the adb reboot bootlodaer function
1 parent 8919ceb commit 3cdd7af

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

openandroidinstaller/tooling.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def run_command(
6161
for line in p.stdout:
6262
if enable_logging:
6363
logger.info(line.strip())
64-
yield line
64+
yield line.strip()
6565

6666
yield p.returncode == 0
6767

@@ -82,13 +82,10 @@ def adb_reboot_bootloader(bin_path: Path) -> bool:
8282
"""Reboot the device into bootloader and return success."""
8383
logger.info("Rebooting device into bootloader with adb.")
8484
for line in run_command("adb", ["reboot", "bootloader"], bin_path):
85+
if (type(line) == bool) and not line:
86+
logger.error("Reboot into bootloader failed.")
8587
yield line
86-
if (type(line) == bool) and not line:
87-
logger.error("Reboot into bootloader failed.")
88-
yield False
89-
return
9088
sleep(1)
91-
yield True
9289

9390

9491
def adb_reboot_download(bin_path: Path) -> bool:

0 commit comments

Comments
 (0)