Lines Matching refs: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 = "/mnt/secure/asec";
79 const char *Volume::ASECDIR = "/mnt/asec";
84 const char *Volume::LOOPDIR = "/mnt/obb";
87 if (state == Volume::State_Init)
89 else if (state == Volume::State_NoMedia)
91 else if (state == Volume::State_Idle)
93 else if (state == Volume::State_Pending)
95 else if (state == Volume::State_Mounted)
97 else if (state == Volume::State_Unmounting)
99 else if (state == Volume::State_Checking)
101 else if (state == Volume::State_Formatting)
103 else if (state == Volume::State_Shared)
105 else if (state == Volume::State_SharedMnt)
111 Volume::Volume(VolumeManager *vm, const char *label, const char *mount_point) {
116 mState = Volume::State_Init;
122 Volume::~Volume() {
127 void Volume::protectFromAutorunStupidity() {
132 SLOGW("Volume contains an autorun.inf! - removing");
146 void Volume::setDebug(bool enable) {
150 dev_t Volume::getDiskDevice() {
154 dev_t Volume::getShareDevice() {
158 void Volume::handleVolumeShared() {
161 void Volume::handleVolumeUnshared() {
164 int Volume::handleBlockEvent(NetlinkEvent *evt) {
169 void Volume::setState(int state) {
178 if ((oldState == Volume::State_Pending) && (state != Volume::State_Idle)) {
184 SLOGD("Volume %s state changing %d (%s) -> %d (%s)", mLabel,
187 "Volume %s %s state changed from %d (%s) to %d (%s)", getLabel(),
195 int Volume::createDeviceNode(const char *path, int major, int minor) {
206 int Volume::formatVol() {
208 if (getState() == Volume::State_NoMedia) {
211 } else if (getState() != Volume::State_Idle) {
217 SLOGW("Volume is idle but appears to be mounted - fixing");
218 setState(Volume::State_Mounted);
229 setState(Volume::State_Formatting);
258 setState(Volume::State_Idle);
262 bool Volume::isMountpointMounted(const char *path) {
288 int Volume::mountVol() {
305 if ((getState() == Volume::State_NoMedia) ||
308 "Volume %s %s mount failed - no media",
315 } else if (getState() != Volume::State_Idle) {
317 if (getState() == Volume::State_Pending) {
324 SLOGW("Volume is idle but appears to be mounted - fixing");
325 setState(Volume::State_Mounted);
395 setState(Volume::State_Checking);
405 setState(Volume::State_Idle);
438 setState(Volume::State_Idle);
449 setState(Volume::State_Idle);
452 setState(Volume::State_Mounted);
457 SLOGE("Volume %s found no suitable devices for mounting :(\n", getLabel());
458 setState(Volume::State_Idle);
463 int Volume::createBindMounts() {
526 int Volume::doMoveMount(const char *src, const char *dst, bool force) {
560 int Volume::doUnmount(const char *path, bool force) {
594 int Volume::unmountVol(bool force, bool revert) {
597 if (getState() != Volume::State_Mounted) {
598 SLOGE("Volume %s unmount request when not mounted", getLabel());
603 setState(Volume::State_Unmounting);
612 setState(Volume::State_Mounted);
623 if (doUnmount(Volume::SEC_STG_SECIMGDIR, force)) {
633 if (doUnmount(Volume::SEC_ASECDIR, force)) {
641 if (doUnmount(Volume::SEC_STGDIR, force)) {
658 setState(Volume::State_Idle);
681 setState(Volume::State_Mounted);
685 setState(Volume::State_NoMedia);
688 int Volume::initializeMbr(const char *deviceNode) {