Split MOUNT_FLAG_VISIBLE into MOUNT_FLAG_VISIBLE_FOR_{READ, WRITE}

IVold.MOUNT_FLAG_VISIBLE is split into MOUNT_FLAG_VISIBLE_FOR_READ and
MOUNT_FLAG_VISIBLE_FOR_WRITE.
Accordingly, VolumeBase::MountFlags::kVisible is split into
kVisibleForRead and kVisibleForWrite.

Bug: 206019156
Test: m
Ignore-AOSP-First: Cherry-pick to AOSP later to avoid merge conflicts.
Change-Id: Ia55673400d9f713f221650e1335a46ba11f6f027
diff --git a/model/VolumeBase.h b/model/VolumeBase.h
index 689750d..f29df65 100644
--- a/model/VolumeBase.h
+++ b/model/VolumeBase.h
@@ -63,8 +63,14 @@
     enum MountFlags {
         /* Flag that volume is primary external storage */
         kPrimary = 1 << 0,
-        /* Flag that volume is visible to normal apps */
-        kVisible = 1 << 1,
+        /*
+         * Flags indicating that volume is visible to normal apps.
+         * kVisibleForRead and kVisibleForWrite correspond to
+         * VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_READ and
+         * VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_WRITE, respectively.
+         */
+        kVisibleForRead = 1 << 1,
+        kVisibleForWrite = 1 << 2,
     };
 
     enum class State {
@@ -103,6 +109,9 @@
     std::shared_ptr<VolumeBase> findVolume(const std::string& id);
 
     bool isEmulated() { return mType == Type::kEmulated; }
+    bool isVisibleForRead() const { return (mMountFlags & MountFlags::kVisibleForRead) != 0; }
+    bool isVisibleForWrite() const { return (mMountFlags & MountFlags::kVisibleForWrite) != 0; }
+    bool isVisible() const { return isVisibleForRead() || isVisibleForWrite(); }
 
     status_t create();
     status_t destroy();