Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ea74c3d authored by Bill Lin's avatar Bill Lin Committed by Android (Google) Code Review
Browse files

Merge "Update screen lock and biometrics options in order" into udc-qpr-dev

parents b1aaa313 7f8197da
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -865,7 +865,7 @@
    <!-- Biometric settings --><skip />
    <!-- Title shown for menu item that launches biometric settings. [CHAR LIMIT=66] -->
    <string name="security_settings_biometric_preference_title">Face &amp; Fingerprint Unlock</string>
    <string name="security_settings_biometric_preference_title">Fingerprint &amp; Face Unlock</string>
    <!-- Title shown for work menu item that launches biometric settings. [CHAR LIMIT=66] -->
    <string name="security_settings_work_biometric_preference_title">Face &amp; Fingerprint Unlock for work</string>
    <!-- Message shown in summary field of biometric settings. [CHAR LIMIT=66] -->
@@ -1217,14 +1217,8 @@
    <!-- Title for preference that guides the user to skip Face Unlock setup [CHAR LIMIT=60]-->
    <string name="face_unlock_skip_face">Continue without Face Unlock</string>
    <!-- Title for preference that guides the user through creating a backup unlock pattern for biometrics unlock [CHAR LIMIT=45]-->
    <string name="biometrics_unlock_set_unlock_pattern">Pattern \u2022 Face \u2022 Fingerprint</string>
    <!-- Title for preference that guides the user through creating a backup unlock PIN for biometrics unlock [CHAR LIMIT=45]-->
    <string name="biometrics_unlock_set_unlock_pin">PIN \u2022 Face \u2022 Fingerprint</string>
    <!-- Title for preference that guides the user through creating a backup unlock password for biometrics unlock [CHAR LIMIT=45]-->
    <string name="biometrics_unlock_set_unlock_password">Password \u2022 Face \u2022 Fingerprint</string>
    <!-- Title for preference that guides the user to skip face unlock setup [CHAR LIMIT=60]-->
    <string name="biometrics_unlock_skip_biometrics">Continue without face or fingerprint</string>
    <string name="biometrics_unlock_skip_biometrics">Continue without fingerprint or face</string>
    <!-- Summary for "Configure lockscreen" when lock screen is off [CHAR LIMIT=45] -->
    <string name="unlock_set_unlock_mode_off">None</string>
+5 −4
Original line number Diff line number Diff line
@@ -527,17 +527,18 @@ public class BiometricUtils {
        // Assume the flow is "Screen Lock" + "Face" + "Fingerprint"
        ssb.append(bidi.unicodeWrap(screenLock));

        if (isFaceSupported) {
        if (hasFingerprint) {
            ssb.append(bidi.unicodeWrap(SEPARATOR));
            ssb.append(bidi.unicodeWrap(
                    capitalize(context.getString(R.string.keywords_face_settings))));
                    capitalize(context.getString(R.string.security_settings_fingerprint))));
        }

        if (hasFingerprint) {
        if (isFaceSupported) {
            ssb.append(bidi.unicodeWrap(SEPARATOR));
            ssb.append(bidi.unicodeWrap(
                    capitalize(context.getString(R.string.security_settings_fingerprint))));
                    capitalize(context.getString(R.string.keywords_face_settings))));
        }

        return ssb.toString();
    }

+21 −11
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockscreenCredential;
import com.android.settings.R;
import com.android.settings.biometrics.BiometricEnrollBase;
import com.android.settings.biometrics.BiometricUtils;
import com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment;
import com.android.settings.search.SearchFeatureProvider;
import com.android.settings.testutils.FakeFeatureFactory;
@@ -543,29 +544,38 @@ public class ChooseLockGenericTest {
    }

    @Test
    public void updatePreferenceText_supportBiometrics_showFaceAndFingerprint() {
    public void updatePreferenceText_supportBiometrics_setScreenLockFingerprintFace_inOrder() {
        ShadowStorageManager.setIsFileEncrypted(false);
        final Intent intent = new Intent().putExtra(EXTRA_KEY_FOR_BIOMETRICS, true);
        initActivity(intent);


        final String supportFingerprint = capitalize(mActivity.getResources().getString(
                R.string.security_settings_fingerprint));
        final String supportFace = capitalize(mActivity.getResources().getString(
                R.string.keywords_face_settings));
        String pinTitle =

        // The strings of golden copy
        final String pinFingerprintFace = mActivity.getText(R.string.unlock_set_unlock_pin_title)
                + BiometricUtils.SEPARATOR + supportFingerprint + BiometricUtils.SEPARATOR
                + supportFace;
        final String patternFingerprintFace = mActivity.getText(
                R.string.unlock_set_unlock_pattern_title) + BiometricUtils.SEPARATOR
                + supportFingerprint + BiometricUtils.SEPARATOR + supportFace;
        final String passwordFingerprintFace = mActivity.getText(
                R.string.unlock_set_unlock_password_title) + BiometricUtils.SEPARATOR
                + supportFingerprint + BiometricUtils.SEPARATOR + supportFace;

        // The strings obtain from preferences
        final String pinTitle =
                (String) mFragment.findPreference(ScreenLockType.PIN.preferenceKey).getTitle();
        String patternTitle =
        final String patternTitle =
                (String) mFragment.findPreference(ScreenLockType.PATTERN.preferenceKey).getTitle();
        String passwordTitle =
        final String passwordTitle =
                (String) mFragment.findPreference(ScreenLockType.PASSWORD.preferenceKey).getTitle();

        assertThat(pinTitle).contains(supportFingerprint);
        assertThat(pinTitle).contains(supportFace);
        assertThat(patternTitle).contains(supportFingerprint);
        assertThat(patternTitle).contains(supportFace);
        assertThat(passwordTitle).contains(supportFingerprint);
        assertThat(passwordTitle).contains(supportFace);
        assertThat(pinTitle).isEqualTo(pinFingerprintFace);
        assertThat(patternTitle).isEqualTo(patternFingerprintFace);
        assertThat(passwordTitle).isEqualTo(passwordFingerprintFace);
    }

    @Test