Prevent permission denied

This commit is contained in:
Martin Fietz 2016-04-22 15:23:35 +02:00
parent 69fad87166
commit 960b58b748
2 changed files with 4 additions and 2 deletions

View File

@ -132,7 +132,8 @@ public class StorageErrorActivity extends AppCompatActivity {
List<String> folders = new ArrayList<>(mediaDirs.length);
List<CharSequence> choices = new ArrayList<>(mediaDirs.length);
for(int i=0; i < mediaDirs.length; i++) {
if(mediaDirs[i] == null) {
File dir = mediaDirs[i];
if(dir == null || !dir.exists() || !dir.canRead() || !dir.canWrite()) {
continue;
}
String path = mediaDirs[i].getAbsolutePath();

View File

@ -819,7 +819,8 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
List<String> folders = new ArrayList<>(mediaDirs.length);
List<CharSequence> choices = new ArrayList<>(mediaDirs.length);
for(int i=0; i < mediaDirs.length; i++) {
if(mediaDirs[i] == null) {
File dir = mediaDirs[i];
if(dir == null || !dir.exists() || !dir.canRead() || !dir.canWrite()) {
continue;
}
String path = mediaDirs[i].getAbsolutePath();