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

Commit ce4a0c6f authored by Jim Miller's avatar Jim Miller
Browse files

Fix 5906830: Update the clock earlier when lock screen comes back from suspend.

This attempts to fix an issue where sometimes the time shown on lock
screen was really old.  The code now sets the time immediately when the
screen turns on.

Change-Id: Ic4649ea342499aea82f997ba488bc2cb45987739
parent 11001c34
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ public class DigitalClock extends RelativeLayout {
        updateTime();
    }

    private void updateTime() {
    public void updateTime() {
        mCalendar.setTimeInMillis(System.currentTimeMillis());

        CharSequence newTime = DateFormat.format(mFormat, mCalendar);
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.policy.impl;
import com.android.internal.R;
import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.IccCard.State;
import com.android.internal.widget.DigitalClock;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.TransportControlView;
import com.android.internal.policy.impl.KeyguardUpdateMonitor.SimStateCallback;
@@ -105,6 +106,7 @@ class KeyguardStatusViewManager implements OnClickListener {
    private CharSequence mPlmn;
    private CharSequence mSpn;
    protected int mPhoneState;
    private DigitalClock mDigitalClock;

    private class TransientTextManager {
        private TextView mTextView;
@@ -181,6 +183,7 @@ class KeyguardStatusViewManager implements OnClickListener {
        mTransportView = (TransportControlView) findViewById(R.id.transport);
        mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
        mEmergencyCallButtonEnabledInScreen = emergencyButtonEnabledInScreen;
        mDigitalClock = (DigitalClock) findViewById(R.id.time);

        // Hide transport control view until we know we need to show it.
        if (mTransportView != null) {
@@ -290,6 +293,10 @@ class KeyguardStatusViewManager implements OnClickListener {
    /** {@inheritDoc} */
    public void onResume() {
        if (DEBUG) Log.v(TAG, "onResume()");

        // First update the clock
        mDigitalClock.updateTime();

        mUpdateMonitor.registerInfoCallback(mInfoCallback);
        mUpdateMonitor.registerSimStateCallback(mSimStateCallback);
        resetStatusInfo();