Android: Only use scoped storage for scanning on 11+
This commit is contained in:
parent
bcd40dd860
commit
9784c9d930
|
@ -292,9 +292,9 @@ public class GameDirectoriesActivity extends AppCompatActivity {
|
||||||
if (resultCode != RESULT_OK || data.getData() == null)
|
if (resultCode != RESULT_OK || data.getData() == null)
|
||||||
return;
|
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....
|
// 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);
|
final String path = FileHelper.getFullPathFromTreeUri(data.getData(), this);
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
addSearchDirectory(this, path, true);
|
addSearchDirectory(this, path, true);
|
||||||
|
|
|
@ -272,9 +272,9 @@ public class MainActivity extends AppCompatActivity {
|
||||||
if (resultCode != RESULT_OK || data.getData() == null)
|
if (resultCode != RESULT_OK || data.getData() == null)
|
||||||
return;
|
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....
|
// 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);
|
final String path = FileHelper.getFullPathFromTreeUri(data.getData(), this);
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
GameDirectoriesActivity.addSearchDirectory(this, path, true);
|
GameDirectoriesActivity.addSearchDirectory(this, path, true);
|
||||||
|
|
Loading…
Reference in New Issue