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

Commit a5085443 authored by Jason Hsu's avatar Jason Hsu Committed by Android (Google) Code Review
Browse files

Merge changes I02f03ccb,I0ee46dd9

* changes:
  Extract UserShortcutType functions from ToggleFeaturePreferenceFragment
  Add data class PreferredShortcut to replace inner class UserShortcutType
parents 84b956ca 48b546ec
Loading
Loading
Loading
Loading
+96 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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 android.content.ComponentName;
import android.text.TextUtils;

import com.android.settings.accessibility.AccessibilityUtil.UserShortcutType;

import com.google.common.base.Objects;

/**
 * A data class for containing {@link ComponentName#flattenToString()} and
 * {@link UserShortcutType}. Represents the preferred shortcuts of the service or activity.
 */
public class PreferredShortcut {

    private static final char COMPONENT_NAME_SEPARATOR = ':';
    private static final TextUtils.SimpleStringSplitter sStringColonSplitter =
            new TextUtils.SimpleStringSplitter(COMPONENT_NAME_SEPARATOR);

    /**
     * Creates a {@link PreferredShortcut} from a encoded string described in {@link #toString()}.
     *
     * @param preferredShortcutString A string conform to the format described in {@link
     *                                #toString()}
     * @return A {@link PreferredShortcut} with the specified value
     * @throws IllegalArgumentException If preferredShortcutString does not conform to the format
     *                                  described in {@link #toString()}
     */
    public static PreferredShortcut fromString(String preferredShortcutString) {
        sStringColonSplitter.setString(preferredShortcutString);
        if (sStringColonSplitter.hasNext()) {
            final String componentName = sStringColonSplitter.next();
            final int type = Integer.parseInt(sStringColonSplitter.next());
            return new PreferredShortcut(componentName, type);
        }

        throw new IllegalArgumentException(
                "Invalid PreferredShortcut string: " + preferredShortcutString);
    }

    /** The format of {@link ComponentName#flattenToString()} */
    private String mComponentName;
    /** The format of {@link UserShortcutType} */
    private int mType;

    public PreferredShortcut(String componentName, int type) {
        mComponentName = componentName;
        mType = type;
    }

    public String getComponentName() {
        return mComponentName;
    }

    public int getType() {
        return mType;
    }

    @Override
    public String toString() {
        return mComponentName + COMPONENT_NAME_SEPARATOR + mType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PreferredShortcut that = (PreferredShortcut) o;
        return mType == that.mType && Objects.equal(mComponentName, that.mComponentName);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(mComponentName, mType);
    }
}
+102 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 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 android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;

import com.android.settings.accessibility.AccessibilityUtil.UserShortcutType;

import java.util.HashSet;
import java.util.Set;

/** Static utility methods relating to {@link PreferredShortcut} */
public final class PreferredShortcuts {

    private static final String ACCESSIBILITY_PERF = "accessibility_prefs";
    private static final String USER_SHORTCUT_TYPE = "user_shortcut_type";

    /**
     * Retrieves {@link UserShortcutType} for the given {@code componentName} from
     * SharedPreferences.
     *
     * @param context       {@link Context} to access the {@link SharedPreferences}
     * @param componentName Name of the service or activity, should be the format of {@link
     *                      ComponentName#flattenToString()}.
     * @param defaultType   See {@link UserShortcutType}
     * @return {@link UserShortcutType}
     */
    public static int retrieveUserShortcutType(Context context, String componentName,
            int defaultType) {
        if (componentName == null) {
            return defaultType;
        }

        // Create a mutable set to modify
        final Set<String> info = new HashSet<>(getFromSharedPreferences(context));
        info.removeIf(str -> !str.contains(componentName));

        if (info.isEmpty()) {
            return defaultType;
        }

        final String str = info.stream().findFirst().get();
        final PreferredShortcut shortcut = PreferredShortcut.fromString(str);
        return shortcut.getType();
    }

    /**
     * Saves a {@link PreferredShortcut} which containing {@link ComponentName#flattenToString()}
     * and {@link UserShortcutType} in SharedPreferences.
     *
     * @param context  {@link Context} to access the {@link SharedPreferences}
     * @param shortcut Contains {@link ComponentName#flattenToString()} and {@link UserShortcutType}
     */
    public static void saveUserShortcutType(Context context, PreferredShortcut shortcut) {
        final String componentName = shortcut.getComponentName();
        if (componentName == null) {
            return;
        }

        // Create a mutable set to modify
        final Set<String> info = new HashSet<>(getFromSharedPreferences(context));
        info.removeIf(str -> str.contains(componentName));
        info.add(shortcut.toString());
        saveToSharedPreferences(context, info);
    }

    /**
     * Returns a immutable set of {@link PreferredShortcut#toString()} list from
     * SharedPreferences.
     */
    private static Set<String> getFromSharedPreferences(Context context) {
        return getSharedPreferences(context).getStringSet(USER_SHORTCUT_TYPE, Set.of());
    }

    /** Sets a set of {@link PreferredShortcut#toString()} list into SharedPreferences. */
    private static void saveToSharedPreferences(Context context, Set<String> data) {
        SharedPreferences.Editor editor = getSharedPreferences(context).edit();
        editor.putStringSet(USER_SHORTCUT_TYPE, data).apply();
    }

    private static SharedPreferences getSharedPreferences(Context context) {
        return context.getSharedPreferences(ACCESSIBILITY_PERF, Context.MODE_PRIVATE);
    }

    private PreferredShortcuts() {}
}
+7 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.settings.accessibility;

import static com.android.settings.accessibility.AccessibilityStatsLogUtils.logAccessibilityServiceEnabled;
import static com.android.settings.accessibility.PreferredShortcuts.retrieveUserShortcutType;

import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Activity;
@@ -292,7 +293,8 @@ public class ToggleAccessibilityServicePreferenceFragment extends

    @Override
    public void onToggleClicked(ShortcutPreference preference) {
        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        if (preference.isChecked()) {
            if (!mToggleServiceDividerSwitchPreference.isChecked()) {
                preference.setChecked(false);
@@ -313,7 +315,8 @@ public class ToggleAccessibilityServicePreferenceFragment extends
    public void onSettingsClicked(ShortcutPreference preference) {
        // Do not restore shortcut in shortcut chooser dialog when shortcutPreference is turned off.
        mUserShortcutTypesCache = mShortcutPreference.isChecked()
                ? getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE)
                ? retrieveUserShortcutType(getPrefContext(), mComponentName.flattenToString(),
                UserShortcutType.SOFTWARE)
                : UserShortcutType.EMPTY;

        final boolean isServiceOnOrShortcutAdded = mShortcutPreference.isChecked()
@@ -415,7 +418,8 @@ public class ToggleAccessibilityServicePreferenceFragment extends
    private void onAllowButtonFromShortcutToggleClicked() {
        mShortcutPreference.setChecked(true);

        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes, mComponentName);

        mIsDialogShown.set(false);
+21 −100
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.settings.accessibility;

import static com.android.settings.accessibility.AccessibilityUtil.getScreenHeightPixels;
import static com.android.settings.accessibility.AccessibilityUtil.getScreenWidthPixels;
import static com.android.settings.accessibility.PreferredShortcuts.retrieveUserShortcutType;
import static com.android.settings.accessibility.PreferredShortcuts.saveUserShortcutType;

import android.app.Dialog;
import android.app.settings.SettingsEnums;
@@ -44,6 +46,7 @@ import android.view.accessibility.AccessibilityManager.TouchExplorationStateChan
import android.widget.CheckBox;
import android.widget.ImageView;

import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
@@ -57,17 +60,11 @@ import com.android.settings.widget.SwitchBar;
import com.android.settingslib.accessibility.AccessibilityUtils;
import com.android.settingslib.widget.FooterPreference;

import com.google.common.annotations.VisibleForTesting;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.StringJoiner;
import java.util.stream.Collectors;

/**
 * Base class for accessibility fragments with toggle, shortcut, some helper functions
@@ -481,51 +478,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
        }
    }

    static final class AccessibilityUserShortcutType {
        private static final char COMPONENT_NAME_SEPARATOR = ':';
        private static final TextUtils.SimpleStringSplitter sStringColonSplitter =
                new TextUtils.SimpleStringSplitter(COMPONENT_NAME_SEPARATOR);

        private String mComponentName;
        private int mType;

        AccessibilityUserShortcutType(String componentName, int type) {
            this.mComponentName = componentName;
            this.mType = type;
        }

        AccessibilityUserShortcutType(String flattenedString) {
            sStringColonSplitter.setString(flattenedString);
            if (sStringColonSplitter.hasNext()) {
                this.mComponentName = sStringColonSplitter.next();
                this.mType = Integer.parseInt(sStringColonSplitter.next());
            }
        }

        String getComponentName() {
            return mComponentName;
        }

        void setComponentName(String componentName) {
            this.mComponentName = componentName;
        }

        int getType() {
            return mType;
        }

        void setType(int type) {
            this.mType = type;
        }

        String flattenToString() {
            final StringJoiner joiner = new StringJoiner(String.valueOf(COMPONENT_NAME_SEPARATOR));
            joiner.add(mComponentName);
            joiner.add(String.valueOf(mType));
            return joiner.toString();
        }
    }

    private void setDialogTextAreaClickListener(View dialogView, CheckBox checkBox) {
        final View dialogTextArea = dialogView.findViewById(R.id.container);
        dialogTextArea.setOnClickListener(v -> {
@@ -571,33 +523,14 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
        if (saveChanges) {
            final boolean isChanged = (mUserShortcutTypesCache != UserShortcutType.EMPTY);
            if (isChanged) {
                setUserShortcutType(getPrefContext(), mUserShortcutTypesCache);
                final PreferredShortcut shortcut = new PreferredShortcut(
                        mComponentName.flattenToString(), mUserShortcutTypesCache);
                saveUserShortcutType(getPrefContext(), shortcut);
            }
            mUserShortcutTypes = mUserShortcutTypesCache;
        }
    }

    private void setUserShortcutType(Context context, int type) {
        if (mComponentName == null) {
            return;
        }

        Set<String> info = SharedPreferenceUtils.getUserShortcutTypes(context);
        final String componentName = mComponentName.flattenToString();
        if (info.isEmpty()) {
            info = new HashSet<>();
        } else {
            final Set<String> filtered = info.stream()
                    .filter(str -> str.contains(componentName))
                    .collect(Collectors.toSet());
            info.removeAll(filtered);
        }
        final AccessibilityUserShortcutType shortcut = new AccessibilityUserShortcutType(
                componentName, type);
        info.add(shortcut.flattenToString());
        SharedPreferenceUtils.setUserShortcutType(context, info);
    }

    protected CharSequence getShortcutTypeSummary(Context context) {
        if (!mShortcutPreference.isSettingsEditable()) {
            return context.getText(R.string.accessibility_shortcut_edit_dialog_title_hardware);
@@ -607,7 +540,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
            return context.getText(R.string.switch_off_text);
        }

        final int shortcutTypes = getUserShortcutTypes(context, UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(context,
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        int resId = R.string.accessibility_shortcut_edit_summary_software;
        if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
            resId = AccessibilityUtil.isTouchExploreEnabled(context)
@@ -636,25 +570,6 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
                null, joinStrings);
    }

    protected int getUserShortcutTypes(Context context, @UserShortcutType int defaultValue) {
        if (mComponentName == null) {
            return defaultValue;
        }

        final Set<String> info = SharedPreferenceUtils.getUserShortcutTypes(context);
        final String componentName = mComponentName.flattenToString();
        final Set<String> filtered = info.stream()
                .filter(str -> str.contains(componentName))
                .collect(Collectors.toSet());
        if (filtered.isEmpty()) {
            return defaultValue;
        }

        final String str = (String) filtered.toArray()[0];
        final AccessibilityUserShortcutType shortcut = new AccessibilityUserShortcutType(str);
        return shortcut.getType();
    }

    /**
     * This method will be invoked when a button in the edit shortcut dialog is clicked.
     *
@@ -685,10 +600,13 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
        mUserShortcutTypes = AccessibilityUtil.getUserShortcutTypesFromSettings(getPrefContext(),
                mComponentName);
        if (mUserShortcutTypes != UserShortcutType.EMPTY) {
            setUserShortcutType(getPrefContext(), mUserShortcutTypes);
            final PreferredShortcut shortcut = new PreferredShortcut(
                    mComponentName.flattenToString(), mUserShortcutTypes);
            saveUserShortcutType(getPrefContext(), shortcut);
        } else {
            //  Get the user shortcut type from shared_prefs if cannot get from settings provider.
            mUserShortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
            mUserShortcutTypes = retrieveUserShortcutType(getPrefContext(),
                    mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        }
    }

@@ -711,7 +629,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
            return;
        }

        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        mShortcutPreference.setChecked(
                AccessibilityUtil.hasValuesInSettings(getPrefContext(), shortcutTypes,
                        mComponentName));
@@ -728,7 +647,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
            return;
        }

        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
        if (preference.isChecked()) {
            AccessibilityUtil.optInAllValuesToSettings(getPrefContext(), shortcutTypes,
                    mComponentName);
@@ -744,7 +664,8 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
    public void onSettingsClicked(ShortcutPreference preference) {
        // Do not restore shortcut in shortcut chooser dialog when shortcutPreference is turned off.
        mUserShortcutTypesCache = mShortcutPreference.isChecked()
                ? getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE)
                ? retrieveUserShortcutType(getPrefContext(),
                mComponentName.flattenToString(), UserShortcutType.SOFTWARE)
                : UserShortcutType.EMPTY;
        showDialog(DialogEnums.EDIT_SHORTCUT);
    }
+18 −41
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.settings.accessibility;
import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_CONTROLLER_NAME;
import static com.android.settings.accessibility.AccessibilityUtil.State.OFF;
import static com.android.settings.accessibility.AccessibilityUtil.State.ON;
import static com.android.settings.accessibility.PreferredShortcuts.retrieveUserShortcutType;
import static com.android.settings.accessibility.PreferredShortcuts.saveUserShortcutType;

import android.app.Dialog;
import android.app.settings.SettingsEnums;
@@ -46,12 +48,9 @@ import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityUtil.UserShortcutType;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.StringJoiner;
import java.util.stream.Collectors;

/**
 * Fragment that shows the actual UI for providing basic magnification accessibility service setup
@@ -210,35 +209,22 @@ public class ToggleScreenMagnificationPreferenceFragment extends
        if (saveChanges) {
            final boolean isChanged = (mUserShortcutTypesCache != UserShortcutType.EMPTY);
            if (isChanged) {
                setUserShortcutType(getPrefContext(), mUserShortcutTypesCache);
                final PreferredShortcut shortcut = new PreferredShortcut(
                        MAGNIFICATION_CONTROLLER_NAME, mUserShortcutTypesCache);
                saveUserShortcutType(getPrefContext(), shortcut);
            }
            mUserShortcutTypes = mUserShortcutTypesCache;
        }
    }

    private void setUserShortcutType(Context context, int type) {
        Set<String> info = SharedPreferenceUtils.getUserShortcutTypes(context);
        if (info.isEmpty()) {
            info = new HashSet<>();
        } else {
            final Set<String> filtered = info.stream().filter(
                    str -> str.contains(MAGNIFICATION_CONTROLLER_NAME)).collect(
                    Collectors.toSet());
            info.removeAll(filtered);
        }
        final AccessibilityUserShortcutType shortcut = new AccessibilityUserShortcutType(
                MAGNIFICATION_CONTROLLER_NAME, type);
        info.add(shortcut.flattenToString());
        SharedPreferenceUtils.setUserShortcutType(context, info);
    }

    @Override
    protected CharSequence getShortcutTypeSummary(Context context) {
        if (!mShortcutPreference.isChecked()) {
            return context.getText(R.string.switch_off_text);
        }

        final int shortcutType = getUserShortcutTypes(context, UserShortcutType.EMPTY);
        final int shortcutType = retrieveUserShortcutType(context, MAGNIFICATION_CONTROLLER_NAME,
                UserShortcutType.EMPTY);
        int resId = R.string.accessibility_shortcut_edit_summary_software;
        if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
            resId = AccessibilityUtil.isTouchExploreEnabled(context)
@@ -273,21 +259,6 @@ public class ToggleScreenMagnificationPreferenceFragment extends
                null, joinStrings);
    }

    @Override
    protected int getUserShortcutTypes(Context context, @UserShortcutType int defaultValue) {
        final Set<String> info = SharedPreferenceUtils.getUserShortcutTypes(context);
        final Set<String> filtered = info.stream().filter(
                str -> str.contains(MAGNIFICATION_CONTROLLER_NAME)).collect(
                Collectors.toSet());
        if (filtered.isEmpty()) {
            return defaultValue;
        }

        final String str = (String) filtered.toArray()[0];
        final AccessibilityUserShortcutType shortcut = new AccessibilityUserShortcutType(str);
        return shortcut.getType();
    }

    @Override
    protected void callOnAlertDialogCheckboxClicked(DialogInterface dialog, int which) {
        updateUserShortcutType(/* saveChanges= */ true);
@@ -341,7 +312,8 @@ public class ToggleScreenMagnificationPreferenceFragment extends

    @Override
    public void onToggleClicked(ShortcutPreference preference) {
        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE);
        if (preference.isChecked()) {
            optInAllMagnificationValuesToSettings(getPrefContext(), shortcutTypes);
            showDialog(DialogEnums.LAUNCH_ACCESSIBILITY_TUTORIAL);
@@ -355,7 +327,8 @@ public class ToggleScreenMagnificationPreferenceFragment extends
    public void onSettingsClicked(ShortcutPreference preference) {
        // Do not restore shortcut in shortcut chooser dialog when shortcutPreference is turned off.
        mUserShortcutTypesCache = mShortcutPreference.isChecked()
                ? getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE)
                ? retrieveUserShortcutType(getPrefContext(),
                MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE)
                : UserShortcutType.EMPTY;
        showDialog(DialogEnums.MAGNIFICATION_EDIT_SHORTCUT);
    }
@@ -365,10 +338,13 @@ public class ToggleScreenMagnificationPreferenceFragment extends
        // Get the user shortcut type from settings provider.
        mUserShortcutTypes = getUserShortcutTypeFromSettings(getPrefContext());
        if (mUserShortcutTypes != UserShortcutType.EMPTY) {
            setUserShortcutType(getPrefContext(), mUserShortcutTypes);
            final PreferredShortcut shortcut = new PreferredShortcut(
                    MAGNIFICATION_CONTROLLER_NAME, mUserShortcutTypes);
            saveUserShortcutType(getPrefContext(), shortcut);
        } else {
            //  Get the user shortcut type from shared_prefs if cannot get from settings provider.
            mUserShortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
            mUserShortcutTypes = retrieveUserShortcutType(getPrefContext(),
                    MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE);
        }
    }

@@ -389,7 +365,8 @@ public class ToggleScreenMagnificationPreferenceFragment extends

    @Override
    protected void updateShortcutPreference() {
        final int shortcutTypes = getUserShortcutTypes(getPrefContext(), UserShortcutType.SOFTWARE);
        final int shortcutTypes = retrieveUserShortcutType(getPrefContext(),
                MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE);
        mShortcutPreference.setChecked(
                hasMagnificationValuesInSettings(getPrefContext(), shortcutTypes));
        mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
Loading