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

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

Merge "Change to use CaseMap.toTitle in shortcut type summary to handle...

Merge "Change to use CaseMap.toTitle in shortcut type summary to handle different locale." into rvc-dev
parents 3370e030 43eb71bc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.icu.text.CaseMap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -61,6 +62,7 @@ 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;
@@ -581,7 +583,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
        }
        if ((shortcutTypes & UserShortcutType.HARDWARE) == UserShortcutType.HARDWARE) {
            final CharSequence hardwareTitle = context.getText(
                    R.string.accessibility_shortcut_edit_dialog_title_hardware);
                    R.string.accessibility_shortcut_hardware_keyword);
            list.add(hardwareTitle);
        }

@@ -590,7 +592,9 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
            list.add(softwareTitle);
        }
        final String joinStrings = TextUtils.join(/* delimiter= */", ", list);
        return AccessibilityUtil.capitalize(joinStrings);

        return CaseMap.toTitle().wholeString().noLowercase().apply(Locale.getDefault(), /* iter= */
                null, joinStrings);
    }

    protected int getUserShortcutTypes(Context context, @UserShortcutType int defaultValue) {
+7 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.icu.text.CaseMap;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
@@ -56,6 +57,7 @@ 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;
@@ -348,13 +350,13 @@ public class ToggleScreenMagnificationPreferenceFragment extends
        }
        if ((shortcutType & UserShortcutType.HARDWARE) == UserShortcutType.HARDWARE) {
            final CharSequence hardwareTitle = context.getText(
                    R.string.accessibility_shortcut_edit_dialog_title_hardware);
                    R.string.accessibility_shortcut_hardware_keyword);
            list.add(hardwareTitle);
        }

        if ((shortcutType & UserShortcutType.TRIPLETAP) == UserShortcutType.TRIPLETAP) {
            final CharSequence tripleTapTitle = context.getText(
                    R.string.accessibility_shortcut_edit_dialog_title_triple_tap);
                    R.string.accessibility_shortcut_triple_tap_keyword);
            list.add(tripleTapTitle);
        }

@@ -363,7 +365,9 @@ public class ToggleScreenMagnificationPreferenceFragment extends
            list.add(softwareTitle);
        }
        final String joinStrings = TextUtils.join(/* delimiter= */", ", list);
        return AccessibilityUtil.capitalize(joinStrings);

        return CaseMap.toTitle().wholeString().noLowercase().apply(Locale.getDefault(), /* iter= */
                null, joinStrings);
    }

    @Override