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

Commit 6b490c46 authored by Menghan Li's avatar Menghan Li Committed by Android (Google) Code Review
Browse files

Merge changes from topics "DaLink", "DaLinkPixelOverlay" into main

* changes:
  feat(DaLink): Pixel overlay to expose the disability support link
  feat(DaLink): Add entry point in top-level a11y settings
  feat(DaLink): Implement disability support menu controller
parents 67b28d13 23053884
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5428,6 +5428,8 @@
    <string name="accessibility_send_feedback_title">Send feedback</string>
    <!-- The menu item to start the survey process for the accessibility [CHAR LIMIT=30] -->
    <string name="accessibility_send_survey_title">Rate us</string>
    <!-- The menu item to start the disability support for the accessibility [CHAR LIMIT=30] -->
    <string name="accessibility_disability_support_title">Contact Google Disability Support</string>
    <!-- Channel name for the accessibility survey notification. [CHAR LIMIT=50] -->
    <string name="accessibility_send_survey_notification_channel">Accessibility Survey</string>
    <!-- Title of a survey notification about dark theme. [CHAR LIMIT=50] -->
+29 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings.accessibility;

import androidx.annotation.NonNull;

/**
 * Provider for Accessibility disability support related features.
 */
public interface AccessibilityDisabilitySupportFeatureProvider {

    /** Returns the url of the disability support link. */
    @NonNull
    String getUrl();
}
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.settings.accessibility;

import androidx.annotation.NonNull;

/** Default implementation of {@link AccessibilityDisabilitySupportFeatureProvider}. */
public class AccessibilityDisabilitySupportFeatureProviderImpl implements
        AccessibilityDisabilitySupportFeatureProvider {

    @Override
    @NonNull
    public String getUrl() {
        return "";
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -187,6 +187,13 @@ public class AccessibilitySettings extends BaseSupportFragment implements
        return SettingsEnums.ACCESSIBILITY;
    }

    @Override
    protected String getDisabilitySupportUrl() {
        return FeatureFactory.getFeatureFactory()
                .getAccessibilityDisabilitySupportFeatureProvider()
                .getUrl();
    }

    @Override
    public int getHelpResource() {
        return R.string.help_uri_accessibility;
+22 −3
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.server.accessibility.Flags;
import com.android.settings.accessibility.actionbar.DisabilitySupportMenuController;
import com.android.settings.accessibility.actionbar.FeedbackMenuController;
import com.android.settings.accessibility.actionbar.SurveyMenuController;
import com.android.settings.dashboard.DashboardFragment;
@@ -39,7 +39,8 @@ import com.android.settings.overlay.SurveyFeatureProvider;
 * Base fragment for dashboard style UI containing support-related items.
 *
 * <p>Child classes <strong>must</strong> configure the mapping between {@link SettingsEnums} page
 * IDs and feedback bucket IDs from {@link AccessibilityFeedbackFeatureProvider}.
 * IDs, feedback bucket IDs from {@link AccessibilityFeedbackFeatureProvider}, and disability
 * support.
 */
public abstract class BaseSupportFragment extends DashboardFragment {

@@ -48,9 +49,13 @@ public abstract class BaseSupportFragment extends DashboardFragment {
        super.onCreate(savedInstanceState);
        handleFeedbackFlow();

        if (Flags.enableLowVisionHats()) {
        if (com.android.server.accessibility.Flags.enableLowVisionHats()) {
            handleSurveyFlow();
        }

        if (com.android.settings.accessibility.Flags.enableDisabilitySupport()) {
            handleDisabilitySupportFlow();
        }
    }

    /**
@@ -86,6 +91,11 @@ public abstract class BaseSupportFragment extends DashboardFragment {
        return "";
    }

    @NonNull
    protected String getDisabilitySupportUrl() {
        return "";
    }

    private void handleSurveyFlow() {
        final Context context = getActivity();
        if (context == null) {
@@ -121,4 +131,13 @@ public abstract class BaseSupportFragment extends DashboardFragment {

        FeedbackMenuController.init(this, feedbackCategory);
    }

    private void handleDisabilitySupportFlow() {
        final String disabilitySupportUrl = getDisabilitySupportUrl();
        if (TextUtils.isEmpty(disabilitySupportUrl)) {
            return;
        }

        DisabilitySupportMenuController.init(this, disabilitySupportUrl);
    }
}
Loading