diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 64e2bd8ce8..afc859fa90 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -834,7 +834,7 @@ public class OsmandSettings { public final OsmandPreference OSMO_AUTO_SEND_LOCATIONS = new BooleanPreference("osmo_automatically_send_locations", false).makeGlobal(); - public final CommonPreference OSMO_SAVE_TRACK_INTERVAL = new IntPreference("osmo_save_track_interval", 3000).makeGlobal().cache(); + public final CommonPreference OSMO_SAVE_TRACK_INTERVAL = new IntPreference("osmo_save_track_interval", 5000).makeGlobal().cache(); public final OsmandPreference OSMO_GROUPS = new StringPreference("osmo_groups", "{}").makeGlobal(); diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java index 3f1478f3de..ca53a8dbf0 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java @@ -345,6 +345,12 @@ public class OsMoThread { } private void writeCommands() throws UnsupportedEncodingException, IOException { + if(authorized == 0) { + String auth = "TOKEN|"+ sessionInfo.token; + cmd(auth, true); + authorized = 1; + pendingSendCommand = ByteBuffer.wrap(prepareCommand(auth).toString().getBytes("UTF-8")); + } if (pendingSendCommand == null) { pendingSendCommand = getNewPendingSendCommand(); } @@ -362,12 +368,6 @@ public class OsMoThread { private ByteBuffer getNewPendingSendCommand() throws UnsupportedEncodingException { - if(authorized == 0) { - String auth = "TOKEN|"+ sessionInfo.token; - cmd(auth, true); - authorized = 1; - return ByteBuffer.wrap(prepareCommand(auth).toString().getBytes("UTF-8")); - } if(authorized == 1) { return null; } @@ -385,7 +385,6 @@ public class OsMoThread { cmd(PING_CMD, true); return ByteBuffer.wrap(prepareCommand(PING_CMD).toString().getBytes("UTF-8")); } - } return null; } diff --git a/OsmAnd/src/net/osmand/plus/osmo/SettingsOsMoActivity.java b/OsmAnd/src/net/osmand/plus/osmo/SettingsOsMoActivity.java index a854100553..f74fc35198 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/SettingsOsMoActivity.java +++ b/OsmAnd/src/net/osmand/plus/osmo/SettingsOsMoActivity.java @@ -30,7 +30,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity { private Preference trackerId; private CheckBoxPreference sendLocationsref; - public static final int[] SECONDS = new int[] {1, 2, 3, 5, 10, 15, 30, 60, 90}; + public static final int[] SECONDS = new int[] {0, 1, 2, 3, 5, 10, 15, 30, 60, 90}; public static final int[] MINUTES = new int[] {2, 3, 5};