From 4808a8f0bc25ba1cf7fd114553745f3e779e45f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Tue, 16 May 2017 18:42:30 +0300 Subject: [PATCH] [andorid] Fixed scheme and host for lead url/intent --- android/AndroidManifest.xml | 8 ++++++-- .../mapswithme/maps/DownloadResourcesActivity.java | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 9c3cb541cd..6758c1a7a5 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -141,8 +141,12 @@ + android:host="lead.maps.me" + android:scheme="http"/> + + diff --git a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java index a35f60c531..c5740bf8fa 100644 --- a/android/src/com/mapswithme/maps/DownloadResourcesActivity.java +++ b/android/src/com/mapswithme/maps/DownloadResourcesActivity.java @@ -626,7 +626,16 @@ public class DownloadResourcesActivity extends BaseMwmFragmentActivity public boolean isSupported(Intent intent) { final Uri data = intent.getData(); - return (data != null && "mapsme".equals(intent.getScheme()) && "lead".equals(data.getHost())); + + if (data == null) + return false; + + String scheme = intent.getScheme(); + String host = data.getHost(); + if (TextUtils.isEmpty(scheme) || TextUtils.isEmpty(host)) + return false; + + return (scheme.equals("https") || scheme.equals("http")) && "lead.maps.me".equals(host); } @Override