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/DirectVolume.h b/DirectVolume.h
index ad1b386..de1ed8b 100644
--- a/DirectVolume.h
+++ b/DirectVolume.h
@@ -33,6 +33,9 @@
int mDiskMajor;
int mDiskMinor;
int mPartMinors[MAX_PARTITIONS];
+ int mOrigDiskMajor;
+ int mOrigDiskMinor;
+ int mOrigPartMinors[MAX_PARTITIONS];
int mDiskNumParts;
unsigned char mPendingPartMap;
int mIsDecrypted;
@@ -55,6 +58,7 @@
protected:
int getDeviceNodes(dev_t *devs, int max);
int updateDeviceInfo(char *new_path, int new_major, int new_minor);
+ virtual void revertDeviceInfo(void);
int isDecrypted() { return mIsDecrypted; }
int getFlags() { return mFlags; }