Volumes know parent disks; unsupported disks.
This is cleaner and more direct than the reverse of having the disk
publish child volume membership. Rename state constants to match
public API. Add state representing bad removal. Make it clear that
volume flags are related to mounting.
Send new unsupported disk event when we finish scanning an entire
disk and have no meaningful volumes.
Bug: 19993667
Change-Id: I08a91452ff561171a484d1da5745293ec893aec0
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index dcadd14..bbafa42 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -59,8 +59,6 @@
#include "VoldUtil.h"
#include "cryptfs.h"
-#define DEBUG_NETLINK 0
-
#define MASS_STORAGE_FILE_PATH "/sys/class/android_usb/android0/f_mass_storage/lun/file"
#define ROUND_UP_POWER_OF_2(number, po2) (((!!(number & ((1U << po2) - 1))) << po2)\
@@ -248,8 +246,9 @@
return buffer;
}
-void VolumeManager::setDebug(bool enable) {
+int VolumeManager::setDebug(bool enable) {
mDebug = enable;
+ return 0;
}
int VolumeManager::start() {
@@ -273,10 +272,11 @@
}
void VolumeManager::handleBlockEvent(NetlinkEvent *evt) {
-#if DEBUG_NETLINK
- LOG(VERBOSE) << "handleBlockEvent with action " << (int) evt->getAction();
- evt->dump();
-#endif
+ if (mDebug) {
+ LOG(VERBOSE) << "----------------";
+ LOG(VERBOSE) << "handleBlockEvent with action " << (int) evt->getAction();
+ evt->dump();
+ }
std::string eventPath(evt->findParam("DEVPATH"));
std::string devType(evt->findParam("DEVTYPE"));