Fix adding new aidl callback

This commit is contained in:
Chumva 2019-04-26 12:55:29 +03:00
parent 73a91757ea
commit b87616de13

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