Lines Matching defs:Volume

43 #include "Volume.h"
57 const char *Volume::SECDIR = "/mnt/secure";
62 const char *Volume::SEC_STGDIR = "/mnt/secure/staging";
69 const char *Volume::SEC_STG_SECIMGDIR = "/mnt/secure/staging/.android_secure";
74 const char *Volume::SEC_ASECDIR_EXT = "/mnt/secure/asec";
79 const char *Volume::SEC_ASECDIR_INT = "/data/app-asec";
83 const char *Volume::ASECDIR = "/mnt/asec";
88 const char *Volume::LOOPDIR = "/mnt/obb";
91 if (state == Volume::State_Init)
93 else if (state == Volume::State_NoMedia)
95 else if (state == Volume::State_Idle)
97 else if (state == Volume::State_Pending)
99 else if (state == Volume::State_Mounted)
101 else if (state == Volume::State_Unmounting)
103 else if (state == Volume::State_Checking)
105 else if (state == Volume::State_Formatting)
107 else if (state == Volume::State_Shared)
109 else if (state == Volume::State_SharedMnt)
115 Volume::Volume(VolumeManager *vm, const char *label, const char *mount_point) {
120 mState = Volume::State_Init;
126 Volume::~Volume() {
131 void Volume::protectFromAutorunStupidity() {
136 SLOGW("Volume contains an autorun.inf! - removing");
150 void Volume::setDebug(bool enable) {
154 dev_t Volume::getDiskDevice() {
158 dev_t Volume::getShareDevice() {
162 void Volume::handleVolumeShared() {
165 void Volume::handleVolumeUnshared() {
168 int Volume::handleBlockEvent(NetlinkEvent *evt) {
173 void Volume::setState(int state) {
182 if ((oldState == Volume::State_Pending) && (state != Volume::State_Idle)) {
188 SLOGD("Volume %s state changing %d (%s) -> %d (%s)", mLabel,
191 "Volume %s %s state changed from %d (%s) to %d (%s)", getLabel(),
199 int Volume::createDeviceNode(const char *path, int major, int minor) {
210 int Volume::formatVol() {
212 if (getState() == Volume::State_NoMedia) {
215 } else if (getState() != Volume::State_Idle) {
221 SLOGW("Volume is idle but appears to be mounted - fixing");
222 setState(Volume::State_Mounted);
233 setState(Volume::State_Formatting);
262 setState(Volume::State_Idle);
266 bool Volume::isMountpointMounted(const char *path) {
292 int Volume::mountVol() {
309 if ((getState() == Volume::State_NoMedia) ||
312 "Volume %s %s mount failed - no media",
319 } else if (getState() != Volume::State_Idle) {
321 if (getState() == Volume::State_Pending) {
328 SLOGW("Volume is idle but appears to be mounted - fixing");
329 setState(Volume::State_Mounted);
399 setState(Volume::State_Checking);
409 setState(Volume::State_Idle);
442 setState(Volume::State_Idle);
453 setState(Volume::State_Idle);
456 setState(Volume::State_Mounted);
461 SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());
462 setState(Volume::State_Idle);
467 int Volume::createBindMounts() {
530 int Volume::doMoveMount(const char *src, const char *dst, bool force) {
564 int Volume::doUnmount(const char *path, bool force) {
598 int Volume::unmountVol(bool force, bool revert) {
601 if (getState() != Volume::State_Mounted) {
602 SLOGE("Volume %s unmount request when not mounted", getLabel());
607 setState(Volume::State_Unmounting);
614 if (doUnmount(Volume::SEC_ASECDIR_EXT, force)) {
650 setState(Volume::State_Idle);
673 setState(Volume::State_Mounted);
677 setState(Volume::State_NoMedia);
680 int Volume::initializeMbr(const char *deviceNode) {