Home | History | Annotate | Download | only in vold

Lines Matching refs:Volume

45 #include "Volume.h"
59 const char *Volume::MEDIA_DIR = "/mnt/media_rw";
64 const char *Volume::FUSE_DIR = "/storage";
69 const char *Volume::SEC_ASECDIR_EXT = "/mnt/secure/asec";
74 const char *Volume::SEC_ASECDIR_INT = "/data/app-asec";
79 const char *Volume::ASECDIR = "/mnt/asec";
84 const char *Volume::LOOPDIR = "/mnt/obb";
86 const char *Volume::BLKID_PATH = "/system/bin/blkid";
89 if (state == Volume::State_Init)
91 else if (state == Volume::State_NoMedia)
93 else if (state == Volume::State_Idle)
95 else if (state == Volume::State_Pending)
97 else if (state == Volume::State_Mounted)
99 else if (state == Volume::State_Unmounting)
101 else if (state == Volume::State_Checking)
103 else if (state == Volume::State_Formatting)
105 else if (state == Volume::State_Shared)
107 else if (state == Volume::State_SharedMnt)
113 Volume::Volume(VolumeManager *vm, const fstab_rec* rec, int flags) {
119 mState = Volume::State_Init;
126 Volume::~Volume() {
132 void Volume::setDebug(bool enable) {
136 dev_t Volume::getDiskDevice() {
140 dev_t Volume::getShareDevice() {
144 void Volume::handleVolumeShared() {
147 void Volume::handleVolumeUnshared() {
150 int Volume::handleBlockEvent(NetlinkEvent * /*evt*/) {
155 void Volume::setUuid(const char* uuid) {
175 void Volume::setUserLabel(const char* userLabel) {
195 void Volume::setState(int state) {
204 if ((oldState == Volume::State_Pending) && (state != Volume::State_Idle)) {
210 SLOGD("Volume %s state changing %d (%s) -> %d (%s)", mLabel,
213 "Volume %s %s state changed from %d (%s) to %d (%s)", getLabel(),
221 int Volume::createDeviceNode(const char *path, int major, int minor) {
232 int Volume::formatVol(bool wipe) {
234 if (getState() == Volume::State_NoMedia) {
237 } else if (getState() != Volume::State_Idle) {
243 SLOGW("Volume is idle but appears to be mounted - fixing");
244 setState(Volume::State_Mounted);
257 setState(Volume::State_Formatting);
275 SLOGI("Formatting volume %s (%s)", getLabel(), devicePath);
286 setState(Volume::State_Idle);
290 bool Volume::isMountpointMounted(const char *path) {
315 int Volume::mountVol() {
335 if ((getState() == Volume::State_NoMedia) ||
338 "Volume %s %s mount failed - no media",
345 } else if (getState() != Volume::State_Idle) {
347 if (getState() == Volume::State_Pending) {
354 SLOGW("Volume is idle but appears to be mounted - fixing");
355 setState(Volume::State_Mounted);
366 /* If we're running encrypted, and the volume is marked as encryptable and nonremovable,
368 * that partition, and update the volume object to point to it's new decrypted
421 SLOGI("%s being considered for volume %s\n", devicePath, getLabel());
424 setState(Volume::State_Checking);
434 setState(Volume::State_Idle);
452 setState(Volume::State_Idle);
460 setState(Volume::State_Mounted);
465 SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());
466 setState(Volume::State_Idle);
471 int Volume::mountAsecExternal() {
499 int Volume::doUnmount(const char *path, bool force) {
533 int Volume::unmountVol(bool force, bool revert) {
539 if (getState() != Volume::State_Mounted) {
540 SLOGE("Volume %s unmount request when not mounted", getLabel());
545 setState(Volume::State_Unmounting);
556 if (providesAsec && doUnmount(Volume::SEC_ASECDIR_EXT, force) != 0) {
575 /* If this is an encrypted volume, and we've been asked to undo
582 SLOGI("Encrypted volume %s reverted successfully", getMountpoint());
587 setState(Volume::State_Idle);
598 setState(Volume::State_Mounted);
602 setState(Volume::State_NoMedia);
606 int Volume::initializeMbr(const char *deviceNode) {
651 int Volume::extractMetadata(const char* devicePath) {