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

Commit 238c892e authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 11d43794: am de60dd2d: am fcd7ad4e: am 59d73ab6: Merge "Respond to ticks...

am 11d43794: am de60dd2d: am fcd7ad4e: am 59d73ab6: Merge "Respond to ticks when a timezone is set and it doesn\'t display seconds Bug #7489774" into jb-mr1-dev

* commit '11d43794':
  Respond to ticks when a timezone is set and it doesn't display seconds Bug #7489774
parents 777c2d3f 11d43794
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -135,14 +135,12 @@ public class TextClock extends TextView {
    private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (mTimeZone == null) {
                if (intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED)) {
            if (mTimeZone == null && Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
                final String timeZone = intent.getStringExtra("time-zone");
                createTime(timeZone);
            }
            onTimeChanged();
        }
        }
    };

    private final Runnable mTicker = new Runnable() {
@@ -406,13 +404,11 @@ public class TextClock extends TextView {
        boolean hadSeconds = mHasSeconds;
        mHasSeconds = DateFormat.hasSeconds(mFormat);

        if (handleTicker) {
            if (hadSeconds != mHasSeconds) {
        if (handleTicker && mAttached && hadSeconds != mHasSeconds) {
            if (hadSeconds) getHandler().removeCallbacks(mTicker);
            else mTicker.run();
        }
    }
    }

    /**
     * Returns a if not null, else return b if not null, else return c.