Add content description for password&pin credential view.

Bug: 384635437
Test: manual test with talkback on on settings device unlock
Flag: EXEMPT for a11y big fix
Change-Id: Ie9edd41dca8274cd69700d2a5dfc7b5fe5a7be8e
This commit is contained in:
Hao Dong
2025-02-28 20:42:34 +00:00
parent b1066b1348
commit 1cd98d4993
3 changed files with 9 additions and 5 deletions

View File

@@ -1739,6 +1739,11 @@
<!-- Summary specifying that this is the current screen lock setting [CHAR LIMIT=45] -->
<string name="current_screen_lock">Current screen lock</string>
<!-- Accessibility description of the PIN password view. [CHAR_LIMIT=none] -->
<string name="unlock_accessibility_pin_area">PIN area</string>
<!-- Accessibility description of the normal password view. [CHAR_LIMIT=none] -->
<string name="unlock_accessibility_password">Device password</string>
<!-- Title for preference that guides the user through creating a backup unlock pattern for fingerprint [CHAR LIMIT=45]-->
<string name="fingerprint_unlock_set_unlock_pattern">Pattern \u2022 Fingerprint</string>
<!-- Title for preference that guides the user through creating a backup unlock PIN for fingerprint [CHAR LIMIT=45]-->

View File

@@ -585,10 +585,10 @@ public class ChooseLockPassword extends SettingsActivity {
: (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
if (mIsAlphaMode) {
mPasswordEntry.setContentDescription(
getString(R.string.unlock_set_unlock_password_title));
getString(R.string.unlock_accessibility_password));
} else {
mPasswordEntry.setContentDescription(
getString(R.string.unlock_set_unlock_pin_title));
getString(R.string.unlock_accessibility_pin_area));
}
// Can't set via XML since setInputType resets the fontFamily to null
mPasswordEntry.setTypeface(Typeface.create(

View File

@@ -66,7 +66,6 @@ import com.android.internal.widget.LockscreenCredential;
import com.android.internal.widget.TextViewInputDisabler;
import com.android.settings.R;
import com.android.settings.SetupRedactionInterstitial;
import com.android.settings.SetupWizardUtils;
import com.android.settings.Utils;
import com.android.settingslib.animation.AppearAnimationUtils;
import com.android.settingslib.animation.DisappearAnimationUtils;
@@ -211,12 +210,12 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
if (mIsAlpha) {
mPasswordEntry.setInputType(currentType);
mPasswordEntry.setContentDescription(
getContext().getString(R.string.unlock_set_unlock_password_title));
getContext().getString(R.string.unlock_accessibility_password));
} else {
mPasswordEntry.setInputType(
InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD);
mPasswordEntry.setContentDescription(
getContext().getString(R.string.unlock_set_unlock_pin_title));
getContext().getString(R.string.unlock_accessibility_pin_area));
}
// Can't set via XML since setInputType resets the fontFamily to null
mPasswordEntry.setTypeface(Typeface.create(