mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-09 19:53:33 +00:00
parent
18edb74a58
commit
beee401baa
3 changed files with 3 additions and 0 deletions
|
@ -108,6 +108,7 @@ public class FolderPickerActivity extends SyncthingActivity
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
roots.addAll(Arrays.asList(getExternalFilesDirs(null)));
|
roots.addAll(Arrays.asList(getExternalFilesDirs(null)));
|
||||||
roots.remove(getExternalFilesDir(null));
|
roots.remove(getExternalFilesDir(null));
|
||||||
|
roots.remove(null); // getExternalFilesDirs may return null for an ejected SDcard.
|
||||||
}
|
}
|
||||||
|
|
||||||
String rootDir = getIntent().getStringExtra(EXTRA_ROOT_DIRECTORY);
|
String rootDir = getIntent().getStringExtra(EXTRA_ROOT_DIRECTORY);
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class TipsAndTricksActivity extends SyncthingActivity {
|
||||||
ArrayList<File> externalFilesDir = new ArrayList<>();
|
ArrayList<File> externalFilesDir = new ArrayList<>();
|
||||||
externalFilesDir.addAll(Arrays.asList(getExternalFilesDirs(null)));
|
externalFilesDir.addAll(Arrays.asList(getExternalFilesDirs(null)));
|
||||||
externalFilesDir.remove(getExternalFilesDir(null));
|
externalFilesDir.remove(getExternalFilesDir(null));
|
||||||
|
externalFilesDir.remove(null); // getExternalFilesDirs may return null for an ejected SDcard.
|
||||||
if (externalFilesDir.size() > 0) {
|
if (externalFilesDir.size() > 0) {
|
||||||
String absExternalStorageAppFilesPath = externalFilesDir.get(0).getAbsolutePath();
|
String absExternalStorageAppFilesPath = externalFilesDir.get(0).getAbsolutePath();
|
||||||
mTipListAdapter.add(getString(R.string.tip_write_to_sdcard_title),
|
mTipListAdapter.add(getString(R.string.tip_write_to_sdcard_title),
|
||||||
|
|
|
@ -167,6 +167,7 @@ public class FileUtils {
|
||||||
ArrayList<File> externalFilesDir = new ArrayList<>();
|
ArrayList<File> externalFilesDir = new ArrayList<>();
|
||||||
externalFilesDir.addAll(Arrays.asList(context.getExternalFilesDirs(null)));
|
externalFilesDir.addAll(Arrays.asList(context.getExternalFilesDirs(null)));
|
||||||
externalFilesDir.remove(context.getExternalFilesDir(null));
|
externalFilesDir.remove(context.getExternalFilesDir(null));
|
||||||
|
externalFilesDir.remove(null); // getExternalFilesDirs may return null for an ejected SDcard.
|
||||||
if (externalFilesDir.size() == 0) {
|
if (externalFilesDir.size() == 0) {
|
||||||
Log.w(TAG, "Could not determine app's private files directory on external storage.");
|
Log.w(TAG, "Could not determine app's private files directory on external storage.");
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue