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

Commit 29c7477f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 806091c6 c8985aa0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2082,4 +2082,7 @@

   <!-- Controlling respond call via sms feature via config item -->
   <bool name="config_reject_call_via_sms_enabled">true</bool>

   <!-- Should the device show AM/PM in unlock screen -->
   <bool name="config_show_ampm_in_unlock_screen">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -2218,4 +2218,7 @@
  <java-symbol type="integer" name="ascrollboost_cpuboost" />
  <java-symbol type="integer" name="ascrollboost_pcdisbl" />
  <java-symbol type="bool" name="config_reject_call_via_sms_enabled"/>

  <!-- From keyguard for showing am/pm in unlock screen -->
  <java-symbol type="bool" name="config_show_ampm_in_unlock_screen" />
</resources>
+10 −4
Original line number Diff line number Diff line
@@ -109,6 +109,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);
        mOwnerInfo = (TextView) findViewById(R.id.owner_info);
        mLockPatternUtils = new LockPatternUtils(getContext());
        final boolean screenOn = KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
@@ -243,11 +244,16 @@ public class KeyguardStatusView extends GridLayout {
            }

            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);