Add "eyes open" setting message to face enroll intro

Adds an additional message about the "Require eyes to be open" setting
for Face Unlock to the intro/consent screen of enrollment, gated by a
config flag.

Test: Manual

Bug: 192272785
Change-Id: Idcd2395a290b74f4578898fdfebd05b81cd74075
This commit is contained in:
Curtis Belmonte
2021-06-29 16:38:39 -07:00
parent c0302ab306
commit 68c12f2e04
5 changed files with 55 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ import android.hardware.face.FaceSensorPropertiesInternal;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -74,11 +75,13 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Apply extracted theme color to icons.
final ImageView iconGlasses = findViewById(R.id.icon_glasses);
final ImageView iconLooking = findViewById(R.id.icon_looking);
iconGlasses.getBackground().setColorFilter(getIconColorFilter());
iconLooking.getBackground().setColorFilter(getIconColorFilter());
// Set text for views with multiple variations.
final TextView infoMessageGlasses = findViewById(R.id.info_message_glasses);
final TextView infoMessageLooking = findViewById(R.id.info_message_looking);
final TextView howMessage = findViewById(R.id.how_message);
@@ -86,10 +89,20 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
final TextView inControlMessage = findViewById(R.id.message_in_control);
infoMessageGlasses.setText(getInfoMessageGlasses());
infoMessageLooking.setText(getInfoMessageLooking());
howMessage.setText(getHowMessage());
inControlTitle.setText(getInControlTitle());
howMessage.setText(getHowMessage());
inControlMessage.setText(getInControlMessage());
// Set up and show the "require eyes" info section if necessary.
if (getResources().getBoolean(R.bool.config_face_intro_show_require_eyes)) {
final LinearLayout infoRowRequireEyes = findViewById(R.id.info_row_require_eyes);
final ImageView iconRequireEyes = findViewById(R.id.icon_require_eyes);
final TextView infoMessageRequireEyes = findViewById(R.id.info_message_require_eyes);
infoRowRequireEyes.setVisibility(View.VISIBLE);
iconRequireEyes.getBackground().setColorFilter(getIconColorFilter());
infoMessageRequireEyes.setText(getInfoMessageRequireEyes());
}
mFaceManager = Utils.getFaceManagerOrNull(this);
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
.getFaceFeatureProvider();
@@ -126,6 +139,11 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
return R.string.security_settings_face_enroll_introduction_info_looking;
}
@StringRes
protected int getInfoMessageRequireEyes() {
return R.string.security_settings_face_enroll_introduction_info_gaze;
}
@StringRes
protected int getHowMessage() {
return R.string.security_settings_face_enroll_introduction_how_message;