Add the ability to revert a crypto mapping when unmounting a volume
Add the force_and_revert option to the unmount command which will force
the unmount, and revert a crypto mapping. This is used during factory
reset so that when the internal sdcard volume is formatted, it formats
the raw device, not the encrypted mapping.
Change-Id: I36b6ff9bb54863b121de635472a303bf4a2334a9
diff --git a/Volume.h b/Volume.h
index f57ff91..274fb54 100644
--- a/Volume.h
+++ b/Volume.h
@@ -52,6 +52,7 @@
VolumeManager *mVm;
bool mDebug;
int mPartIdx;
+ int mOrigPartIdx;
bool mRetryMount;
/*
@@ -64,7 +65,7 @@
virtual ~Volume();
int mountVol();
- int unmountVol(bool force);
+ int unmountVol(bool force, bool revert);
int formatVol();
const char *getLabel() { return mLabel; }
@@ -85,6 +86,7 @@
virtual int getDeviceNodes(dev_t *devs, int max) = 0;
virtual int updateDeviceInfo(char *new_path, int new_major, int new_minor) = 0;
+ virtual void revertDeviceInfo(void) = 0;
virtual int isDecrypted(void) = 0;
virtual int getFlags(void) = 0;