Merge "According to the enrolled status to show/hide face unlock results" into rvc-dev am: ec606d6cdf
am: bd27683632
am: 570f8e54f7
am: d208cb29c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11908540 Change-Id: I8c39949c17ce96758779fa806328e00f949b8149
This commit is contained in:
@@ -323,16 +323,18 @@ public class FaceSettings extends DashboardFragment {
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return isAvailable(context);
|
||||
if (isAvailable(context)) {
|
||||
return hasEnrolledBiometrics(context);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
if (isAvailable(context)) {
|
||||
final FaceManager faceManager = context.getSystemService(FaceManager.class);
|
||||
final boolean hasEnrolled = faceManager.hasEnrolledTemplates(
|
||||
UserHandle.myUserId());
|
||||
final boolean hasEnrolled = hasEnrolledBiometrics(context);
|
||||
keys.add(hasEnrolled ? PREF_KEY_ENROLL_FACE_UNLOCK
|
||||
: PREF_KEY_DELETE_FACE_DATA);
|
||||
}
|
||||
@@ -353,5 +355,13 @@ public class FaceSettings extends DashboardFragment {
|
||||
}
|
||||
return isAttentionSupported;
|
||||
}
|
||||
|
||||
private boolean hasEnrolledBiometrics(Context context) {
|
||||
final FaceManager faceManager = Utils.getFaceManagerOrNull(context);
|
||||
if (faceManager != null) {
|
||||
return faceManager.hasEnrolledTemplates(UserHandle.myUserId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user