Commit 14ac6db3 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

media library: use the external storage as the default root directory

Scanning the whole system for media files is useless as most of the file
system is read only and invisible for the user and most user content
should be in the external storage anyway.
parent 01ab4148
......@@ -30,6 +30,7 @@ import java.util.Stack;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Environment;
import android.os.Handler;
import android.preference.PreferenceManager;
......@@ -120,7 +121,13 @@ public class MediaLibrary {
mMainActivity = MainActivity.getInstance();
Handler mainHandler = mMainActivity.mHandler;
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mMainActivity);
String root = pref.getString("directories_root", "/");
String root = pref.getString("directories_root", null);
// use the external storage as our default root directory (most often /mnt/sdcard)
if (root == null) {
root = Environment.getExternalStorageDirectory().getAbsolutePath();
}
// show progressbar in header
mainHandler.sendEmptyMessage(MainActivity.SHOW_PROGRESSBAR);
......
Supports Markdown
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