Commit a057ca43 authored by Geoffrey Métais's avatar Geoffrey Métais

Filter external storage from storages lists

parent f1ba9355
......@@ -90,6 +90,7 @@ public class ExternalMonitor extends BroadcastReceiver {
public void run() {
final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx);
final List<String> devices = AndroidDevices.getExternalStorageDirectories();
devices.remove(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
final String[] knownDevices = ml.getDevices();
final List<String> missingDevices = Util.arrayToArrayList(knownDevices);
missingDevices.remove("file://"+AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
......
......@@ -226,8 +226,9 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
shouldInit |= initCode == Medialibrary.ML_INIT_DB_RESET;
if (initCode != Medialibrary.ML_INIT_FAILED) {
final List<String> devices = new ArrayList<>();
devices.add(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
devices.addAll(AndroidDevices.getExternalStorageDirectories());
if (!devices.contains(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY))
devices.add(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
for (final String device : devices) {
final boolean isMainStorage = TextUtils.equals(device, AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment