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
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class SdkConfig {
@JsonProperty("allow_handoff")
private final Boolean allowHandoff;

@JsonProperty("enforce_handoff")
private final Boolean enforceHandoff;

@JsonProperty("attempts_configuration")
private final AttemptsConfiguration attemptsConfiguration;

Expand All @@ -72,6 +75,7 @@ private SdkConfig(String allowedCaptureMethods,
String errorUrl,
String privacyPolicyUrl,
Boolean allowHandoff,
Boolean enforceHandoff,
AttemptsConfiguration attemptsConfiguration,
String brandId,
String biometricConsentFlow,
Expand All @@ -88,6 +92,7 @@ private SdkConfig(String allowedCaptureMethods,
this.errorUrl = errorUrl;
this.privacyPolicyUrl = privacyPolicyUrl;
this.allowHandoff = allowHandoff;
this.enforceHandoff = enforceHandoff;
this.attemptsConfiguration = attemptsConfiguration;
this.brandId = brandId;
this.biometricConsentFlow = biometricConsentFlow;
Expand Down Expand Up @@ -206,6 +211,15 @@ public Boolean getAllowHandoff() {
return allowHandoff;
}

/**
* If mobile handoff is enforced in the session
*
* @return if mobile handoff is enforced
*/
public Boolean getEnforceHandoff() {
return enforceHandoff;
}

/**
* The number of allowed attempts for certain tasks
*
Expand Down Expand Up @@ -259,6 +273,7 @@ public static class Builder {
private String errorUrl;
private String privacyPolicyUrl;
private Boolean allowHandoff;
private Boolean enforceHandoff;
private AttemptsConfiguration attemptsConfiguration;
private String brandId;
private String biometricConsentFlow;
Expand Down Expand Up @@ -444,6 +459,17 @@ public Builder withAllowHandoff(boolean allowHandoff) {
return this;
}

/**
* Sets if the user is required to perform mobile handoff
*
* @param enforceHandoff if mobile handoff is enforced
* @return the builder
*/
public Builder withEnforceHandoff(boolean enforceHandoff) {
this.enforceHandoff = enforceHandoff;
return this;
}

/**
* Sets the {@link AttemptsConfiguration} for any Text Extractions Tasks
*
Expand Down Expand Up @@ -528,6 +554,7 @@ public SdkConfig build() {
errorUrl,
privacyPolicyUrl,
allowHandoff,
enforceHandoff,
attemptsConfiguration,
brandId,
biometricConsentFlow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void shouldBuildSimpleSdkConfigWithAllOptions() {
.withErrorUrl(SOME_ERROR_URL)
.withPrivacyPolicyUrl(SOME_PRIVACY_POLICY_URL)
.withAllowHandoff(true)
.withEnforceHandoff(true)
.withAttemptsConfiguration(attemptsConfigurationMock)
.withBrandId(SOME_BRAND_ID)
.withSuppressedScreen(SOME_SUPPRESSED_SCREEN)
Expand All @@ -64,6 +65,7 @@ public void shouldBuildSimpleSdkConfigWithAllOptions() {
assertThat(result.getErrorUrl(), is(SOME_ERROR_URL));
assertThat(result.getPrivacyPolicyUrl(), is(SOME_PRIVACY_POLICY_URL));
assertThat(result.getAllowHandoff(), is(true));
assertThat(result.getEnforceHandoff(), is(true));
assertThat(result.getAttemptsConfiguration(), is(attemptsConfigurationMock));
assertThat(result.getBrandId(), is(SOME_BRAND_ID));
assertThat(result.getSuppressedScreens(), hasSize(2));
Expand All @@ -78,6 +80,14 @@ public void allowHandoff_shouldBeNullWhenNotSet() {
assertThat(result.getAllowHandoff(), is(nullValue()));
}

@Test
public void enforceHandoff_shouldBeNullWhenNotSet() {
SdkConfig result = SdkConfig.builder()
.build();

assertThat(result.getEnforceHandoff(), is(nullValue()));
}

@Test
public void shouldBuildSimpleSdkConfigWithOnlyCamera() {
SdkConfig result = SdkConfig.builder()
Expand Down
Loading