1/n Start adding Face settings (base, intro)
This change refactors common biometric settings code as well to minimize duplicated code in areas such as: Preference Controller EnrollBase EnrollIntro This change also updates ChooseLock to have Face + Pin/Pattern/Pass Bug: 110589286 Test: Fingerprint settings/enrollment still works Test: make -j56 RunSettingsRoboTests Change-Id: Ie35406a01b85617423beece42683ac086e9bc4a7
This commit is contained in:
@@ -49,6 +49,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.VectorDrawable;
|
||||
import android.hardware.face.FaceManager;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.LinkProperties;
|
||||
@@ -813,6 +814,19 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
return fingerprintManager != null && fingerprintManager.isHardwareDetected();
|
||||
}
|
||||
|
||||
public static FaceManager getFaceManagerOrNull(Context context) {
|
||||
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
|
||||
return (FaceManager) context.getSystemService(Context.FACE_SERVICE);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasFaceHardware(Context context) {
|
||||
FaceManager faceManager = getFaceManagerOrNull(context);
|
||||
return faceManager != null && faceManager.isHardwareDetected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Launches an intent which may optionally have a user id defined.
|
||||
* @param fragment Fragment to use to launch the activity.
|
||||
|
Reference in New Issue
Block a user