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

Commit 5d9618bd authored by Rhed Jao's avatar Rhed Jao
Browse files

Refine spoken feedback string for a11y shortcut dialog

Bug: 120038227
Test: atest AccessibilityShortcutControllerTest
Change-Id: I49e19655cd4a00830ff4d2cfbe16ae22b22eee49
parent 69be3f19
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
@@ -4424,7 +4424,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>