Class SelfieScan.Builder
-
- All Implemented Interfaces:
public final class SelfieScan.Builder
-
-
Constructor Summary
Constructors Constructor Description SelfieScan.Builder()
-
Method Summary
Modifier and Type Method Description SelfieScan.Builder
from(SelfieScan existingSelfieScan)
SelfieScan.Builder
setCameraFacing(CameraFacing cameraFacing)
Sets the direction that the camera faces. SelfieScan.Builder
setAssistedOnboardingEnabled()
Enables assisted onboarding (back-camera-only onboarding). SelfieScan.Builder
setLogo(@DrawableRes() int logoResId)
Used to provide a custom logo to supported screens in the Selfie module. SelfieScan
build()
SelfieScan.Builder
setShowTutorials(boolean showTutorials)
Show tutorials how to capture selfie before the actual scan. SelfieScan.Builder
setWaitForTutorials(boolean waitForTutorials)
Hide the continue button in the tutorial screen while tutorial animation is playing, in order to make sure user has seen the video before continuing. SelfieScan.Builder
setMode(SelfieScan.Mode mode)
Sets the Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK). SelfieScan.Builder
setFaceRecognitionMode(SelfieScan.FaceRecognitionMode faceRecognitionMode)
Sets the Face Recognition mode (LOCAL or SERVER). SelfieScan.Builder
setLivenessDetectionMode(SelfieScan.LivenessDetectionMode livenessDetectionMode)
Sets the Liveness Detection mode (LOCAL or SERVER). SelfieScan.Builder
setFaceAuthMode(SelfieScan.FaceAuthMode mode)
Sets the Face Auth mode (SERVER, LOCAL or HYBRID). SelfieScan.Builder
setAllowFaceAuthModeFallback(boolean allowFaceAuthModeFallback)
Specify true if you would want to do a SERVER face login in case LOCAL couldn't be performed due to missing face template on the device. SelfieScan.Builder
setBrightnessThreshold(float brightnessThreshold)
Adjust minimum requirements for a well lit face during capture. SelfieScan.Builder
setCustomerToken(String customerToken)
Sets the customer token to be used for face login feature. SelfieScan.Builder
setCustomerUUID(String customerUUID)
Set the ID that uniquely identifies the pre-authorized user who is performing face login. SelfieScan.Builder
setEyesClosedCheckEnabled(boolean eyesClosedCheckEnabled)
Enables/disables eyes closed check. SelfieScan.Builder
setLensesCheckEnabled(boolean lensesCheckEnabled)
Enables/disables lenses check. SelfieScan.Builder
setMaskCheckEnabled(boolean maskCheckEnabled)
Specify true to enable local face mask check detection during face capture. SelfieScan.Builder
setBrightnessCheckEnabled(boolean brightnessCheckEnabled)
Specify true to enable brightness check during face capture. SelfieScan.Builder
setLogAuthenticationEnabled(boolean logAuthenticationEnabled)
Ensures that all the on-device processing data in HYBRID or LOCAL modes gets sent to the server. SelfieScan.Builder
setStreamFramesEnabled(boolean streamFramesEnabled)
Enables or disables video streaming of the [SelfieScan] module. SelfieScan.Builder
setAutoCaptureTimeout(int autoCaptureTimeout)
Sets the selfie auto capture timeout in seconds. SelfieScan.Builder
setCaptureAttempts(int captureAttempts)
Sets the selfie capture attempts. SelfieScan.Builder
setStreamAudioEnabled(boolean enabled)
Enables or disables audio during streaming of the [SelfieScan] module. SelfieScan.Builder
setAgeAssuranceUXEnabled(boolean enabled)
Enables or disables the Age Assurance User Experience, which includes an additional privacy-focused tutorial and customized Selfie capture and upload screens. -
-
Method Detail
-
from
SelfieScan.Builder from(SelfieScan existingSelfieScan)
-
setCameraFacing
SelfieScan.Builder setCameraFacing(CameraFacing cameraFacing)
- Parameters:
cameraFacing
- direction that the camera faces.- Returns:
Builder
-
setAssistedOnboardingEnabled
SelfieScan.Builder setAssistedOnboardingEnabled()
Enables assisted onboarding (back-camera-only onboarding). This is equivalent to calling
setCameraFacing(CameraFacing.BACK)
.- Returns:
Builder
-
setLogo
SelfieScan.Builder setLogo(@DrawableRes() int logoResId)
Used to provide a custom logo to supported screens in the Selfie module.
- Parameters:
logoResId
- The resource ID for the Drawable of the desired custom logo.- Returns:
Builder
-
build
SelfieScan build()
-
setShowTutorials
SelfieScan.Builder setShowTutorials(boolean showTutorials)
Show tutorials how to capture selfie before the actual scan. Default value is true.
- Returns:
Builder
-
setWaitForTutorials
SelfieScan.Builder setWaitForTutorials(boolean waitForTutorials)
Hide the continue button in the tutorial screen while tutorial animation is playing, in order to make sure user has seen the video before continuing. Default value is true.
- Returns:
Builder
-
setMode
SelfieScan.Builder setMode(SelfieScan.Mode mode)
Sets the Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK). Default value is ENROLL.
- Parameters:
mode
- Selfie Scan mode (ENROLL, LOGIN or MASK_CHECK)- Returns:
Builder
-
setFaceRecognitionMode
@Deprecated() SelfieScan.Builder setFaceRecognitionMode(SelfieScan.FaceRecognitionMode faceRecognitionMode)
Sets the Face Recognition mode (LOCAL or SERVER). Default value is SERVER.
When mode is ENROLL, Face Recognition mode is always SERVER
When mode is MASK_CHECK, Face Recognition mode is always LOCAL (mask check is always done locally).
-
setLivenessDetectionMode
SelfieScan.Builder setLivenessDetectionMode(SelfieScan.LivenessDetectionMode livenessDetectionMode)
-
setFaceAuthMode
SelfieScan.Builder setFaceAuthMode(SelfieScan.FaceAuthMode mode)
Sets the Face Auth mode (SERVER, LOCAL or HYBRID). Default value is SERVER.
When mode is SERVER, both Face detection and Liveness Detection are performed by the SERVER
When mode is LOCAL, both Face detection and Liveness Detection are performed locally
When mode is HYBRID, Face detection is performed by the SERVER and Liveness Detection is performed locally
-
setAllowFaceAuthModeFallback
SelfieScan.Builder setAllowFaceAuthModeFallback(boolean allowFaceAuthModeFallback)
Specify true if you would want to do a SERVER face login in case LOCAL couldn't be performed due to missing face template on the device. This is applied only to 1:1 Face login.
- Returns:
Builder
-
setBrightnessThreshold
SelfieScan.Builder setBrightnessThreshold(float brightnessThreshold)
Adjust minimum requirements for a well lit face during capture. Increasing the value will be more restrictive and require better lighting conditions, decreasing the value will loosen requirements and allow capturing while being in a darker environment. Set 0 to ignore this setting. 50 by default.
- Returns:
Builder
-
setCustomerToken
@Deprecated() SelfieScan.Builder setCustomerToken(String customerToken)
Sets the customer token to be used for face login feature. This token uniquely identifies a customer in OMNI system and it's returned as a result of approve onboarding API call (e.g server REST API). When customer token is set with this API login works in SERVER mode always. When using Approval module to approve the customer there is no need to call this API to set the customer token, it's already set internally.
- Returns:
Builder
-
setCustomerUUID
SelfieScan.Builder setCustomerUUID(String customerUUID)
Set the ID that uniquely identifies the pre-authorized user who is performing face login. When set, 1:1 login is performed. When this value is null, 1:N login is performed.
- Parameters:
customerUUID
- ID that uniquely identifies the pre-authorized user who is performing face login.- Returns:
Builder
-
setEyesClosedCheckEnabled
SelfieScan.Builder setEyesClosedCheckEnabled(boolean eyesClosedCheckEnabled)
Enables/disables eyes closed check. Default value is enabled. If enabled: - In auto capture mode, all frames where closed eyes are detected are filtered out and not used for further processing. - In manual capture mode, photos where closed eyes are detected are processed but the results are marked for additional review.
- Parameters:
eyesClosedCheckEnabled
- Boolean to indicate if the eyes closed check should be performed locally.- Returns:
Builder
-
setLensesCheckEnabled
SelfieScan.Builder setLensesCheckEnabled(boolean lensesCheckEnabled)
Enables/disables lenses check. Default value is enabled. If enabled: - In auto capture mode, all frames where lenses are detected are filtered out and not used for further processing. - In manual capture mode, photos where lenses are detected are processed but the results are marked for additional review. *
- Parameters:
lensesCheckEnabled
- Boolean to indicate if the lenses check should be performed locally.- Returns:
Builder
-
setMaskCheckEnabled
SelfieScan.Builder setMaskCheckEnabled(boolean maskCheckEnabled)
Specify true to enable local face mask check detection during face capture. Default value is false. If disabled, the Face Mask Check is performed on the server.
- Parameters:
maskCheckEnabled
- Boolean to indicate if the mask check should be performed locally.- Returns:
Builder
-
setBrightnessCheckEnabled
SelfieScan.Builder setBrightnessCheckEnabled(boolean brightnessCheckEnabled)
Specify true to enable brightness check during face capture. Default value is enabled.
- Parameters:
brightnessCheckEnabled
- Set to true to enable brightness check, false otherwise.- Returns:
Builder Returns the updated Builder object with the brightness check configuration.
-
setLogAuthenticationEnabled
SelfieScan.Builder setLogAuthenticationEnabled(boolean logAuthenticationEnabled)
Ensures that all the on-device processing data in HYBRID or LOCAL modes gets sent to the server. Default value is true.
Specify false if you e.g. want to make sure that no network calls are being performed in LOCAL mode. Note that the authentication attempts won't be visible in the dashboard.
- Returns:
Builder
-
setStreamFramesEnabled
SelfieScan.Builder setStreamFramesEnabled(boolean streamFramesEnabled)
Enables or disables video streaming of the [SelfieScan] module. Make sure to include 'com.incode.sdk:video-streaming' in order to use this feature.
Note: This setting is ignored if the device has 2GB of RAM or less.
- Parameters:
streamFramesEnabled
- If true, perform streaming during the Selfie scan.- Returns:
Builder
-
setAutoCaptureTimeout
SelfieScan.Builder setAutoCaptureTimeout(int autoCaptureTimeout)
Sets the selfie auto capture timeout in seconds.
- Parameters:
autoCaptureTimeout
- Auto capture timeout value.
-
setCaptureAttempts
SelfieScan.Builder setCaptureAttempts(int captureAttempts)
Sets the selfie capture attempts.
- Parameters:
captureAttempts
- Capture attempts value.
-
setStreamAudioEnabled
SelfieScan.Builder setStreamAudioEnabled(boolean enabled)
Enables or disables audio during streaming of the [SelfieScan] module.
- Parameters:
enabled
- If true, audio is streamed along with video during Selfie scan.
-
setAgeAssuranceUXEnabled
SelfieScan.Builder setAgeAssuranceUXEnabled(boolean enabled)
Enables or disables the Age Assurance User Experience, which includes an additional privacy-focused tutorial and customized Selfie capture and upload screens.
- Parameters:
enabled
- true to enable the Age Assurance UX, false to disable it.- Returns:
[Builder]
-
-
-
-