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

Commit f5b912cb authored by Lalit Kansara's avatar Lalit Kansara
Browse files

Lock screen does not show AM/PM in 12 hours format time

12 hours format time should reflect in lock screen as well. It just
shows time in HH:MM format but the expected format is HH:MM AM/PM.

Change-Id: I507bc8374bf09f2e1658b80e43bbf35006daf922
parent 02f22862
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1450,4 +1450,7 @@
            1xRTT voice call, irrespective of IMS registration state  -->
    <bool name="config_send_sms1x_on_voice_call">true</bool>

    <!-- Should the device show AM/PM in unlock screen -->
    <bool name="config_show_ampm_in_unlock_screen">false</bool>

</resources>
+4 −0
Original line number Diff line number Diff line
@@ -1822,4 +1822,8 @@
  <!-- sim refresh for dual mode card -->
  <java-symbol type="bool" name="config_sim_refresh_for_dual_mode_card" />
  <java-symbol type="bool" name="config_global_phone_enabled" />

  <!-- From keyguard for showing am/pm in unlock screen -->
  <java-symbol type="bool" name="config_show_ampm_in_unlock_screen" />

</resources>
+11 −4
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ public class KeyguardStatusView extends GridLayout {
        mAlarmStatusView = (TextView) findViewById(R.id.alarm_status);
        mDateView = (TextClock) findViewById(R.id.date_view);
        mClockView = (TextClock) findViewById(R.id.clock_view);
        mClockView.setEllipsize(null);
        mLockPatternUtils = new LockPatternUtils(getContext());
        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
        setEnableMarquee(screenOn);
@@ -156,11 +157,17 @@ public class KeyguardStatusView extends GridLayout {
            dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel);

            clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel);
            boolean showAmPm = context.getResources().getBoolean(
                com.android.internal.R.bool.config_show_ampm_in_unlock_screen);

            if (showAmPm == false) {
                // CLDR insists on adding an AM/PM indicator even though it wasn't in the skeleton
                // format.  The following code removes the AM/PM indicator if we didn't want it.
                if (!clockView12Skel.contains("a")) {
                    clockView12 = clockView12.replaceAll("a", "").trim();
                }
            }


            clockView24 = DateFormat.getBestDateTimePattern(locale, clockView24Skel);