Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void eyeTracking(FirebaseVisionFace face){
- final boolean right_eye = face.getRightEyeOpenProbability() < 0.5;
- final boolean left_eye = face.getLeftEyeOpenProbability() < 0.5;
- final long start = System.currentTimeMillis();
- Log.d(TAG, "TimeA: " + start);
- if (right_eye && left_eye) {
- new CountDownTimer(5000, 1000) {
- public void onTick(long millisUntilFinished) {
- }
- public void onFinish() {
- long end = System.currentTimeMillis();
- Log.d(TAG, "TimeB: " + end);
- if(end - start >= 5000){
- if (right_eye && left_eye) {
- alertBox();
- }
- }
- }
- }.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement