Bugfixes (Freezing OsmAnd on selecting public transport's stops) ##5849, 6219, 6408

This commit is contained in:
madwasp79 2019-01-16 15:48:37 +02:00
parent 463a83ba22
commit f7d3e72fb1
3 changed files with 7 additions and 4 deletions

View file

@ -554,13 +554,15 @@ public class BinaryMapIndexReader {
}
return false;
}
public List<TransportStop> searchTransportIndex(SearchRequest<TransportStop> req) throws IOException {
for (TransportIndex index : transportIndexes) {
if (index.stopsFileLength == 0 || index.right < req.left || index.left > req.right || index.top > req.bottom
|| index.bottom < req.top) {
continue;
}
if (req.stringTable != null) {
req.stringTable.clear();
}
codedIS.seek(index.stopsFileOffset);
int oldLimit = codedIS.pushLimit(index.stopsFileLength);
int offset = req.searchResults.size();
@ -875,6 +877,8 @@ public class BinaryMapIndexReader {
continue;
}
// lazy initializing trees
if (index.trees == null) {
index.trees = new ArrayList<MapTree>();

View file

@ -402,12 +402,12 @@ public class BinaryMapTransportReaderAdapter {
int oldLimit = codedIS.pushLimit(ind.stringTable.length);
int current = 0;
int i = 0;
while (i < values.length) {
while (i < values.length && codedIS.getBytesUntilLimit() > 0) {
int t = codedIS.readTag();
int tag = WireFormat.getTagFieldNumber(t);
switch (tag) {
case 0:
break;
return;
case OsmandOdb.StringTable.S_FIELD_NUMBER:
if (current == values[i]) {
String value = codedIS.readString();

View file

@ -832,7 +832,6 @@ public class OsmandAidlService extends Service {
@Override
public void onAppInitialized() {
try {
LOG.debug("OsmandAidlService callback.onAppInitialized()");
callback.onAppInitialized();
} catch (Exception e) {
handleException(e);