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

Commit 9aa8aa1c authored by Rhed Jao's avatar Rhed Jao Committed by Android (Google) Code Review
Browse files

Merge "Refine spoken feedback string for a11y shortcut dialog"

parents 56af80c9 5d9618bd
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -357,15 +357,16 @@ public class AccessibilityShortcutController {
    }

    private boolean performTtsPrompt(AlertDialog alertDialog) {
        final String serviceName = getShortcutFeatureDescription(false /* no summary */);
        final AccessibilityServiceInfo serviceInfo = getInfoForTargetService();
        if (serviceInfo == null) {
        if (TextUtils.isEmpty(serviceName) || serviceInfo == null) {
            return false;
        }
        if ((serviceInfo.flags & AccessibilityServiceInfo
                .FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK) == 0) {
            return false;
        }
        final TtsPrompt tts = new TtsPrompt();
        final TtsPrompt tts = new TtsPrompt(serviceName);
        alertDialog.setOnDismissListener(dialog -> tts.dismiss());
        return true;
    }
@@ -378,8 +379,9 @@ public class AccessibilityShortcutController {
        private boolean mDismiss;
        private TextToSpeech mTts;

        TtsPrompt() {
            mText = mContext.getString(R.string.accessibility_shortcut_spoken_feedback);
        TtsPrompt(String serviceName) {
            mText = mContext.getString(R.string.accessibility_shortcut_spoken_feedback,
                    serviceName);
            mTts = mFrameworkObjectProvider.getTextToSpeech(mContext, this);
        }

+2 −1
Original line number Diff line number Diff line
@@ -4436,7 +4436,8 @@
        <xliff:g id="service_name" example="TalkBack">%1$s</xliff:g> off</string>

    <!-- Text spoken when accessibility shortcut warning dialog is shown. [CHAR LIMIT=none] -->
    <string name="accessibility_shortcut_spoken_feedback">Use Accessibility Shortcut again to start the current accessibility feature</string>
    <string name="accessibility_shortcut_spoken_feedback">Press and hold both volume keys for three seconds to use
        <xliff:g id="service_name" example="TalkBack">%1$s</xliff:g></string>

    <!-- Text appearing in a prompt at the top of UI allowing the user to select a target service or feature to be assigned to the Accessibility button in the navigation bar. -->
    <string name="accessibility_button_prompt_text">Choose a feature to use when you tap the Accessibility button:</string>