ActiveFaceCaptureActivity

This activity is used to scan the user's face using an Active Face Capture session.

Constructors

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
private <Error class: unknown class> binding
Link copied to clipboard
private Camera camera

The camera object

Link copied to clipboard
private ListenableFuture<ProcessCameraProvider> cameraProviderFuture

The camera provider future

Link copied to clipboard

The capture analyzer, which processes frames from the camera

Link copied to clipboard
Link copied to clipboard
public final static String EXTRA_PASSWORD

Intent extra for password

Link copied to clipboard
public final static String EXTRA_QR_CODE_BYTES

Intent extra for QR code data

Link copied to clipboard
public final static String EXTRA_RETURN_IMG_BYTES

Intent extra to tell the activity to just return the image bytes

Link copied to clipboard
private ImageView ivBack

The back button

Link copied to clipboard

The number of completed actions

Link copied to clipboard
private View rootView

The root view of the activity

Link copied to clipboard
private ActiveFaceCaptureSession session

The active face capture session

Link copied to clipboard

The vibrator service

Functions

Link copied to clipboard
private final Unit bindPreview(ProcessCameraProvider cameraProvider)

This method is used to bind the camera preview and make the capture analyzer process the frames from the camera. When called, this method will also create a new session and reset the UI. Any exception from the SDK will be caught and shown in the UI.

Link copied to clipboard
private final Unit checkFaceLiveness()

Called for an on device liveness check after the face capture session is complete

Link copied to clipboard
private final <Error class: unknown class> getBinding()
Link copied to clipboard
private final Camera getCamera()

The camera object

Link copied to clipboard
private final ListenableFuture<ProcessCameraProvider> getCameraProviderFuture()

The camera provider future

Link copied to clipboard

The capture analyzer, which processes frames from the camera

Link copied to clipboard
private final ImageView getIvBack()

The back button

Link copied to clipboard
private final UByte getNumCompletedActions()

The number of completed actions

Link copied to clipboard
private final View getRootView()

The root view of the activity

Link copied to clipboard
private final ActiveFaceCaptureSession getSession()

The active face capture session

Link copied to clipboard
private final Vibrator getVibrator()

The vibrator service

Link copied to clipboard
protected Unit onCreate(Bundle savedInstanceState)
Link copied to clipboard
private final Unit onFaceCaptureCompleted()

Move to the next activity when the face capture session is complete

Link copied to clipboard

Called when the first frame is captured.

Link copied to clipboard
protected Unit onPause()
Link copied to clipboard
public Unit onProcessingError(SenseCryptSdkException exception)

Called when there is an error while processing a frame

Link copied to clipboard
public Unit onProcessingResultAvailable(ActiveFaceCaptureProcessingResult result)

Called when a processing result is available for a camera frame

Link copied to clipboard
protected Unit onResume()
Link copied to clipboard
private final Unit resetSession()

Reset the session

Link copied to clipboard
private final Unit resetUI()

Reset the UI to initial state

Link copied to clipboard
private final Unit setBinding(<Error class: unknown class> binding)
Link copied to clipboard
private final Unit setCamera(Camera camera)

The camera object

Link copied to clipboard
private final Unit setCameraProviderFuture(ListenableFuture<ProcessCameraProvider> cameraProviderFuture)

The camera provider future

Link copied to clipboard
private final Unit setCaptureAnalyzer(ActiveFaceCaptureAnalyzer captureAnalyzer)

The capture analyzer, which processes frames from the camera

Link copied to clipboard
private final Unit setIvBack(ImageView ivBack)

The back button

Link copied to clipboard
private final Unit setNumCompletedActions(UByte numCompletedActions)

The number of completed actions

Link copied to clipboard
private final Unit setRootView(View rootView)

The root view of the activity

Link copied to clipboard
private final Unit setSession(ActiveFaceCaptureSession session)

The active face capture session

Link copied to clipboard
private final Unit setupComponents()

This method is used to set up the components in this activity.

Link copied to clipboard
private final Unit setUpListeners()

This method is used to set up the listeners for the components in this activity.

Link copied to clipboard
private final Unit setVibrator(Vibrator vibrator)

The vibrator service

Link copied to clipboard
private final Unit showErrorDialog(SenseCryptSdkException error)

Show an error dialog to the user. It handles SenseCryptSdkException.LivenessFailed, SenseCryptSdkException.ExtremeHeadPoseDetected, and SenseCryptSdkException.CaptureSessionTimeOut via the UIHelper methods. It also handles unrecoverable errors via the UIHelper.processUnrecoverableError method. For recoverable errors, it shows a dialog using the showRecoverableErrorDialog method.

Link copied to clipboard
private final Unit showErrorInUIThread(SenseCryptSdkException error)

This method is used to show an error dialog in the UI thread. It ensures that the error dialog is shown on the main thread.

Link copied to clipboard

Show a dialog for a recoverable error

Link copied to clipboard
private final Unit startCamera()

This method is used to start the camera preview.

Link copied to clipboard
private final Unit updateAnimations(ActiveFaceCaptureStateName activeFaceCaptureState, ActiveFaceCaptureProcessingResult result)

Update animations based on the session state

Link copied to clipboard
private final Unit updateCircleColor(ActiveFaceCaptureStateName activeFaceCaptureState, ActiveFaceCaptureProcessingResult result)

Update circle color (the circle around the face) based on the Active Face Capture session state

Link copied to clipboard
private final Unit updateInstructions(ActiveFaceCaptureStateName activeFaceCaptureState, ActiveFaceCaptureProcessingResult result)

Update instructions based on the Active Face Capture State

Link copied to clipboard
private final Unit updateProgressTicks(ActiveFaceCaptureProcessingResult result)

Update progress ticks based on the number of completed actions

Link copied to clipboard
private final Unit updateUI(ActiveFaceCaptureProcessingResult result)

Update UI based on a processing result

Link copied to clipboard
private final Unit vibrate()

This method is used to vibrate the phone for haptic feedback when the user completes an action.