Commit 3bb7dfb7 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Hide VR Intent Dispatcher from Android Default Browser list.

The Android platform's Default Browser code has a bug where it allows
the same package to show up multiple times despite not being able to
differentiate between the multiple components within the package that
caused it to detect multiple browsers within the package.

We can trick it into thinking the VR intent handling code isn't default
browser material by providing a wildcard host, making Android think
the intent handler uses a URI authority when it really doesn't.

Bug: 847921
Change-Id: I2b271fc1c99495a0e80e301ff432690dd5a2d0a6
Reviewed-on: https://chromium-review.googlesource.com/1079261Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574281}
parent e99bb687
...@@ -434,10 +434,14 @@ by a child template that "extends" this file. ...@@ -434,10 +434,14 @@ by a child template that "extends" this file.
<intent-filter android:priority="-1"> <intent-filter android:priority="-1">
<category android:name="com.google.intent.category.DAYDREAM" /> <category android:name="com.google.intent.category.DAYDREAM" />
<!-- Trick Android into thinking this intent filter contains data authorities, and
so cannot serve as the default browser. crbug.com/847921 -->
<data android:host="*" />
{{ self.common_view_intent_shared_filter_body() }} {{ self.common_view_intent_shared_filter_body() }}
</intent-filter> </intent-filter>
<intent-filter android:priority="-1"> <intent-filter android:priority="-1">
<category android:name="com.google.intent.category.DAYDREAM" /> <category android:name="com.google.intent.category.DAYDREAM" />
<data android:host="*" />
{{ self.common_view_intent_shared_filter_with_mime_body() }} {{ self.common_view_intent_shared_filter_with_mime_body() }}
</intent-filter> </intent-filter>
<intent-filter android:priority="-1"> <intent-filter android:priority="-1">
......
...@@ -777,7 +777,7 @@ public class ExternalNavigationHandler { ...@@ -777,7 +777,7 @@ public class ExternalNavigationHandler {
return false; return false;
} }
return ExternalNavigationDelegateImpl return ExternalNavigationDelegateImpl
.getSpecializedHandlersWithFilter(handlers, appId, null) .getSpecializedHandlersWithFilter(handlers, appId, intent)
.size() .size()
> 0; > 0;
} }
......
...@@ -83,7 +83,7 @@ public class WebappTabDelegate extends TabDelegate { ...@@ -83,7 +83,7 @@ public class WebappTabDelegate extends TabDelegate {
boolean foundSpecializedHandler = false; boolean foundSpecializedHandler = false;
for (String result : ExternalNavigationDelegateImpl.getSpecializedHandlersWithFilter( for (String result : ExternalNavigationDelegateImpl.getSpecializedHandlersWithFilter(
handlers, null, null)) { handlers, null, intent)) {
if (result.equals(mApkPackageName)) { if (result.equals(mApkPackageName)) {
// Current webapk matches, don't intercept so that we can launch a cct. See // Current webapk matches, don't intercept so that we can launch a cct. See
// http://crbug.com/831806 for more context. // http://crbug.com/831806 for more context.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment