Skip to content

Commit a7fa3ea

Browse files
authored
fix(liveness): Remove End Timeout (#129)
1 parent 58e8d3f commit a7fa3ea

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ import com.amplifyframework.ui.liveness.model.LivenessCheckState
4646
import com.amplifyframework.ui.liveness.state.LivenessState
4747
import com.amplifyframework.ui.liveness.util.WebSocketCloseCode
4848
import java.util.Date
49-
import java.util.Timer
5049
import java.util.concurrent.Executors
51-
import kotlin.concurrent.schedule
5250
import kotlin.coroutines.resume
5351
import kotlin.coroutines.suspendCoroutine
5452
import kotlinx.coroutines.MainScope
@@ -253,18 +251,6 @@ internal class LivenessCoordinator(
253251
}
254252

255253
private fun processFinalEventsSent() {
256-
// Timeout if the disconnect event isn't received (onComplete isn't invoked) within the time limit
257-
Timer().schedule(DISCONNECT_EVENT_TIMEOUT_MS) {
258-
if (!disconnectEventReceived) {
259-
val timeoutError =
260-
FaceLivenessDetectionException.SessionTimedOutException(
261-
"Session timed out. Did not receive final response from server within " +
262-
"time limit."
263-
)
264-
processSessionError(timeoutError, true)
265-
}
266-
cancel()
267-
}
268254
unbindCamera(context)
269255
}
270256

@@ -309,6 +295,5 @@ internal class LivenessCoordinator(
309295
const val TARGET_ENCODE_BITRATE = (1024 * 1024 * .6).toInt()
310296
const val TARGET_ENCODE_KEYFRAME_INTERVAL = 1 // webm muxer only flushes to file on keyframe
311297
val TARGET_RESOLUTION_SIZE = Size(TARGET_WIDTH, TARGET_HEIGHT)
312-
const val DISCONNECT_EVENT_TIMEOUT_MS: Long = 8000
313298
}
314299
}

0 commit comments

Comments
 (0)