1 /*
2  * Copyright (C) 2018 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.hardware.biometrics.BiometricAuthenticator;
20 import android.os.Parcel;
21 import android.os.Parcelable;
22 
23 /**
24  * Container for face metadata.
25  *
26  * @hide
27  */
28 public final class Face extends BiometricAuthenticator.Identifier {
29 
Face(CharSequence name, int faceId, long deviceId)30     public Face(CharSequence name, int faceId, long deviceId) {
31         super(name, faceId, deviceId);
32     }
33 
Face(Parcel in)34     private Face(Parcel in) {
35         super(in.readString(), in.readInt(), in.readLong());
36     }
37 
38     /**
39      * Describes the contents.
40      * @return
41      */
describeContents()42     public int describeContents() {
43         return 0;
44     }
45 
46     /**
47      * Writes to a parcel.
48      * @param out
49      * @param flags Additional flags about how the object should be written.
50      */
writeToParcel(Parcel out, int flags)51     public void writeToParcel(Parcel out, int flags) {
52         out.writeString(getName().toString());
53         out.writeInt(getBiometricId());
54         out.writeLong(getDeviceId());
55     }
56 
57     public static final @android.annotation.NonNull Parcelable.Creator<Face> CREATOR = new Parcelable.Creator<Face>() {
58             public Face createFromParcel(Parcel in) {
59                 return new Face(in);
60             }
61 
62             public Face[] newArray(int size) {
63                 return new Face[size];
64             }
65     };
66 }
67