1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-01 06:22:55 +01:00

Bangle.js: actTrk- fix logic re requesting logs

This commit is contained in:
Ganblejs 2024-03-02 01:56:40 +01:00 committed by José Rebelo
parent 7146fce683
commit 9919bb2d6f

View File

@ -735,13 +735,17 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
LOG.info("trksList says hi!"); LOG.info("trksList says hi!");
//GB.toast(getContext(), "trksList says hi!", Toast.LENGTH_LONG, GB.INFO); //GB.toast(getContext(), "trksList says hi!", Toast.LENGTH_LONG, GB.INFO);
tracksList = json.getJSONArray("list"); tracksList = json.getJSONArray("list");
lastRecToFetch = tracksList.getString(tracksList.length()-1);
LOG.info("New recorder logs since last fetch: " + String.valueOf(tracksList)); LOG.info("New recorder logs since last fetch: " + String.valueOf(tracksList));
if (tracksList.length()==0) {
getDevice().unsetBusyTask();
} else {
lastRecToFetch = tracksList.getString(tracksList.length()-1);
requestActivityTrackLog(tracksList.getString(0), 1==tracksList.length());
tracksList.remove(0);
}
//for (int i = 0; i < tracksList.length(); i ++) { //for (int i = 0; i < tracksList.length(); i ++) {
// requestActivityTrackLog(tracksList.getString(i), i==tracksList.length()-1); // requestActivityTrackLog(tracksList.getString(i), i==tracksList.length()-1);
//} //}
requestActivityTrackLog(tracksList.getString(0), 1==tracksList.length());
tracksList.remove(0);
} }
private void handleActTrk(JSONObject json) throws JSONException { private void handleActTrk(JSONObject json) throws JSONException {