Secondary mounted public volumes are write-accessible for legacy apps

Legacy apps with WRITE_EXTERNAL_STORAGE permission can read/write to
secondary volumes(except for /data/obb dirs), this is a change
introduced in R (previously, the legacy apps had the same access for
primary and secondary volumes alike).

This change fixes testSecondaryMountPointsNotWritable and
testSecondaryWalkingUpTreeReadOnly which were failing on a disk with
public SD Card.

Bug: 157469965
Test: * Test device should have secondary mounted volumes.
      * atest ExternalStorageHostTest#testExternalStorageWrite
Change-Id: I22dc795ada364d967260fd5275dd44b4bc572dbf
(cherry picked from commit 5fdff1d80882cc4c8b3e7fcd4882d9c81c222882)
2 files changed