Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions library/java/net/openid/appauth/browser/BrowserSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ private static boolean hasWarmupService(PackageManager pm, String packageName) {
}

private static boolean isFullBrowser(ResolveInfo resolveInfo) {
// The filter must match ACTION_VIEW, CATEGORY_BROWSEABLE, and at least one scheme,
// The filter must match ACTION_VIEW and at least one scheme,
if (!resolveInfo.filter.hasAction(Intent.ACTION_VIEW)
|| !resolveInfo.filter.hasCategory(Intent.CATEGORY_BROWSABLE)
|| resolveInfo.filter.schemesIterator() == null) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ public class BrowserSelectorTest {
.addSignature("DolphinSignature")
.build();

private static final TestBrowser OPERA =
new TestBrowserBuilder("com.opera.browser")
.addAction(Intent.ACTION_VIEW)
.addScheme(SCHEME_HTTP)
.addScheme(SCHEME_HTTPS)
.setVersion("50")
.addSignature("OperaSignature")
.build();

private static final TestBrowser[] NO_BROWSERS = new TestBrowser[0];

@Mock Context mContext;
Expand Down Expand Up @@ -147,18 +156,12 @@ public void testSelect_ignoreAuthorityRestrictedBrowsers()
}

@Test
public void testSelect_ignoreBrowsersWithoutBrowseableCategory()
public void testSelect_acceptBrowsersWithoutBrowseableCategory()
throws NameNotFoundException {
TestBrowser misconfiguredBrowser =
new TestBrowserBuilder("com.broken.browser")
.addAction(Intent.ACTION_VIEW)
.addCategory(Intent.CATEGORY_DEFAULT)
.addScheme(SCHEME_HTTP)
.addScheme(SCHEME_HTTPS)
.build();
setBrowserList(misconfiguredBrowser, CHROME);
setBrowsersWithWarmupSupport(misconfiguredBrowser, CHROME);
checkSelectedBrowser(CHROME, USE_CUSTOM_TAB);
// Opera browser does not expose Intent.CATEGORY_BROWSABLE
setBrowserList(OPERA);
setBrowsersWithWarmupSupport(OPERA);
checkSelectedBrowser(OPERA, USE_CUSTOM_TAB);
}

@Test
Expand Down