aboutsummaryrefslogtreecommitdiffstats
path: root/device.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-06-05 17:59:56 -0700
committerElliott Hughes <enh@google.com>2015-06-10 14:11:08 -0700
commit0005f89c31dfc2ca9053512900571620a0eba842 (patch)
treee0749788a43dc1411d34a5d1cb788a23a9b0054d /device.h
parent6abd52f62be24981398a99ebefc8717eb2294f97 (diff)
downloadbootable_recovery-0005f89c31dfc2ca9053512900571620a0eba842.zip
bootable_recovery-0005f89c31dfc2ca9053512900571620a0eba842.tar.gz
bootable_recovery-0005f89c31dfc2ca9053512900571620a0eba842.tar.bz2
Split WipeData into PreWipeData and PostWipeData.
Bug: http://b/21760064 Change-Id: Idde268fe4d7e27586ca4469de16783f1ffdc5069 (cherry picked from commit 945548ef7b3eee5dbfb46f6291465d4b0b6d02e1)
Diffstat (limited to 'device.h')
-rw-r--r--device.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/device.h b/device.h
index dad8ccd..f74b6b0 100644
--- a/device.h
+++ b/device.h
@@ -91,13 +91,16 @@ class Device {
static const int kHighlightDown = -3;
static const int kInvokeItem = -4;
- // Called when we do a wipe data/factory reset operation (either via a
- // reboot from the main system with the --wipe_data flag, or when the
- // user boots into recovery manually and selects the option from the
- // menu.) Can perform whatever device-specific wiping actions are
- // needed. Return 0 on success. The userdata and cache partitions
- // are erased AFTER this returns (whether it returns success or not).
- virtual int WipeData() { return 0; }
+ // Called before and after we do a wipe data/factory reset operation,
+ // either via a reboot from the main system with the --wipe_data flag,
+ // or when the user boots into recovery image manually and selects the
+ // option from the menu, to perform whatever device-specific wiping
+ // actions are needed.
+ // Return true on success; returning false from PreWipeData will prevent
+ // the regular wipe, and returning false from PostWipeData will cause
+ // the wipe to be considered a failure.
+ virtual bool PreWipeData() { return true; }
+ virtual bool PostWipeData() { return true; }
private:
RecoveryUI* ui_;