Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 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 | */ |
Kevin Chyn | a56dff7 | 2018-06-19 18:41:12 -0700 | [diff] [blame] | 28 | public final class Face extends BiometricAuthenticator.Identifier { |
Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 29 | |
| 30 | public Face(CharSequence name, int faceId, long deviceId) { |
Kevin Chyn | b528d69 | 2018-07-20 11:53:14 -0700 | [diff] [blame] | 31 | super(name, faceId, deviceId); |
Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | private Face(Parcel in) { |
Kevin Chyn | b528d69 | 2018-07-20 11:53:14 -0700 | [diff] [blame] | 35 | super(in.readString(), in.readInt(), in.readLong()); |
Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 36 | } |
| 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 Chyn | b528d69 | 2018-07-20 11:53:14 -0700 | [diff] [blame] | 52 | out.writeString(getName().toString()); |
| 53 | out.writeInt(getBiometricId()); |
| 54 | out.writeLong(getDeviceId()); |
Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 55 | } |
| 56 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 57 | public static final @android.annotation.NonNull Parcelable.Creator<Face> CREATOR = new Parcelable.Creator<Face>() { |
Gilad Bretter | cb51b8b | 2018-03-22 17:04:51 +0200 | [diff] [blame] | 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 | } |