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

Commit a8a63dd7 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android Git Automerger
Browse files

am 154e2d7d: Merge "Flush the clock format when the locale changes." into jb-mr1.1-dev

* commit '154e2d7d':
  Flush the clock format when the locale changes.
parents 4b77660b 154e2d7d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.widget.TextView;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;

import com.android.internal.R;
@@ -52,6 +53,7 @@ public class Clock extends TextView {
    private Calendar mCalendar;
    private String mClockFormatString;
    private SimpleDateFormat mClockFormat;
    private Locale mLocale;

    private static final int AM_PM_STYLE_NORMAL  = 0;
    private static final int AM_PM_STYLE_SMALL   = 1;
@@ -117,6 +119,12 @@ public class Clock extends TextView {
                if (mClockFormat != null) {
                    mClockFormat.setTimeZone(mCalendar.getTimeZone());
                }
            } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
                final Locale newLocale = getResources().getConfiguration().locale;
                if (! newLocale.equals(mLocale)) {
                    mLocale = newLocale;
                    mClockFormatString = ""; // force refresh
                }
            }
            updateClock();
        }