[andorid] Fixed scheme and host for lead url/intent

This commit is contained in:
Александр Зацепин 2017-05-16 18:42:30 +03:00 committed by r.kuznetsov
parent 8e66c2de4f
commit 4808a8f0bc
2 changed files with 16 additions and 3 deletions

View file

@ -141,8 +141,12 @@
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="lead"
android:scheme="mapsme"/>
android:host="lead.maps.me"
android:scheme="http"/>
<data
android:host="lead.maps.me"
android:scheme="https"/>
</intent-filter>
<!-- API CALL -->

View file

@ -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