Merge pull request #6873 from osmandapp/TrackerImprovements

Fix adding new aidl callback id
This commit is contained in:
Alexey 2019-04-26 13:05:17 +03:00 committed by GitHub
commit 3d60921184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,8 +158,9 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
@Override
public long addAidlCallback(IOsmAndAidlCallback callback, int key) {
callbacks.put(getAndIncrementCallbackId(), new AidlCallbackParams(callback, key));
return getCallbackId();
long id = getAndIncrementCallbackId();
callbacks.put(id, new AidlCallbackParams(callback, key));
return id;
}
@Override
@ -765,7 +766,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
if (updateTimeMS >= MIN_UPDATE_TIME_MS) {
long id = addAidlCallback(callback, KEY_ON_UPDATE);
startRemoteUpdates(updateTimeMS, id, callback);
return getCallbackId();
return id;
} else {
return MIN_UPDATE_TIME_MS_ERROR;
}