Search in sources :

Example 16 with Fingerprint

use of android.hardware.fingerprint.Fingerprint in project platform_frameworks_base by android.

the class FingerprintsUserState method getCopy.

private ArrayList<Fingerprint> getCopy(ArrayList<Fingerprint> array) {
    ArrayList<Fingerprint> result = new ArrayList<Fingerprint>(array.size());
    for (int i = 0; i < array.size(); i++) {
        Fingerprint fp = array.get(i);
        result.add(new Fingerprint(fp.getName(), fp.getGroupId(), fp.getFingerId(), fp.getDeviceId()));
    }
    return result;
}
Also used : Fingerprint(android.hardware.fingerprint.Fingerprint) ArrayList(java.util.ArrayList) Fingerprint(android.hardware.fingerprint.Fingerprint)

Example 17 with Fingerprint

use of android.hardware.fingerprint.Fingerprint in project platform_frameworks_base by android.

the class FingerprintsUserState method getUniqueName.

/**
     * Finds a unique name for the given fingerprint
     * @return unique name
     */
private String getUniqueName() {
    int guess = 1;
    while (true) {
        // Not the most efficient algorithm in the world, but there shouldn't be more than 10
        String name = mCtx.getString(com.android.internal.R.string.fingerprint_name_template, guess);
        if (isUnique(name)) {
            return name;
        }
        guess++;
    }
}
Also used : Fingerprint(android.hardware.fingerprint.Fingerprint)

Example 18 with Fingerprint

use of android.hardware.fingerprint.Fingerprint in project platform_frameworks_base by android.

the class FingerprintsUserState method renameFingerprint.

public void renameFingerprint(int fingerId, CharSequence name) {
    synchronized (this) {
        for (int i = 0; i < mFingerprints.size(); i++) {
            if (mFingerprints.get(i).getFingerId() == fingerId) {
                Fingerprint old = mFingerprints.get(i);
                mFingerprints.set(i, new Fingerprint(name, old.getGroupId(), old.getFingerId(), old.getDeviceId()));
                scheduleWriteStateLocked();
                break;
            }
        }
    }
}
Also used : Fingerprint(android.hardware.fingerprint.Fingerprint) Fingerprint(android.hardware.fingerprint.Fingerprint)

Example 19 with Fingerprint

use of android.hardware.fingerprint.Fingerprint in project android_frameworks_base by crdroidandroid.

the class FingerprintsUserState method renameFingerprint.

public void renameFingerprint(int fingerId, CharSequence name) {
    synchronized (this) {
        for (int i = 0; i < mFingerprints.size(); i++) {
            if (mFingerprints.get(i).getFingerId() == fingerId) {
                Fingerprint old = mFingerprints.get(i);
                mFingerprints.set(i, new Fingerprint(name, old.getGroupId(), old.getFingerId(), old.getDeviceId()));
                scheduleWriteStateLocked();
                break;
            }
        }
    }
}
Also used : Fingerprint(android.hardware.fingerprint.Fingerprint) Fingerprint(android.hardware.fingerprint.Fingerprint)

Example 20 with Fingerprint

use of android.hardware.fingerprint.Fingerprint in project android_frameworks_base by crdroidandroid.

the class FingerprintsUserState method getCopy.

private ArrayList<Fingerprint> getCopy(ArrayList<Fingerprint> array) {
    ArrayList<Fingerprint> result = new ArrayList<Fingerprint>(array.size());
    for (int i = 0; i < array.size(); i++) {
        Fingerprint fp = array.get(i);
        result.add(new Fingerprint(fp.getName(), fp.getGroupId(), fp.getFingerId(), fp.getDeviceId()));
    }
    return result;
}
Also used : Fingerprint(android.hardware.fingerprint.Fingerprint) ArrayList(java.util.ArrayList) Fingerprint(android.hardware.fingerprint.Fingerprint)

Aggregations

Fingerprint (android.hardware.fingerprint.Fingerprint)55 Context (android.content.Context)7 Intent (android.content.Intent)7 FingerprintManager (android.hardware.fingerprint.FingerprintManager)7 UserManager (android.os.UserManager)7 Preference (android.support.v7.preference.Preference)7 OnPreferenceClickListener (android.support.v7.preference.Preference.OnPreferenceClickListener)7 SpannableString (android.text.SpannableString)7 TextPaint (android.text.TextPaint)7 RemoteException (android.os.RemoteException)6 TwoTargetPreference (com.android.settingslib.TwoTargetPreference)6 FooterPreference (com.android.settingslib.widget.FooterPreference)6 UserInfo (android.content.pm.UserInfo)5 IFingerprintServiceReceiver (android.hardware.fingerprint.IFingerprintServiceReceiver)5 AtomicFile (android.util.AtomicFile)5 FileOutputStream (java.io.FileOutputStream)5 ArrayList (java.util.ArrayList)5 JSONArray (org.json.JSONArray)5 JSONException (org.json.JSONException)5 JSONObject (org.json.JSONObject)5