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 'fcd7ad4e28df6a408e84c6d2b2f425b029efbfbe':
  Respond to ticks when a timezone is set and it doesn't display seconds Bug #7489774
This commit is contained in:
Romain Guy
2012-11-07 11:22:43 -08:00
committed by Android Git Automerger

View File

@@ -135,13 +135,11 @@ 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)) {
final String timeZone = intent.getStringExtra("time-zone");
createTime(timeZone);
}
onTimeChanged();
if (mTimeZone == null && Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
final String timeZone = intent.getStringExtra("time-zone");
createTime(timeZone);
}
onTimeChanged();
}
};
@@ -406,11 +404,9 @@ public class TextClock extends TextView {
boolean hadSeconds = mHasSeconds;
mHasSeconds = DateFormat.hasSeconds(mFormat);
if (handleTicker) {
if (hadSeconds != mHasSeconds) {
if (hadSeconds) getHandler().removeCallbacks(mTicker);
else mTicker.run();
}
if (handleTicker && mAttached && hadSeconds != mHasSeconds) {
if (hadSeconds) getHandler().removeCallbacks(mTicker);
else mTicker.run();
}
}