Add new vold call to get the path to an asec fs.
Change-Id: Ife15628ed6e2493c9e85a2ade6d59a194fdddde5
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 88ac07c..c1406a9 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -203,6 +203,20 @@
return 0;
}
+int VolumeManager::getAsecFilesystemPath(const char *id, char *buffer, int maxlen) {
+ char asecFileName[255];
+ snprintf(asecFileName, sizeof(asecFileName), "%s/%s.asec", Volume::SEC_ASECDIR, id);
+
+ memset(buffer, 0, maxlen);
+ if (access(asecFileName, F_OK)) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ snprintf(buffer, maxlen, "%s", asecFileName);
+ return 0;
+}
+
int VolumeManager::createAsec(const char *id, unsigned int numSectors,
const char *fstype, const char *key, int ownerUid) {
struct asec_superblock sb;