Merge "Fix Settings search crashed."

This commit is contained in:
Stanley Wang
2020-01-07 01:03:44 +00:00
committed by Android (Google) Code Review

View File

@@ -329,10 +329,13 @@ public class FaceSettings extends DashboardFragment {
@Override
public List<String> getNonIndexableKeys(Context context) {
final List<String> keys = super.getNonIndexableKeys(context);
final FaceManager faceManager = context.getSystemService(FaceManager.class);
final boolean hasEnrolled = faceManager.hasEnrolledTemplates(
UserHandle.myUserId());
keys.add(hasEnrolled ? PREF_KEY_ENROLL_FACE_UNLOCK : PREF_KEY_DELETE_FACE_DATA);
if (isAvailable(context)) {
final FaceManager faceManager = context.getSystemService(FaceManager.class);
final boolean hasEnrolled = faceManager.hasEnrolledTemplates(
UserHandle.myUserId());
keys.add(hasEnrolled ? PREF_KEY_ENROLL_FACE_UNLOCK
: PREF_KEY_DELETE_FACE_DATA);
}
return keys;
}
};