legacy-external-storage

Test programmatically if in Android 10+ the legacy external storage access is disabled

。_饼干妹妹 提交于 2020-02-20 07:12:48
问题 Is there a simple API call that would tell me if an app running on Android 10 or later must use Scoped Storage access, that is, if the normal file access, a.k.a. "Legacy External Storage" is disabled? Note that even if the app in AndroidManifest.xml, section declared: android:requestLegacyExternalStorage="true" the file access may still be denied due to Google policy changes in the future, so testing this value is useless. The only way I found is to test if the external storage root directory

Test programmatically if in Android 10+ the legacy external storage access is disabled

怎甘沉沦 提交于 2019-12-05 04:32:57
Is there a simple API call that would tell me if an app running on Android 10 or later must use Scoped Storage access, that is, if the normal file access, a.k.a. "Legacy External Storage" is disabled? Note that even if the app in AndroidManifest.xml, section declared: android:requestLegacyExternalStorage="true" the file access may still be denied due to Google policy changes in the future, so testing this value is useless. The only way I found is to test if the external storage root directory is readable, but for that, the app must first ask for Storage permission, which is useless for