Skip to content

Commit cdb5683

Browse files
committed
Run the retry in the correct function...
1 parent a4aa74d commit cdb5683

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

openandroidinstaller/tooling.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,11 @@ def adb_twrp_copy_partitions(bin_path: Path, config_path: Path) -> TerminalRespo
177177

178178
@add_logging("Perform a factory reset with adb and twrp.", return_if_fail=True)
179179
def adb_twrp_format_data(bin_path: Path) -> TerminalResponse:
180-
"""Perform a factory reset with twrp and adb."""
181-
for line in run_command("adb shell twrp format data", bin_path):
182-
yield line
183-
184-
185-
@add_logging("Wipe the selected partition with adb and twrp.", return_if_fail=True)
186-
def adb_twrp_wipe_partition(bin_path: Path, partition: str) -> TerminalResponse:
187180
"""Perform a factory reset with twrp and adb.
188181
189182
If `format data` fails (for example because of old TWRP versions) we fall back to `wipe data`.
190183
"""
191-
for line in run_command(f"adb shell twrp wipe {partition}", bin_path):
184+
for line in run_command("adb shell twrp format data", bin_path):
192185
yield line
193186
if (type(line) == bool) and not line:
194187
logger.info(
@@ -199,6 +192,13 @@ def adb_twrp_wipe_partition(bin_path: Path, partition: str) -> TerminalResponse:
199192
yield line
200193

201194

195+
@add_logging("Wipe the selected partition with adb and twrp.", return_if_fail=True)
196+
def adb_twrp_wipe_partition(bin_path: Path, partition: str) -> TerminalResponse:
197+
"""Perform a factory reset with twrp and adb."""
198+
for line in run_command(f"adb shell twrp wipe {partition}", bin_path):
199+
yield line
200+
201+
202202
def adb_twrp_wipe_and_install(
203203
bin_path: Path,
204204
target: str,

0 commit comments

Comments
 (0)