Android: Only use scoped storage for scanning on 11+

This commit is contained in:
Connor McLaughlin 2021-05-18 17:36:43 +10:00
parent bcd40dd860
commit 9784c9d930
2 changed files with 4 additions and 4 deletions

View File

@ -292,9 +292,9 @@ public class GameDirectoriesActivity extends AppCompatActivity {
if (resultCode != RESULT_OK || data.getData() == null)
return;
// Use legacy storage on devices older than Android 9... apparently some of them
// Use legacy storage on devices older than Android 11... apparently some of them
// have broken storage access framework....
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.P) {
if (android.os.Build.VERSION.SDK_INT < 30) {
final String path = FileHelper.getFullPathFromTreeUri(data.getData(), this);
if (path != null) {
addSearchDirectory(this, path, true);

View File

@ -272,9 +272,9 @@ public class MainActivity extends AppCompatActivity {
if (resultCode != RESULT_OK || data.getData() == null)
return;
// Use legacy storage on devices older than Android 9... apparently some of them
// Use legacy storage on devices older than Android 11... apparently some of them
// have broken storage access framework....
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.P) {
if (android.os.Build.VERSION.SDK_INT < 30) {
final String path = FileHelper.getFullPathFromTreeUri(data.getData(), this);
if (path != null) {
GameDirectoriesActivity.addSearchDirectory(this, path, true);