Make StubVolumes visible for read

Set MOUNT_FLAG_VISIBLE_FOR_READ for StubVolumes that are not specified
to be visible so that they are indexed by MediaScanner, but no "Android"
directory is created inside them.

Bug: 206019156
Test: StubVolumes not specified to be visible are mounted with the flag
Test: MOUNT_FLAG_VISIBLE_FOR_READ.
Change-Id: I6b8f4a498651d996e57dff45f4875dd05f786086
This commit is contained in:
Youkichi Hosoi
2021-11-12 06:14:25 +09:00
parent 9b033785ae
commit 564e1f86da

View File

@@ -1592,6 +1592,8 @@ class StorageManagerService extends IStorageManager.Stub
} else if (vol.type == VolumeInfo.TYPE_STUB) {
if (vol.disk.isStubVisible()) {
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_WRITE;
} else {
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE_FOR_READ;
}
vol.mountUserId = mCurrentUserId;
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();