Search in sources :

Example 36 with FingerprintManager

use of android.hardware.fingerprint.FingerprintManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class TopLevelSecurityEntryPreferenceController method getSummary.

@Override
public CharSequence getSummary() {
    final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(mContext);
    final FaceManager faceManager = Utils.getFaceManagerOrNull(mContext);
    if (faceManager != null && faceManager.isHardwareDetected()) {
        return mContext.getText(R.string.security_dashboard_summary_face);
    } else if (fpm != null && fpm.isHardwareDetected()) {
        return mContext.getText(R.string.security_dashboard_summary);
    } else {
        return mContext.getText(R.string.security_dashboard_summary_no_fingerprint);
    }
}
Also used : FingerprintManager(android.hardware.fingerprint.FingerprintManager) FaceManager(android.hardware.face.FaceManager)

Example 37 with FingerprintManager

use of android.hardware.fingerprint.FingerprintManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SetupFingerprintEnrollIntroduction method setFingerprintCount.

private Intent setFingerprintCount(Intent data) {
    if (data == null) {
        data = new Intent();
    }
    final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
    if (fpm != null) {
        int enrolled = fpm.getEnrolledFingerprints(mUserId).size();
        data.putExtra(EXTRA_FINGERPRINT_ENROLLED_COUNT, enrolled);
    }
    return data;
}
Also used : FingerprintManager(android.hardware.fingerprint.FingerprintManager) Intent(android.content.Intent)

Example 38 with FingerprintManager

use of android.hardware.fingerprint.FingerprintManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class FingerprintEnrollFinish method onResume.

@Override
protected void onResume() {
    super.onResume();
    FooterButton addButton = mFooterBarMixin.getSecondaryButton();
    final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
    boolean hideAddAnother = false;
    if (fpm != null) {
        int enrolled = fpm.getEnrolledFingerprints(mUserId).size();
        int max = getResources().getInteger(com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
        hideAddAnother = enrolled >= max;
    }
    if (hideAddAnother) {
        // Don't show "Add" button if too many fingerprints already added
        addButton.setVisibility(View.INVISIBLE);
    } else {
        addButton.setOnClickListener(this::onAddAnotherButtonClick);
    }
}
Also used : FooterButton(com.google.android.setupcompat.template.FooterButton) FingerprintManager(android.hardware.fingerprint.FingerprintManager)

Example 39 with FingerprintManager

use of android.hardware.fingerprint.FingerprintManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class FingerprintEnrollFinish method updateFingerprintSuggestionEnableState.

private void updateFingerprintSuggestionEnableState() {
    final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
    if (fpm != null) {
        int enrolled = fpm.getEnrolledFingerprints(mUserId).size();
        // Only show "Add another fingerprint" if the user already enrolled one.
        // "Add fingerprint" will be shown in the main flow if the user hasn't enrolled any
        // fingerprints. If the user already added more than one fingerprint, they already know
        // to add multiple fingerprints so we don't show the suggestion.
        int flag = (enrolled == 1) ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
        ComponentName componentName = new ComponentName(getApplicationContext(), FINGERPRINT_SUGGESTION_ACTIVITY);
        getPackageManager().setComponentEnabledSetting(componentName, flag, PackageManager.DONT_KILL_APP);
        Log.d(TAG, FINGERPRINT_SUGGESTION_ACTIVITY + " enabled state = " + (enrolled == 1));
    }
}
Also used : FingerprintManager(android.hardware.fingerprint.FingerprintManager) ComponentName(android.content.ComponentName)

Example 40 with FingerprintManager

use of android.hardware.fingerprint.FingerprintManager in project android_packages_apps_crDroidSettings by crdroidandroid.

the class DeviceUtils method hasUDFPS.

/**
 * Checks if the device has udfps
 * @param context context for getting FingerprintManager
 * @return true is udfps is present
 */
public static boolean hasUDFPS(Context context) {
    final FingerprintManager fingerprintManager = context.getSystemService(FingerprintManager.class);
    final List<FingerprintSensorPropertiesInternal> props = fingerprintManager.getSensorPropertiesInternal();
    return props != null && props.size() == 1 && props.get(0).isAnyUdfpsType();
}
Also used : FingerprintSensorPropertiesInternal(android.hardware.fingerprint.FingerprintSensorPropertiesInternal) FingerprintManager(android.hardware.fingerprint.FingerprintManager)

Aggregations

FingerprintManager (android.hardware.fingerprint.FingerprintManager)82 Test (org.junit.Test)18 Intent (android.content.Intent)11 ComponentName (android.content.ComponentName)8 Button (android.widget.Button)8 KeyguardManager (android.app.KeyguardManager)7 Context (android.content.Context)7 Fingerprint (android.hardware.fingerprint.Fingerprint)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 LockPatternUtils (com.android.internal.widget.LockPatternUtils)7 FingerprintEnrollSuggestionActivity (com.android.settings.Settings.FingerprintEnrollSuggestionActivity)6 FingerprintSuggestionActivity (com.android.settings.fingerprint.FingerprintSuggestionActivity)6 WallpaperSuggestionActivity (com.android.settings.wallpaper.WallpaperSuggestionActivity)6 TwoTargetPreference (com.android.settingslib.TwoTargetPreference)6 FooterPreference (com.android.settingslib.widget.FooterPreference)6 FaceManager (android.hardware.face.FaceManager)5