Use compat flags to reflect the current status of legacy storage.

Scoped Storage status of an app can be changed by using compat flags,
as apps can chose to opt-in/opt out of Scoped Storage using these flags.
See ag/10406320 for more details.

Update documentation of isExternalStorageLegacy() method.

Remove checks around INSTALL_PACKAGES and OP_REQUEST_INSTALL_PACKAGES as
that does not allow legacy external storage.

Remove check for WRITE_MEDIA_STORAGE as its value is now
reflected by OP_LEGACY_STORAGE (ag/10162772)

Bug: 132649864
Test: atest ExternalStorageHostTest
Test: atest com.android.providers.media
Test: manually using StorageTest app
Merged-In: Id53da8f8783455038bad101e6ac50ba66b595012
Change-Id: Id53da8f8783455038bad101e6ac50ba66b595012
(cherry picked from commit f8af82046a52e588b56ca893aaf47de620f4c7ad)
1 file changed