Run tests only on VISIBLE volumes that are accessible by apps
This is a quick fix to unblock partners. The MediaProvider fix
for this will go out with the mainline release to return only VISIBLE
volumes for MediaStore.getExternalVolumeNames().
Non-VISIBLE volumes are not indexed by MediaProvider and are not mounted
by FUSE; Hence, MediaStore APIs do not have access on such directories,
as a result of which tests are failing. The reason this has not be
caught in Pixel devices is because all public volumes have ADOPTABLE
flag set and hence VISIBLE flag set. (b/171736035).
Copying javadocs recommended guidelines for VISIBLE volumes here for
context from VolumeInfo.java :
```
{@link #MOUNT_FLAG_VISIBLE} means the volume is visible to third-party
apps for direct filesystem access. The system should send out relevant
storage broadcasts and index any media on visible volumes.
Visible volumes are considered a more stable part of the device, which
is why we take the time to index them. In particular, transient volumes
like USB OTG devices <em>should not</em> be marked as visible; their
contents should be surfaced to apps through the Storage Access
Framework.
```
Bug: 170403461
Test: Manual; Non-adoptable public volume which is not-VISIBLE is not
run for CtsProviderTestCases. (Only able to repro this manually due to
b/171736035)
Change-Id: I443c776751119e8f38909c84a6f154837e646efd
Merged-In: I443c776751119e8f38909c84a6f154837e646efd
(cherry picked from commit 263293373a9dd5d671c4ebd8f55a343c8c7f3f55)
1 file changed