summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TextClock.java
diff options
context:
space:
mode:
authorLucas Dupin <dupin@google.com>2019-05-21 00:33:41 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-21 00:33:41 -0700
commit96bc353645a04528847af6a82d47fd9bfc00125f (patch)
tree763e35a01526f1ba9866505c9fe1cb23f53d699d /core/java/android/widget/TextClock.java
parenta03eb8e10cd5adbfe4905eb16f348641080d6825 (diff)
parent300b7ac0d8d1273ecbcd00c8e9031470bc3359f2 (diff)
Merge "Merge "Refresh should always update the field" into qt-dev am: ae61369c0d am: b87abd1b90" into qt-r1-dev-plus-aosp
am: 300b7ac0d8 Change-Id: I95368f7a6f83a738edbd8af99495fce3d31ce68c
Diffstat (limited to 'core/java/android/widget/TextClock.java')
-rw-r--r--core/java/android/widget/TextClock.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java
index cbf1e05136c0..3aef737f4daf 100644
--- a/core/java/android/widget/TextClock.java
+++ b/core/java/android/widget/TextClock.java
@@ -175,6 +175,9 @@ public class TextClock extends TextView {
if (mTimeZone == null && Intent.ACTION_TIMEZONE_CHANGED.equals(intent.getAction())) {
final String timeZone = intent.getStringExtra("time-zone");
createTime(timeZone);
+ } else if (!mShouldRunTicker && (Intent.ACTION_TIME_TICK.equals(intent.getAction())
+ || Intent.ACTION_TIME_CHANGED.equals(intent.getAction()))) {
+ return;
}
onTimeChanged();
}
@@ -645,12 +648,9 @@ public class TextClock extends TextView {
*/
@UnsupportedAppUsage
private void onTimeChanged() {
- // mShouldRunTicker always equals the last value passed into onVisibilityAggregated
- if (mShouldRunTicker) {
- mTime.setTimeInMillis(System.currentTimeMillis());
- setText(DateFormat.format(mFormat, mTime));
- setContentDescription(DateFormat.format(mDescFormat, mTime));
- }
+ mTime.setTimeInMillis(System.currentTimeMillis());
+ setText(DateFormat.format(mFormat, mTime));
+ setContentDescription(DateFormat.format(mDescFormat, mTime));
}
/** @hide */