Merge pull request #6873 from osmandapp/TrackerImprovements
Fix adding new aidl callback id
This commit is contained in:
commit
3d60921184
1 changed files with 4 additions and 3 deletions
|
@ -158,8 +158,9 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long addAidlCallback(IOsmAndAidlCallback callback, int key) {
|
public long addAidlCallback(IOsmAndAidlCallback callback, int key) {
|
||||||
callbacks.put(getAndIncrementCallbackId(), new AidlCallbackParams(callback, key));
|
long id = getAndIncrementCallbackId();
|
||||||
return getCallbackId();
|
callbacks.put(id, new AidlCallbackParams(callback, key));
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -765,7 +766,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
||||||
if (updateTimeMS >= MIN_UPDATE_TIME_MS) {
|
if (updateTimeMS >= MIN_UPDATE_TIME_MS) {
|
||||||
long id = addAidlCallback(callback, KEY_ON_UPDATE);
|
long id = addAidlCallback(callback, KEY_ON_UPDATE);
|
||||||
startRemoteUpdates(updateTimeMS, id, callback);
|
startRemoteUpdates(updateTimeMS, id, callback);
|
||||||
return getCallbackId();
|
return id;
|
||||||
} else {
|
} else {
|
||||||
return MIN_UPDATE_TIME_MS_ERROR;
|
return MIN_UPDATE_TIME_MS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue