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

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

Merge changes from topics "A11yFeedback1P", "A11yFeedbackTopLevelPage",...

Merge changes from topics "A11yFeedback1P", "A11yFeedbackTopLevelPage", "AccessibilityPageIdFeatureProvider" into main

* changes:
  refactor(A11yFeedback): Rename AccessibilityMetricsFeatureProvider
  feat(A11yFeedback): Add feedback entry for downloaded Accessibility
  chore(A11yFeedback): Removing Legacy Android M Menu Behavior
  feat(A11yFeedback): Implements page ID to feedback bucket ID mapping
parents 744ed220 b511fe69
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -127,14 +127,13 @@ public class AccessibilityActivityPreference extends RestrictedPreference {
        final String htmlDescription = mA11yShortcutInfo.loadHtmlDescription(mPm);
        final String settingsClassName = mA11yShortcutInfo.getSettingsActivityName();
        final String tileServiceClassName = mA11yShortcutInfo.getTileServiceName();
        final int metricsCategory = FeatureFactory.getFeatureFactory()
                .getAccessibilityMetricsFeatureProvider()
                .getDownloadedFeatureMetricsCategory(mComponentName);
        final int pageIdCategory = FeatureFactory.getFeatureFactory()
                .getAccessibilityPageIdFeatureProvider().getCategory(mComponentName);

        ThreadUtils.getUiThreadHandler().post(() -> {
            RestrictedPreferenceHelper.putBasicExtras(
                    this, prefKey, getTitle(), intro, description, imageRes,
                    htmlDescription, mComponentName, metricsCategory);
                    htmlDescription, mComponentName, pageIdCategory);
            RestrictedPreferenceHelper.putSettingsExtras(this, getPackageName(), settingsClassName);
            RestrictedPreferenceHelper.putTileServiceExtras(
                    this, getPackageName(), tileServiceClassName);
+4 −4
Original line number Diff line number Diff line
@@ -228,10 +228,10 @@ public class AccessibilityDetailsSettingsFragment extends InstrumentedFragment {
                    new ComponentName(packageName, tileServiceClassName).flattenToString());
        }

        final int metricsCategory = FeatureFactory.getFeatureFactory()
                .getAccessibilityMetricsFeatureProvider()
                .getDownloadedFeatureMetricsCategory(componentName);
        extras.putInt(AccessibilitySettings.EXTRA_METRICS_CATEGORY, metricsCategory);
        final int pageIdCategory = FeatureFactory.getFeatureFactory()
                .getAccessibilityPageIdFeatureProvider().getCategory(componentName);
        extras.putInt(AccessibilitySettings.EXTRA_METRICS_CATEGORY, pageIdCategory);
        extras.putInt(AccessibilitySettings.EXTRA_FEEDBACK_CATEGORY, pageIdCategory);
        extras.putParcelable(AccessibilitySettings.EXTRA_COMPONENT_NAME, componentName);
        extras.putInt(AccessibilitySettings.EXTRA_ANIMATED_IMAGE_RES, info.getAnimatedImageRes());

+4 −6
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package com.android.settings.accessibility;

import android.content.ComponentName;

import androidx.annotation.Nullable;

/**
@@ -25,11 +23,11 @@ import androidx.annotation.Nullable;
public interface AccessibilityFeedbackFeatureProvider {

    /**
     * Returns value according to the {@code componentName}.
     * Returns value according to the {@code pageId}.
     *
     * @param componentName the component name of the downloaded service or activity
     * @return Feedback bucket ID
     * @param pageId The unique identifier of the page.
     * @return Feedback bucket ID associated with the page, or {@code null} if is not found.
     */
    @Nullable
    String getCategory(@Nullable ComponentName componentName);
    String getCategory(int pageId);
}
+2 −4
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package com.android.settings.accessibility;

import android.content.ComponentName;

import androidx.annotation.Nullable;

/** Default implementation of {@link AccessibilityFeedbackFeatureProvider}. */
@@ -25,7 +23,7 @@ public class AccessibilityFeedbackFeatureProviderImpl implements

    @Override
    @Nullable
    public String getCategory(@Nullable ComponentName componentName) {
        return "";
    public String getCategory(int pageId) {
        return null;
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ import android.content.ComponentName;
import androidx.annotation.Nullable;

/**
 * Provider for Accessibility metrics related features.
 * Provider for Accessibility page id related features.
 */
public interface AccessibilityMetricsFeatureProvider {
public interface AccessibilityPageIdFeatureProvider {

    /**
     * Returns {@link android.app.settings.SettingsEnums} value according to the {@code
@@ -32,5 +32,5 @@ public interface AccessibilityMetricsFeatureProvider {
     * @param componentName the component name of the downloaded service or activity
     * @return value in {@link android.app.settings.SettingsEnums}
     */
    int getDownloadedFeatureMetricsCategory(@Nullable ComponentName componentName);
    int getCategory(@Nullable ComponentName componentName);
}
Loading