1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.hardware.face;
18 
19 import android.annotation.IntDef;
20 
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 
24 /**
25  * A collection of constants representing different stages of face enrollment.
26  *
27  * @hide
28  */
29 public final class FaceEnrollStages {
30     // Prevent instantiation.
FaceEnrollStages()31     private FaceEnrollStages() {}
32 
33     /**
34      * A stage that may occur during face enrollment.
35      *
36      * @hide
37      */
38     @IntDef({
39         UNKNOWN,
40         FIRST_FRAME_RECEIVED,
41         WAITING_FOR_CENTERING,
42         HOLD_STILL_IN_CENTER,
43         ENROLLING_MOVEMENT_1,
44         ENROLLING_MOVEMENT_2,
45         ENROLLMENT_FINISHED
46     })
47     @Retention(RetentionPolicy.SOURCE)
48     public @interface FaceEnrollStage {}
49 
50     /**
51      * The current enrollment stage is not known.
52      */
53     public static final int UNKNOWN = 0;
54 
55     /**
56      * Enrollment has just begun. No action is needed from the user yet.
57      */
58     public static final int FIRST_FRAME_RECEIVED = 1;
59 
60     /**
61      * The user must center their face in the frame.
62      */
63     public static final int WAITING_FOR_CENTERING = 2;
64 
65     /**
66      * The user must keep their face centered in the frame.
67      */
68     public static final int HOLD_STILL_IN_CENTER = 3;
69 
70     /**
71      * The user must follow a first set of movement instructions.
72      */
73     public static final int ENROLLING_MOVEMENT_1 = 4;
74 
75     /**
76      * The user must follow a second set of movement instructions.
77      */
78     public static final int ENROLLING_MOVEMENT_2 = 5;
79 
80     /**
81      * Enrollment has completed. No more action is needed from the user.
82      */
83     public static final int ENROLLMENT_FINISHED = 6;
84 }
85