Wider volume mutation lock, move force adoptable.

We eventually should move back to per-disk locks, but use a giant
lock to keep development rolling forward.  Also move force adoptable
flag to framework since, since encrypted devices don't have persisted
properties loaded early during boot.

Bug: 19993667
Change-Id: Ifa3016ef41b038f8f71fc30bc81596cfd21dcd2a
diff --git a/VolumeManager.h b/VolumeManager.h
index 44920e0..e0b0ac8 100644
--- a/VolumeManager.h
+++ b/VolumeManager.h
@@ -23,8 +23,9 @@
 
 #ifdef __cplusplus
 
-#include <string>
 #include <list>
+#include <mutex>
+#include <string>
 
 #include <cutils/multiuser.h>
 #include <utils/List.h>
@@ -82,6 +83,9 @@
 public:
     virtual ~VolumeManager();
 
+    // TODO: pipe all requests through VM to avoid exposing this lock
+    std::mutex& getLock() { return mLock; }
+
     int start();
     int stop();
 
@@ -186,6 +190,8 @@
 
     int linkPrimary(userid_t userId);
 
+    std::mutex mLock;
+
     std::list<std::shared_ptr<DiskSource>> mDiskSources;
     std::list<std::shared_ptr<android::vold::Disk>> mDisks;