Add display travel obf for developer version only
This commit is contained in:
parent
094b8e04e0
commit
5c71d5181d
2 changed files with 10 additions and 4 deletions
|
@ -12,6 +12,7 @@ import net.osmand.map.TileSourceManager;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.SQLiteTileSource;
|
import net.osmand.plus.SQLiteTileSource;
|
||||||
|
import net.osmand.plus.Version;
|
||||||
import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask;
|
import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask;
|
||||||
import net.osmand.plus.voice.JSMediaCommandPlayerImpl;
|
import net.osmand.plus.voice.JSMediaCommandPlayerImpl;
|
||||||
import net.osmand.plus.voice.JSTTSCommandPlayerImpl;
|
import net.osmand.plus.voice.JSTTSCommandPlayerImpl;
|
||||||
|
@ -316,8 +317,9 @@ public class LocalIndexHelper {
|
||||||
private void loadTravelData(File mapPath, List<LocalIndexInfo> result, AbstractLoadLocalIndexTask loadTask) {
|
private void loadTravelData(File mapPath, List<LocalIndexInfo> result, AbstractLoadLocalIndexTask loadTask) {
|
||||||
if (mapPath.canRead()) {
|
if (mapPath.canRead()) {
|
||||||
for (File mapFile : listFilesSorted(mapPath)) {
|
for (File mapFile : listFilesSorted(mapPath)) {
|
||||||
if (mapFile.isFile() && mapFile.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT) ||
|
if (mapFile.isFile() && mapFile.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT)
|
||||||
mapFile.isFile() && mapFile.getName().endsWith(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)) {
|
|| (mapFile.isFile() && mapFile.getName().endsWith(IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT)
|
||||||
|
&& Version.isDeveloperVersion(app))) { //todo remove when .travel.obf will be used in production
|
||||||
LocalIndexInfo info = new LocalIndexInfo(LocalIndexType.TRAVEL_DATA, mapFile, false, app);
|
LocalIndexInfo info = new LocalIndexInfo(LocalIndexType.TRAVEL_DATA, mapFile, false, app);
|
||||||
updateDescription(info);
|
updateDescription(info);
|
||||||
result.add(info);
|
result.add(info);
|
||||||
|
|
|
@ -291,7 +291,11 @@ public class DownloadActivityType {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public IndexItem parseIndexItem(Context ctx, XmlPullParser parser) {
|
public IndexItem parseIndexItem(OsmandApplication ctx, XmlPullParser parser) {
|
||||||
|
if (TRAVEL_FILE == this && !Version.isDeveloperVersion(ctx)) {
|
||||||
|
//todo remove "if" when .travel.obf will be used in production
|
||||||
|
return null;
|
||||||
|
}
|
||||||
String name = parser.getAttributeValue(null, "name"); //$NON-NLS-1$
|
String name = parser.getAttributeValue(null, "name"); //$NON-NLS-1$
|
||||||
if (!isAccepted(name)) {
|
if (!isAccepted(name)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue