Skip to content

Commit

Permalink
[2/2] Allow using face as auth method for apps
Browse files Browse the repository at this point in the history
Change-Id: Ib259d1f020f9ac29a9d85ae7edba55a2b2daa101
  • Loading branch information
jhenrique09 authored and Rpingat committed Jun 15, 2021
1 parent 07f23a5 commit b06b6bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
3 changes: 1 addition & 2 deletions res/values/wave_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@
<string name="anbi_title">Accidental touch</string>
<string name="anbi_summary">Prevent interaction with navigation buttons while the screen is being touched</string>

<string name="security_settings_face_settings_footer_custom">Face unlock lets you unlock your device by looking at it. Keep in mind:\n\n▒^w^o Your device may unlock any time you look at it.\n▒^w^o Your dev>
<string name="security_settings_face_settings_remove_dialog_details_custom">Data recorded by face unlock will be permanently and securely deleted. After removal, you will need your PIN, pattern, or passwor>
<!-- Face Unlock -->
<string name="security_settings_face_unlock_redo_face_scan_summary">Remove existing face scan and create a new scan</string>
<string name="security_settings_face_unlock_redo_face_scan_title">Redo face scan</string>
<string name="security_dashboard_summary_face_and_fingerprint">Screen lock, fingerprint, face unlock</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

import com.android.settings.Utils;

import com.android.settings.custom.biometrics.FaceUtils;

/**
* Preference controller for Face settings page controlling the ability to use
* Face authentication in apps (through BiometricPrompt).
Expand Down Expand Up @@ -80,10 +78,6 @@ public void updateState(Preference preference) {

@Override
public int getAvailabilityStatus() {
if (FaceUtils.isFaceUnlockSupported()){
return UNSUPPORTED_ON_DEVICE;
}

if(mFaceManager == null){
return AVAILABLE_UNSEARCHABLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import com.android.settingslib.HelpUtils;
import com.android.settingslib.widget.FooterPreference;

import com.android.settings.custom.biometrics.FaceUtils;

/**
* Footer for face settings showing the help text and help link.
*/
Expand Down Expand Up @@ -62,14 +60,10 @@ public void updateState(Preference preference) {
final AnnotationSpan.LinkInfo linkInfo =
new AnnotationSpan.LinkInfo(mContext, ANNOTATION_URL, helpIntent);

final int footerRes;
if (FaceUtils.isFaceUnlockSupported()) {
footerRes = R.string.security_settings_face_settings_footer_custom;
} else if (mProvider.isAttentionSupported(mContext)) {
footerRes = R.string.security_settings_face_settings_footer;
} else {
footerRes = R.string.security_settings_face_settings_footer_attention_not_supported;
}
final int footerRes = mProvider.isAttentionSupported(mContext)
? R.string.security_settings_face_settings_footer
: R.string.security_settings_face_settings_footer_attention_not_supported;

preference.setTitle(AnnotationSpan.linkify(
mContext.getText(footerRes), linkInfo));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

import java.util.List;

import com.android.settings.custom.biometrics.FaceUtils;

/**
* Controller for the remove button. This assumes that there is only a single face enrolled. The UI
* will likely change if multiple enrollments are allowed/supported.
Expand All @@ -64,13 +62,8 @@ public int getMetricsCategory() {
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

int dialogMessage = R.string.security_settings_face_settings_remove_dialog_details;
if (FaceUtils.isFaceUnlockSupported()) {
dialogMessage = R.string.security_settings_face_settings_remove_dialog_details_custom;
}

builder.setTitle(R.string.security_settings_face_settings_remove_dialog_title)
.setMessage(dialogMessage)
.setMessage(R.string.security_settings_face_settings_remove_dialog_details)
.setPositiveButton(R.string.delete, mOnClickListener)
.setNegativeButton(R.string.cancel, mOnClickListener);
AlertDialog dialog = builder.create();
Expand Down

0 comments on commit b06b6bb

Please sign in to comment.