summaryrefslogtreecommitdiffstats
path: root/recovery.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-19 00:07:14 +0200
committerDoug Zongker <dougz@android.com>2009-06-19 00:07:14 +0200
commitb128f54d0daa749d301b99a6637f42aa35822a76 (patch)
tree889519250f40824c6df6ea197a8edee75cf95e10 /recovery.c
parentam 47cace98: add file_getprop() to updater (diff)
downloadandroid_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar.gz
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar.bz2
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar.lz
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar.xz
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.tar.zst
android_bootable_recovery-b128f54d0daa749d301b99a6637f42aa35822a76.zip
Diffstat (limited to 'recovery.c')
-rw-r--r--recovery.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/recovery.c b/recovery.c
index 8ad133948..499fda574 100644
--- a/recovery.c
+++ b/recovery.c
@@ -354,6 +354,7 @@ prompt_and_wait()
case ITEM_WIPE_DATA:
ui_print("\n-- Wiping data...\n");
+ device_wipe_data();
erase_root("DATA:");
erase_root("CACHE:");
ui_print("Data wipe complete.\n");
@@ -463,10 +464,14 @@ main(int argc, char **argv)
if (update_package != NULL) {
status = install_package(update_package);
if (status != INSTALL_SUCCESS) ui_print("Installation aborted.\n");
- } else if (wipe_data || wipe_cache) {
- if (wipe_data && erase_root("DATA:")) status = INSTALL_ERROR;
+ } else if (wipe_data) {
+ if (device_wipe_data()) status = INSTALL_ERROR;
+ if (erase_root("DATA:")) status = INSTALL_ERROR;
if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR;
if (status != INSTALL_SUCCESS) ui_print("Data wipe failed.\n");
+ } else if (wipe_cache) {
+ if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR;
+ if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed.\n");
} else {
status = INSTALL_ERROR; // No command specified
}