summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recovery.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/recovery.cpp b/recovery.cpp
index e36e7d9..59e35c1 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1413,9 +1413,10 @@ main(int argc, char **argv) {
#ifdef HAVE_OEMLOCK
if (oem_lock == OEM_LOCK_UNLOCK) {
- if (device->WipeData()) status = INSTALL_ERROR;
+ device->PreWipeData();
if (erase_volume("/data", true)) status = INSTALL_ERROR;
- if (wipe_cache && erase_volume("/cache", true)) status = INSTALL_ERROR;
+ if (should_wipe_cache && erase_volume("/cache", true)) status = INSTALL_ERROR;
+ device->PostWipeData();
if (status != INSTALL_SUCCESS) ui->Print("Data wipe failed.\n");
if (oemlock_set(0)) status = INSTALL_ERROR;
// Force reboot regardless of actual status