Merge "Add provider name to on/off switch talkback" into main
This commit is contained in:
@@ -11107,6 +11107,9 @@
|
||||
<!-- Title of the warning dialog for enabling the credential provider. [CHAR_LIMIT=NONE] -->
|
||||
<string name="credman_enable_confirmation_message_title">Use %1$s\?</string>
|
||||
|
||||
<!-- Content description for credential manager provider on/off switch. [CHAR_LIMIT=NONE] -->
|
||||
<string name="credman_on_off_switch_content_description">%1$s on/off</string>
|
||||
|
||||
<!-- Positive button text for disabling credential manager. [CHAR_LIMIT=30] -->
|
||||
<string name="credman_confirmation_turn_off_positive_button">Turn off</string>
|
||||
|
||||
|
@@ -1072,6 +1072,22 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
|
||||
return mChecked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(@Nullable CharSequence title) {
|
||||
super.setTitle(title);
|
||||
maybeUpdateContentDescription();
|
||||
}
|
||||
|
||||
private void maybeUpdateContentDescription() {
|
||||
final CharSequence appName = getTitle();
|
||||
|
||||
if (mSwitch != null && !TextUtils.isEmpty(appName)) {
|
||||
mSwitch.setContentDescription(
|
||||
getContext().getString(
|
||||
R.string.credman_on_off_switch_content_description, appName));
|
||||
}
|
||||
}
|
||||
|
||||
public void setPreferenceListener(OnCombiPreferenceClickListener onClickListener) {
|
||||
mOnClickListener = onClickListener;
|
||||
}
|
||||
@@ -1094,6 +1110,9 @@ public class CredentialManagerPreferenceController extends BasePreferenceControl
|
||||
|
||||
// Store this for later.
|
||||
mSwitch = switchView;
|
||||
|
||||
// Update the content description.
|
||||
maybeUpdateContentDescription();
|
||||
}
|
||||
|
||||
super.setOnPreferenceClickListener(
|
||||
|
Reference in New Issue
Block a user