Skip to content

Commit f6e6dcb

Browse files
tjleingThomas Leingtylerjroach
authored
fix(liveness): Use server facematch timeout (#74)
Co-authored-by: Thomas Leing <leint@amazon.com> Co-authored-by: Tyler Roach <tjroach@amazon.com>
1 parent ea5a554 commit f6e6dcb

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

liveness/src/main/java/com/amplifyframework/ui/liveness/camera/LivenessCoordinator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ internal class LivenessCoordinator(
294294
const val TARGET_ENCODE_BITRATE = (1024 * 1024 * .6).toInt()
295295
const val TARGET_ENCODE_KEYFRAME_INTERVAL = 1 // webm muxer only flushes to file on keyframe
296296
val TARGET_RESOLUTION_SIZE = Size(TARGET_WIDTH, TARGET_HEIGHT)
297-
const val FACE_OVAL_MATCH_TIMEOUT_MS: Long = 7000
298297
const val DISCONNECT_EVENT_TIMEOUT_MS: Long = 8000
299298
}
300299
}

liveness/src/main/java/com/amplifyframework/ui/liveness/state/LivenessState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ internal data class LivenessState(
263263
// the oval after a period of time
264264
if (!detectedFaceMatchedOval && !faceOvalMatchTimerStarted) {
265265
faceOvalMatchTimerStarted = true
266-
Timer().schedule(LivenessCoordinator.FACE_OVAL_MATCH_TIMEOUT_MS) {
266+
Timer().schedule(faceTargetChallenge!!.faceTargetMatching.ovalFitTimeout.toLong()) {
267267
if (!detectedFaceMatchedOval && faceGuideRect != null) {
268268
readyForOval = false
269269
val timeoutError =

liveness/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<string name="amplify_ui_liveness_get_ready_a11y_wrong_face_fit_icon_content_description">Face does not fill the oval</string>
3030
<string name="amplify_ui_liveness_get_ready_good_fit">Good fit</string>
3131
<string name="amplify_ui_liveness_get_ready_too_far">Too far</string>
32-
<string name="amplify_ui_liveness_get_ready_step_1">When an oval appears, fill the oval with your face within 7 seconds.</string>
32+
<string name="amplify_ui_liveness_get_ready_step_1">When an oval appears, follow the instructions to fit your face in it.</string>
3333
<string name="amplify_ui_liveness_get_ready_step_2">Make sure your face is not covered with sunglasses or a mask.</string>
3434
<string name="amplify_ui_liveness_get_ready_step_3">Move to a well-lit place that is not in direct sunlight.</string>
3535
<string name="amplify_ui_liveness_get_ready_begin_check">Begin check</string>

samples/liveness/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<string name="error_camera_permission_denied_title">Camera permission not granted</string>
3333
<string name="error_camera_permission_denied_message">Camera permission required to perform check</string>
3434
<string name="error_timed_out_title">Time out</string>
35-
<string name="error_timed_out_face_fit_message">Face did not fill oval within time limit. Try again and completely fill oval with face within 7 seconds.</string>
35+
<string name="error_timed_out_face_fit_message">Face did not fill oval within time limit. Try again and completely fill oval with face within it.</string>
3636
<string name="error_timed_out_session_message">Session timed out. Try again.</string>
3737
<string name="error_failure_during_countdown_title">"Check failed during countdown"</string>
3838
<string name="error_failure_during_countdown_message">Avoid moving closer during countdown and ensure only one face is in front of camera.</string>

0 commit comments

Comments
 (0)