Merge "Add "eyes open" setting message to face enroll intro" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e796b8bf6e
@@ -107,6 +107,28 @@
|
|||||||
style="@style/BiometricEnrollIntroMessage" />
|
style="@style/BiometricEnrollIntroMessage" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/info_row_require_eyes"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/icon_require_eyes"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/ic_settings_24dp"/>
|
||||||
|
<Space
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/info_message_require_eyes"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/BiometricEnrollIntroMessage" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- How it works -->
|
<!-- How it works -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -269,6 +269,9 @@
|
|||||||
<!-- ComponentName to launch a vendor-specific enrollment activity if available -->
|
<!-- ComponentName to launch a vendor-specific enrollment activity if available -->
|
||||||
<string name="config_face_enroll" translatable="false"></string>
|
<string name="config_face_enroll" translatable="false"></string>
|
||||||
|
|
||||||
|
<!-- Whether to show the "require eyes" info section on the face enroll intro screen -->
|
||||||
|
<bool name="config_face_intro_show_require_eyes">true</bool>
|
||||||
|
|
||||||
<!-- Whether to use the Lottie animation for the face education enrollment screen -->
|
<!-- Whether to use the Lottie animation for the face education enrollment screen -->
|
||||||
<bool name="config_face_education_use_lottie">false</bool>
|
<bool name="config_face_education_use_lottie">false</bool>
|
||||||
|
|
||||||
|
@@ -796,6 +796,11 @@
|
|||||||
<string name="security_settings_face_enroll_introduction_info_looking"></string>
|
<string name="security_settings_face_enroll_introduction_info_looking"></string>
|
||||||
<!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock when asking for parental consent. [CHAR LIMIT=NONE] -->
|
<!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock when asking for parental consent. [CHAR LIMIT=NONE] -->
|
||||||
<string name="security_settings_face_enroll_introduction_info_consent_looking"></string>
|
<string name="security_settings_face_enroll_introduction_info_consent_looking"></string>
|
||||||
|
<!-- Message on the face enrollment introduction page that provides information about how to require eyes to be open for Face Unlock. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="security_settings_face_enroll_introduction_info_gaze"></string>
|
||||||
|
<!-- Message on the face enrollment introduction page that provides information about how to require eyes to be open for Face Unlock when asking for parental consent. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="security_settings_face_enroll_introduction_info_consent_gaze"></string>
|
||||||
|
|
||||||
<!-- Title of a section on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=40] -->
|
<!-- Title of a section on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=40] -->
|
||||||
<string name="security_settings_face_enroll_introduction_how_title"></string>
|
<string name="security_settings_face_enroll_introduction_how_title"></string>
|
||||||
<!-- Message on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=NONE] -->
|
<!-- Message on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=NONE] -->
|
||||||
|
@@ -24,6 +24,7 @@ import android.hardware.face.FaceSensorPropertiesInternal;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -74,11 +75,13 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
// Apply extracted theme color to icons.
|
||||||
final ImageView iconGlasses = findViewById(R.id.icon_glasses);
|
final ImageView iconGlasses = findViewById(R.id.icon_glasses);
|
||||||
final ImageView iconLooking = findViewById(R.id.icon_looking);
|
final ImageView iconLooking = findViewById(R.id.icon_looking);
|
||||||
iconGlasses.getBackground().setColorFilter(getIconColorFilter());
|
iconGlasses.getBackground().setColorFilter(getIconColorFilter());
|
||||||
iconLooking.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 infoMessageGlasses = findViewById(R.id.info_message_glasses);
|
||||||
final TextView infoMessageLooking = findViewById(R.id.info_message_looking);
|
final TextView infoMessageLooking = findViewById(R.id.info_message_looking);
|
||||||
final TextView howMessage = findViewById(R.id.how_message);
|
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);
|
final TextView inControlMessage = findViewById(R.id.message_in_control);
|
||||||
infoMessageGlasses.setText(getInfoMessageGlasses());
|
infoMessageGlasses.setText(getInfoMessageGlasses());
|
||||||
infoMessageLooking.setText(getInfoMessageLooking());
|
infoMessageLooking.setText(getInfoMessageLooking());
|
||||||
howMessage.setText(getHowMessage());
|
|
||||||
inControlTitle.setText(getInControlTitle());
|
inControlTitle.setText(getInControlTitle());
|
||||||
|
howMessage.setText(getHowMessage());
|
||||||
inControlMessage.setText(getInControlMessage());
|
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);
|
mFaceManager = Utils.getFaceManagerOrNull(this);
|
||||||
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
|
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
|
||||||
.getFaceFeatureProvider();
|
.getFaceFeatureProvider();
|
||||||
@@ -126,6 +139,11 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
return R.string.security_settings_face_enroll_introduction_info_looking;
|
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
|
@StringRes
|
||||||
protected int getHowMessage() {
|
protected int getHowMessage() {
|
||||||
return R.string.security_settings_face_enroll_introduction_how_message;
|
return R.string.security_settings_face_enroll_introduction_how_message;
|
||||||
|
@@ -80,6 +80,12 @@ public class FaceEnrollParentalConsent extends FaceEnrollIntroduction {
|
|||||||
return R.string.security_settings_face_enroll_introduction_info_consent_looking;
|
return R.string.security_settings_face_enroll_introduction_info_consent_looking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@StringRes
|
||||||
|
protected int getInfoMessageRequireEyes() {
|
||||||
|
return R.string.security_settings_face_enroll_introduction_info_consent_gaze;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@StringRes
|
@StringRes
|
||||||
protected int getHowMessage() {
|
protected int getHowMessage() {
|
||||||
|
Reference in New Issue
Block a user