Progress towards dynamic storage support.

Wire up new Disk and VolumeBase objects and events to start replacing
older DirectVolume code.  Use filesystem UUID as visible PublicVolume
name to be more deterministic.

When starting, create DiskSource instances based on fstab, and watch
for kernel devices to appear.  Turn matching devices into Disk
objects, scan for partitions, and create any relevant VolumeBase
objects.  Broadcast all of these events towards userspace so the
framework can decide what to mount.

Keep track of the primary VolumeBase, and update the new per-user
/storage/self/primary symlink for all started users.

Provide a reset command that framework uses to start from a known
state when runtime is restarted.  When vold is unexpectedly killed,
try recovering by unmounting everything under /mnt and /storage
before moving forward.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Switch killProcessesWithOpenFiles() to directly take signal.  Fix
one SOCK_CLOEXEC bug, but SELinux says there are more lurking.

Bug: 19993667
Change-Id: I2dad1303aa4667ec14c52f774e2a28b3c1c1ff6d
diff --git a/PublicVolume.h b/PublicVolume.h
index 3da0995..2d2ec6b 100644
--- a/PublicVolume.h
+++ b/PublicVolume.h
@@ -42,25 +42,14 @@
     explicit PublicVolume(dev_t device);
     virtual ~PublicVolume();
 
+protected:
+    status_t doMount() override;
+    status_t doUnmount() override;
+    status_t doFormat() override;
+
     status_t readMetadata();
     status_t initAsecStage();
 
-    void setPrimary(bool primary);
-    bool getPrimary() { return mPrimary; }
-
-    const std::string& getFsUuid() { return mFsUuid; }
-    const std::string& getFsLabel() { return mFsLabel; }
-
-    status_t bindUser(userid_t user);
-    status_t unbindUser(userid_t user);
-
-protected:
-    status_t doMount();
-    status_t doUnmount();
-    status_t doFormat();
-
-    status_t bindUserInternal(userid_t user, bool bind);
-
 private:
     /* Kernel device representing partition */
     dev_t mDevice;
@@ -72,12 +61,12 @@
     std::string mFusePath;
     /* PID of FUSE wrapper */
     pid_t mFusePid;
-    /* Flag indicating this is primary storage */
-    bool mPrimary;
 
-    /* Parsed UUID from filesystem */
+    /* Filesystem type */
+    std::string mFsType;
+    /* Filesystem UUID */
     std::string mFsUuid;
-    /* User-visible label from filesystem */
+    /* User-visible filesystem label */
     std::string mFsLabel;
 
     DISALLOW_COPY_AND_ASSIGN(PublicVolume);