Lines Matching defs:Volume

43 #include "Volume.h"
57 const char *Volume::MEDIA_DIR = "/mnt/media_rw";
62 const char *Volume::FUSE_DIR = "/storage";
67 const char *Volume::SEC_ASECDIR_EXT = "/mnt/secure/asec";
72 const char *Volume::SEC_ASECDIR_INT = "/data/app-asec";
76 const char *Volume::ASECDIR = "/mnt/asec";
81 const char *Volume::LOOPDIR = "/mnt/obb";
84 if (state == Volume::State_Init)
86 else if (state == Volume::State_NoMedia)
88 else if (state == Volume::State_Idle)
90 else if (state == Volume::State_Pending)
92 else if (state == Volume::State_Mounted)
94 else if (state == Volume::State_Unmounting)
96 else if (state == Volume::State_Checking)
98 else if (state == Volume::State_Formatting)
100 else if (state == Volume::State_Shared)
102 else if (state == Volume::State_SharedMnt)
108 Volume::Volume(VolumeManager *vm, const fstab_rec* rec, int flags) {
112 mState = Volume::State_Init;
119 Volume::~Volume() {
123 void Volume::protectFromAutorunStupidity() {
128 SLOGW("Volume contains an autorun.inf! - removing");
142 void Volume::setDebug(bool enable) {
146 dev_t Volume::getDiskDevice() {
150 dev_t Volume::getShareDevice() {
154 void Volume::handleVolumeShared() {
157 void Volume::handleVolumeUnshared() {
160 int Volume::handleBlockEvent(NetlinkEvent *evt) {
165 void Volume::setState(int state) {
174 if ((oldState == Volume::State_Pending) && (state != Volume::State_Idle)) {
180 SLOGD("Volume %s state changing %d (%s) -> %d (%s)", mLabel,
183 "Volume %s %s state changed from %d (%s) to %d (%s)", getLabel(),
191 int Volume::createDeviceNode(const char *path, int major, int minor) {
202 int Volume::formatVol(bool wipe) {
204 if (getState() == Volume::State_NoMedia) {
207 } else if (getState() != Volume::State_Idle) {
213 SLOGW("Volume is idle but appears to be mounted - fixing");
214 setState(Volume::State_Mounted);
225 setState(Volume::State_Formatting);
254 setState(Volume::State_Idle);
258 bool Volume::isMountpointMounted(const char *path) {
284 int Volume::mountVol() {
304 if ((getState() == Volume::State_NoMedia) ||
307 "Volume %s %s mount failed - no media",
314 } else if (getState() != Volume::State_Idle) {
316 if (getState() == Volume::State_Pending) {
323 SLOGW("Volume is idle but appears to be mounted - fixing");
324 setState(Volume::State_Mounted);
393 setState(Volume::State_Checking);
403 setState(Volume::State_Idle);
421 setState(Volume::State_Idle);
429 setState(Volume::State_Mounted);
434 SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());
435 setState(Volume::State_Idle);
440 int Volume::mountAsecExternal() {
467 int Volume::doUnmount(const char *path, bool force) {
501 int Volume::unmountVol(bool force, bool revert) {
507 if (getState() != Volume::State_Mounted) {
508 SLOGE("Volume %s unmount request when not mounted", getLabel());
513 setState(Volume::State_Unmounting);
524 if (providesAsec && doUnmount(Volume::SEC_ASECDIR_EXT, force) != 0) {
553 setState(Volume::State_Idle);
564 setState(Volume::State_Mounted);
568 setState(Volume::State_NoMedia);
572 int Volume::initializeMbr(const char *deviceNode) {