summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2021-03-11 08:51:21 +0100
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-11 08:51:21 +0100
commitbeba08bf6827d6db3a1c3209ffd5d65d413fa853 (patch)
treeda0e30a831235c6dad1d6f390e865efb8a168f0b
parent[automerger skipped] Merge "Merge RQ2A.210305.007" am: a952c55faf -s ours am: fc8f576c00 -s ours am: 16da08890d -s ours am: 23870fcad0 -s ours (diff)
parentMerge "Bring up the erase animation early for data wipe" am: 8082b71f45 am: b845427da8 am: 4a3144a6ae (diff)
downloadandroid_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar.gz
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar.bz2
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar.lz
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar.xz
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.tar.zst
android_bootable_recovery-beba08bf6827d6db3a1c3209ffd5d65d413fa853.zip
-rw-r--r--install/wipe_data.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/install/wipe_data.cpp b/install/wipe_data.cpp
index 287208583..4eecf72c6 100644
--- a/install/wipe_data.cpp
+++ b/install/wipe_data.cpp
@@ -41,9 +41,6 @@ static bool EraseVolume(const char* volume, RecoveryUI* ui, bool convert_fbe) {
bool is_cache = (strcmp(volume, CACHE_ROOT) == 0);
bool is_data = (strcmp(volume, DATA_ROOT) == 0);
- ui->SetBackground(RecoveryUI::ERASING);
- ui->SetProgressType(RecoveryUI::INDETERMINATE);
-
std::vector<saved_log_file> log_files;
if (is_cache) {
// If we're reformatting /cache, we load any past logs (i.e. "/cache/recovery/last_*") and the
@@ -97,6 +94,9 @@ bool WipeCache(RecoveryUI* ui, const std::function<bool()>& confirm_func) {
}
ui->Print("\n-- Wiping cache...\n");
+ ui->SetBackground(RecoveryUI::ERASING);
+ ui->SetProgressType(RecoveryUI::INDETERMINATE);
+
bool success = EraseVolume("/cache", ui, false);
ui->Print("Cache wipe %s.\n", success ? "complete" : "failed");
return success;
@@ -105,6 +105,8 @@ bool WipeCache(RecoveryUI* ui, const std::function<bool()>& confirm_func) {
bool WipeData(Device* device, bool convert_fbe) {
RecoveryUI* ui = device->GetUI();
ui->Print("\n-- Wiping data...\n");
+ ui->SetBackground(RecoveryUI::ERASING);
+ ui->SetProgressType(RecoveryUI::INDETERMINATE);
if (!FinishPendingSnapshotMerges(device)) {
ui->Print("Unable to check update status or complete merge, cannot wipe partitions.\n");