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

Commit fba70ede authored by Becca Hughes's avatar Becca Hughes Committed by Android (Google) Code Review
Browse files

Merge "Add provider name to on/off switch talkback" into main

parents 9cc97b32 cf2d6356
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>
+19 −0
Original line number Diff line number Diff line
@@ -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(