Fix Environment.isExternalStorageLegacy() impl.
Earlier, this API only used to consider op_legacy_storage
appop to decide whether an app will get legacy storage view
or not but there are few other factors it needs to consider
like whether the app has WRITE_MEDIA_STORAGE permission or
whether app was allowed to be an installer in which case it
will get legacy access.
Bug: 132760141
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Exempt-From-Owner-Approval: owners list is stale
Change-Id: I11580472aa9a24f087754ee445315a570cc596bd
2 files changed