blob: b90fafe928107da4770053d6956390d20be68ff4 [file] [log] [blame]
Gilad Brettercb51b8b2018-03-22 17:04:51 +02001/*
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
17package android.hardware.face;
18
19import android.hardware.biometrics.BiometricAuthenticator;
20import android.os.Parcel;
21import android.os.Parcelable;
22
23/**
24 * Container for face metadata.
25 *
26 * @hide
27 */
Kevin Chyna56dff72018-06-19 18:41:12 -070028public final class Face extends BiometricAuthenticator.Identifier {
Gilad Brettercb51b8b2018-03-22 17:04:51 +020029
30 public Face(CharSequence name, int faceId, long deviceId) {
Kevin Chynb528d692018-07-20 11:53:14 -070031 super(name, faceId, deviceId);
Gilad Brettercb51b8b2018-03-22 17:04:51 +020032 }
33
34 private Face(Parcel in) {
Kevin Chynb528d692018-07-20 11:53:14 -070035 super(in.readString(), in.readInt(), in.readLong());
Gilad Brettercb51b8b2018-03-22 17:04:51 +020036 }
37
38 /**
39 * Describes the contents.
40 * @return
41 */
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 */
51 public void writeToParcel(Parcel out, int flags) {
Kevin Chynb528d692018-07-20 11:53:14 -070052 out.writeString(getName().toString());
53 out.writeInt(getBiometricId());
54 out.writeLong(getDeviceId());
Gilad Brettercb51b8b2018-03-22 17:04:51 +020055 }
56
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -070057 public static final @android.annotation.NonNull Parcelable.Creator<Face> CREATOR = new Parcelable.Creator<Face>() {
Gilad Brettercb51b8b2018-03-22 17:04:51 +020058 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}