blob: 57e52d9874748df026ed6dbdfac22457f7042eb9 [file] [log] [blame]
Jim Miller9f0753f2015-03-23 23:59:22 -07001/*
2 * Copyright (C) 2015 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 */
Jim Millerebbf2052015-03-31 17:24:34 -070016package android.hardware.fingerprint;
Jim Miller9f0753f2015-03-23 23:59:22 -070017
Kevin Chyn66682562018-01-25 18:26:46 -080018import android.hardware.biometrics.BiometricAuthenticator;
Jim Miller9f0753f2015-03-23 23:59:22 -070019import android.os.Parcel;
20import android.os.Parcelable;
21
22/**
23 * Container for fingerprint metadata.
24 * @hide
25 */
Kevin Chyna56dff72018-06-19 18:41:12 -070026public final class Fingerprint extends BiometricAuthenticator.Identifier {
Jim Miller9f0753f2015-03-23 23:59:22 -070027 private int mGroupId;
Jim Miller9f0753f2015-03-23 23:59:22 -070028
29 public Fingerprint(CharSequence name, int groupId, int fingerId, long deviceId) {
Kevin Chyna56dff72018-06-19 18:41:12 -070030 super(name, fingerId, deviceId);
Jim Miller9f0753f2015-03-23 23:59:22 -070031 mGroupId = groupId;
Jim Miller9f0753f2015-03-23 23:59:22 -070032 }
33
34 private Fingerprint(Parcel in) {
Kevin Chyna56dff72018-06-19 18:41:12 -070035 super(in.readString(), in.readInt(), in.readLong());
Jim Miller9f0753f2015-03-23 23:59:22 -070036 mGroupId = in.readInt();
Jim Miller9f0753f2015-03-23 23:59:22 -070037 }
38
39 /**
Jim Miller9f0753f2015-03-23 23:59:22 -070040 * Gets the group id specified when the fingerprint was enrolled.
41 * @return group id for the set of fingerprints this one belongs to.
Jim Miller9f0753f2015-03-23 23:59:22 -070042 */
Kevin Chyna56dff72018-06-19 18:41:12 -070043 public int getGroupId() {
44 return mGroupId;
45 }
Jim Miller9f0753f2015-03-23 23:59:22 -070046
47 public int describeContents() {
48 return 0;
49 }
50
51 public void writeToParcel(Parcel out, int flags) {
Kevin Chyna56dff72018-06-19 18:41:12 -070052 out.writeString(getName().toString());
53 out.writeInt(getBiometricId());
54 out.writeLong(getDeviceId());
Jim Miller9f0753f2015-03-23 23:59:22 -070055 out.writeInt(mGroupId);
Jim Miller9f0753f2015-03-23 23:59:22 -070056 }
57
Jeff Sharkey9e8f83d2019-02-28 12:06:45 -070058 public static final @android.annotation.NonNull Parcelable.Creator<Fingerprint> CREATOR
Jim Miller9f0753f2015-03-23 23:59:22 -070059 = new Parcelable.Creator<Fingerprint>() {
60 public Fingerprint createFromParcel(Parcel in) {
61 return new Fingerprint(in);
62 }
63
64 public Fingerprint[] newArray(int size) {
65 return new Fingerprint[size];
66 }
67 };
68};