Skip to content
Merged
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
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Alex Chau <alexchau@google.com>
Benjamin Franz <bfranz@google.com>
Rebecka Gulliksson <rebecka.gulliksson@gmail.com>
Rahul Ravikumar <rahulrav@google.com>
Henning Nielsen Lund <henning.n.lund@jp.dk>
6 changes: 6 additions & 0 deletions library/java/net/openid/appauth/browser/Browsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ public static final class SBrowser {
public static final Set<String> SIGNATURE_SET =
Collections.singleton(SIGNATURE_HASH);

/**
* The version in which Custom Tabs were introduced in Samsung Internet.
*/
public static final DelimitedVersion MINIMUM_VERSION_FOR_CUSTOM_TAB =
DelimitedVersion.parse("4.0");

/**
* Creates a browser descriptor for the specified version of SBrowser, when
* used as a standalone browser.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class VersionedBrowserMatcher implements BrowserMatcher {
Browsers.SBrowser.PACKAGE_NAME,
Browsers.SBrowser.SIGNATURE_SET,
true,
VersionRange.ANY_VERSION);
VersionRange.atLeast(Browsers.SBrowser.MINIMUM_VERSION_FOR_CUSTOM_TAB));

private String mPackageName;
private Set<String> mSignatureHashes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ public void testMatches() {
.isTrue();
assertThat(AnyBrowserMatcher.INSTANCE.matches(Browsers.SBrowser.standaloneBrowser("2.1")))
.isTrue();
assertThat(AnyBrowserMatcher.INSTANCE.matches(Browsers.SBrowser.customTab("4.0")))
.isTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public void testMatches_firefoxOrSamsung() {
assertThat(whitelist.matches(Browsers.Chrome.customTab("46"))).isFalse();
assertThat(whitelist.matches(Browsers.Firefox.standaloneBrowser("10"))).isTrue();
assertThat(whitelist.matches(Browsers.SBrowser.standaloneBrowser("10"))).isTrue();
assertThat(whitelist.matches(Browsers.SBrowser.customTab("10"))).isTrue();
assertThat(whitelist.matches(Browsers.SBrowser.customTab("4.0"))).isTrue();
assertThat(whitelist.matches(Browsers.SBrowser.customTab("3.9"))).isFalse();
}

}