Merge branch 'master' of ssh://github.com/osmandapp/Osmand

This commit is contained in:
Victor Shcherb 2014-08-28 00:25:24 +02:00
commit b4b92311c3
4 changed files with 23 additions and 33 deletions

View file

@ -1977,4 +1977,8 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="int_hour">h</string>
<string name="duration">Durata</string>
<string name="distance">Distanza</string>
</resources>
<string name="save_track_to_gpx_globally">Registra la traccia in un file GPX</string>
<string name="save_track_to_gpx_globally_descr">La registrazione della posizione in un file GPX può essere accesa o spenta dal widget registrazione GPX sulla schermata della mappa</string>
<string name="save_track_interval_globally">Intervallo registrazione</string>
<string name="rendering_attr_publicTransportMode_name">Modo trasporto pubblico</string>
</resources>

View file

@ -560,8 +560,9 @@ public class OsmandApplication extends Application {
}
}
}
if(getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()){
startNavigationService(NavigationService.USED_BY_GPX);
//I guess we should not start the sleep mode service automatically upon app start
//if(getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()){
// startNavigationService(NavigationService.USED_BY_GPX);
}
// restore backuped favorites to normal file
final File appDir = getAppPath(null);
@ -850,18 +851,15 @@ public class OsmandApplication extends Application {
final Intent serviceIntent = new Intent(this, NavigationService.class);
serviceIntent.putExtra(NavigationService.USAGE_INTENT, intent);
if (getNavigationService() == null) {
if (intent == NavigationService.USED_BY_GPX) {
if (getSettings().SAVE_GLOBAL_TRACK_INTERVAL.get() < 30000) {
getSettings().SERVICE_OFF_INTERVAL.set(0);
} else {
//Use SERVICE_OFF_INTERVAL > 0 to conserve power for longer GPX recording intervals
getSettings().SERVICE_OFF_INTERVAL.set(getSettings().SAVE_GLOBAL_TRACK_INTERVAL.get());
}
} else {
if (intent != NavigationService.USED_BY_GPX) {
//for only-USED_BY_GPX case use pre-configured SERVICE_OFF_INTERVAL
//other cases always use "continuous":
getSettings().SERVICE_OFF_INTERVAL.set(0);
}
startService(serviceIntent);
} else {
//additional cases always use "continuous"
//TODO: fallback to custom USED_BY_GPX interval in case all other sleep mode purposes have been stopped
getSettings().SERVICE_OFF_INTERVAL.set(0);
getNavigationService().addUsageIntent(intent);
}

View file

@ -476,8 +476,7 @@ public class GeoIntentActivity extends OsmandListActivity {
.replaceAll(" ", ",");
System.out.println(query);
//String is split on each comma
String[] s = query.substring(query
.indexOf("q=") + 2).split(",");
String[] s = query.split(",");
elements = new ArrayList<String>();
for (int i = 0; i<s.length; i++) {

View file

@ -198,11 +198,9 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
setText(txt, subtxt);
setImageDrawable(d);
//if ((last != lastUpdateTime) && globalRecord) {
if ((last != lastUpdateTime) && (globalRecord || isRecording)) {
lastUpdateTime = last;
//blink();
//test blink wuith 2 indicator states
//blink implementation with 2 indicator states (global logging + profile/navigation logging)
setImageDrawable(monitoringInactive);
invalidate();
postDelayed(new Runnable() {
@ -216,23 +214,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
invalidate();
}
}, 500);
//end test
}
updateVisibility(visible);
return true;
}
// private void blink() {
// setImageDrawable(monitoringSmall);
// invalidate();
// postDelayed(new Runnable() {
// @Override
// public void run() {
// setImageDrawable(monitoringBig);
// invalidate();
// }
// }, 500);
// }
};
monitoringControl.updateInfo(null);
@ -345,10 +330,14 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn
settings.SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value);
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true);
settings.SAVE_GLOBAL_TRACK_REMEMBER.set(choice.value);
//interval setting not needed here, handled centrally in app.startNavigationService
//if (app.getNavigationService() == null) {
// settings.SERVICE_OFF_INTERVAL.set(0);
//}
if (settings.SAVE_GLOBAL_TRACK_INTERVAL.get() < 30000) {
settings.SERVICE_OFF_INTERVAL.set(0);
} else {
//Use SERVICE_OFF_INTERVAL > 0 to conserve power for longer GPX recording intervals
settings.SERVICE_OFF_INTERVAL.set(settings.SAVE_GLOBAL_TRACK_INTERVAL.get());
}
app.startNavigationService(NavigationService.USED_BY_GPX);
}
};