Add frequency 0

This commit is contained in:
vshcherb 2014-05-29 11:51:35 +02:00
parent 4abbd7a5d4
commit 19b5e2a532
3 changed files with 8 additions and 9 deletions

View file

@ -834,7 +834,7 @@ public class OsmandSettings {
public final OsmandPreference<Boolean> OSMO_AUTO_SEND_LOCATIONS = new BooleanPreference("osmo_automatically_send_locations", false).makeGlobal();
public final CommonPreference<Integer> OSMO_SAVE_TRACK_INTERVAL = new IntPreference("osmo_save_track_interval", 3000).makeGlobal().cache();
public final CommonPreference<Integer> OSMO_SAVE_TRACK_INTERVAL = new IntPreference("osmo_save_track_interval", 5000).makeGlobal().cache();
public final OsmandPreference<String> OSMO_GROUPS = new StringPreference("osmo_groups", "{}").makeGlobal();

View file

@ -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;
}

View file

@ -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};