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

Commit cb5514ec authored by Fan Zhang's avatar Fan Zhang Committed by Android Git Automerger
Browse files

am 60f57daa: Use hardcoded locale to do toUpperCase to parse ClockStyle.

* commit '60f57daa':
  Use hardcoded locale to do toUpperCase to parse ClockStyle.
parents 2bfbe42d 60f57daa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.deskclock.data.DataModel.ClockStyle;
import com.android.deskclock.settings.ScreensaverSettingsActivity;
import com.android.deskclock.settings.SettingsActivity;

import java.util.Locale;
import java.util.TimeZone;

/**
@@ -127,7 +128,9 @@ final class SettingsDAO {
        final String defaultStyle = context.getString(R.string.default_clock_style);
        final SharedPreferences prefs = getSharedPreferences(context);
        final String clockStyle = prefs.getString(prefKey, defaultStyle);
        return ClockStyle.valueOf(clockStyle.toUpperCase());
        // Use hardcoded locale to perform toUpperCase, because in some languages toUpperCase adds
        // accent to character, which breaks the enum conversion.
        return ClockStyle.valueOf(clockStyle.toUpperCase(Locale.US));
    }

    private static SharedPreferences getSharedPreferences(Context context) {