Move to Android N-MR1 SDK.
[android_tools.git] / sdk / sources / android-25 / android / hardware / fingerprint / Fingerprint.java
blobc30763475fa82275d16f12a60c908adb13189dff
1 /*
2 * Copyright (C) 2015 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package android.hardware.fingerprint;
18 import android.os.Parcel;
19 import android.os.Parcelable;
21 /**
22 * Container for fingerprint metadata.
23 * @hide
25 public final class Fingerprint implements Parcelable {
26 private CharSequence mName;
27 private int mGroupId;
28 private int mFingerId;
29 private long mDeviceId; // physical device this is associated with
31 public Fingerprint(CharSequence name, int groupId, int fingerId, long deviceId) {
32 mName = name;
33 mGroupId = groupId;
34 mFingerId = fingerId;
35 mDeviceId = deviceId;
38 private Fingerprint(Parcel in) {
39 mName = in.readString();
40 mGroupId = in.readInt();
41 mFingerId = in.readInt();
42 mDeviceId = in.readLong();
45 /**
46 * Gets the human-readable name for the given fingerprint.
47 * @return name given to finger
49 public CharSequence getName() { return mName; }
51 /**
52 * Gets the device-specific finger id. Used by Settings to map a name to a specific
53 * fingerprint template.
54 * @return device-specific id for this finger
55 * @hide
57 public int getFingerId() { return mFingerId; }
59 /**
60 * Gets the group id specified when the fingerprint was enrolled.
61 * @return group id for the set of fingerprints this one belongs to.
62 * @hide
64 public int getGroupId() { return mGroupId; }
66 /**
67 * Device this fingerprint belongs to.
68 * @hide
70 public long getDeviceId() { return mDeviceId; }
72 public int describeContents() {
73 return 0;
76 public void writeToParcel(Parcel out, int flags) {
77 out.writeString(mName.toString());
78 out.writeInt(mGroupId);
79 out.writeInt(mFingerId);
80 out.writeLong(mDeviceId);
83 public static final Parcelable.Creator<Fingerprint> CREATOR
84 = new Parcelable.Creator<Fingerprint>() {
85 public Fingerprint createFromParcel(Parcel in) {
86 return new Fingerprint(in);
89 public Fingerprint[] newArray(int size) {
90 return new Fingerprint[size];