From b9efcf232dff1ce49962849470d3ad7e3e0c2dbf Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Wed, 23 Jul 2014 09:38:34 +0200 Subject: [PATCH 1/3] Restore support for c:geo intent --- .../plus/activities/search/GeoIntentActivity.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java index f38e6096ec..66c580597d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java @@ -320,6 +320,9 @@ public class GeoIntentActivity extends OsmandListActivity { } else { matcher = Pattern.compile(pattern).matcher(schemeSpecific); } + + final String pattern2 = "([\\-0-9.]+),([\\-0-9.]+)(?:.*)"; //c:geo + final Matcher matcher2 = Pattern.compile(pattern2).matcher(schemeSpecific); if (matcher.matches()) { @@ -333,11 +336,13 @@ public class GeoIntentActivity extends OsmandListActivity { { return new GeoPointSearch(lat, lon, Integer.valueOf(matcher.group(4))); } - } - else - { - return null; - } + } else if (matcher2.matches()) { + final double lat = Double.valueOf(matcher2.group(1)); + final double lon = Double.valueOf(matcher2.group(2)); + return new GeoPointSearch(lat, lon); + } else { + return null; + } } } return null; From 043de3091784fa9cdb73e9dcb90c20f3baef7c10 Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Wed, 23 Jul 2014 09:49:52 +0200 Subject: [PATCH 2/3] format --- .../plus/activities/search/GeoIntentActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java index 66c580597d..134129bd9b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java @@ -336,13 +336,13 @@ public class GeoIntentActivity extends OsmandListActivity { { return new GeoPointSearch(lat, lon, Integer.valueOf(matcher.group(4))); } - } else if (matcher2.matches()) { - final double lat = Double.valueOf(matcher2.group(1)); - final double lon = Double.valueOf(matcher2.group(2)); - return new GeoPointSearch(lat, lon); - } else { - return null; - } + } else if (matcher2.matches()) { + final double lat = Double.valueOf(matcher2.group(1)); + final double lon = Double.valueOf(matcher2.group(2)); + return new GeoPointSearch(lat, lon); + } else { + return null; + } } } return null; From e43da561c47404c1c34d5db92f5aab159b350767 Mon Sep 17 00:00:00 2001 From: Zahnstocher Date: Wed, 23 Jul 2014 11:33:16 +0200 Subject: [PATCH 3/3] Fix navigation intent regexp (c:geo and others) --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 45bb9660ae..ff2e996ee6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -343,7 +343,7 @@ public class MapActivity extends AccessibleActivity { } else if ("google.navigation".equals(scheme) || "osmand.navigation".equals(scheme)) { final String schemeSpecificPart = data.getSchemeSpecificPart(); - final Matcher matcher = Pattern.compile("q=(.+?),(.+?)").matcher(schemeSpecificPart); + final Matcher matcher = Pattern.compile("(?:q|ll)=([\\-0-9.]+),([\\-0-9.]+)(?:.*)").matcher(schemeSpecificPart); if (matcher.matches()) { try { final double lat = Double.valueOf(matcher.group(1));