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

Commit 6bfc3811 authored by Kevin Chang's avatar Kevin Chang Committed by Android (Google) Code Review
Browse files

Merge "Add new reminder in "Magnify with shortcut" page" into qt-r1-dev

parents af447c17 04dea2b5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4883,6 +4883,8 @@
    <string name="accessibility_tutorial_dialog_button">Got it</string>
    <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
    <string name="accessibility_screen_magnification_navbar_configuration_warning">The Accessibility button is set to <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, touch &amp; hold the Accessibility button, then select magnification.</string>
    <!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->
    <string name="accessibility_screen_magnification_gesture_navigation_warning">The accessibility gesture is set to the <xliff:g id="service" example="Select to Speak">%1$s</xliff:g>. To use magnification, swipe up with two fingers from the bottom of the screen and hold. Then select magnification.</string>
    <!-- Title for the preference to configure the accessibility shortcut, which uses the volume keys. [CHAR LIMIT=35] -->
    <string name="accessibility_global_gesture_preference_title">Volume key shortcut</string>
    <!-- Title for the preference to choose the service that is turned on and off by the accessibility shortcut. [CHAR LIMIT=35] -->
+13 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings.accessibility;

import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;

import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.settings.SettingsEnums;
import android.content.ComponentName;
@@ -132,9 +134,10 @@ public final class MagnificationPreferenceFragment extends DashboardFragment {
                if (info.getComponentName().equals(assignedComponentName)) {
                    final CharSequence assignedServiceName = info.getResolveInfo().loadLabel(
                            context.getPackageManager());
                    return context.getString(
                            R.string.accessibility_screen_magnification_navbar_configuration_warning,
                            assignedServiceName);
                    final int messageId = isGestureNavigateEnabled(context)
                            ? R.string.accessibility_screen_magnification_gesture_navigation_warning
                            : R.string.accessibility_screen_magnification_navbar_configuration_warning;
                    return context.getString(messageId, assignedServiceName);
                }
            }
        }
@@ -158,6 +161,12 @@ public final class MagnificationPreferenceFragment extends DashboardFragment {
        return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
    }

    private static boolean isGestureNavigateEnabled(Context context) {
        return context.getResources().getInteger(
                com.android.internal.R.integer.config_navBarInteractionMode)
                == NAV_BAR_MODE_GESTURAL;
    }

    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider() {
                @Override