Merge pull request #864 from Bars107/master

FIxed bug with wrong directory for app customization
This commit is contained in:
vshcherb 2014-09-04 11:39:29 +02:00
commit 97f9a0c227
3 changed files with 16 additions and 2 deletions

View file

@ -178,4 +178,8 @@ public class OsmAndAppCustomization {
public int getWaypointSearchRadius(int searchDeviationRadius, int type) {
return searchDeviationRadius;
}
public File getExternalStorageDir() {
return osmandSettings.getExternalStorageDirectory();
}
}

View file

@ -750,7 +750,8 @@ public class OsmandApplication extends Application {
if(path == null) {
path = "";
}
return new File(getSettings().getExternalStorageDirectory(), IndexConstants.APP_DIR + path);
return new File(getAppCustomization().getExternalStorageDir(), IndexConstants.APP_DIR + path);
}
public void applyTheme(Context c) {

View file

@ -10,6 +10,7 @@ import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import android.os.Environment;
import android.widget.Toast;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
@ -92,6 +93,14 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
}
accessCodePref = osmandSettings.registerStringPreference(ACCESS_CODE, "").makeGlobal();
toursFolder = new File(osmandSettings.getExternalStorageDirectory(), "osmand/tours");
}
@Override
public File getExternalStorageDir() {
final String defaultLocation = Environment.getExternalStorageDirectory().getAbsolutePath();
return new File(originalApi.getString(originalGlobal, OsmandSettings.EXTERNAL_STORAGE_DIR,
defaultLocation));
}
public boolean setAccessCode(String acCode) {