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);
}
}
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;
}
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);
}
}
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));
}
}
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();
}
Aggregations