diff options
author | Daniel Sandler <dsandler@google.com> | 2009-11-20 14:40:00 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2009-11-20 19:55:07 -0500 |
commit | f60e108fa984d823aabad5b691bc248bffe5d1a5 (patch) | |
tree | 39eb7043c499a1516c6ec6038aefbc7f2d7d1302 /core | |
parent | 2a6a149fc2abfb8ef654ed36ce4524209f5e33bc (diff) | |
download | frameworks_base-f60e108fa984d823aabad5b691bc248bffe5d1a5.zip frameworks_base-f60e108fa984d823aabad5b691bc248bffe5d1a5.tar.gz frameworks_base-f60e108fa984d823aabad5b691bc248bffe5d1a5.tar.bz2 |
Don't block TIME_TICK broadcasts in the DigitalClock widget.
This change applies the fix -- originally by phanna in
https://android-git.corp.google.com/g/#change,33669 -- to
the com.android.internal.widget version of DigitalClock,
which is used by the keyguard and pattern lock screens.
Change-Id: I43f72dd144423e55f73ba52903d52163c8f65591
Diffstat (limited to 'core')
-rw-r--r-- | core/java/com/android/internal/widget/DigitalClock.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/com/android/internal/widget/DigitalClock.java b/core/java/com/android/internal/widget/DigitalClock.java index ca71722..fa47ff6 100644 --- a/core/java/com/android/internal/widget/DigitalClock.java +++ b/core/java/com/android/internal/widget/DigitalClock.java @@ -61,7 +61,12 @@ public class DigitalClock extends LinearLayout { Intent.ACTION_TIMEZONE_CHANGED)) { mCalendar = Calendar.getInstance(); } - updateTime(); + // Post a runnable to avoid blocking the broadcast. + mHandler.post(new Runnable() { + public void run() { + updateTime(); + } + }); } }; @@ -133,7 +138,7 @@ public class DigitalClock extends LinearLayout { filter.addAction(Intent.ACTION_TIME_TICK); filter.addAction(Intent.ACTION_TIME_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); - mContext.registerReceiver(mIntentReceiver, filter, null, mHandler); + mContext.registerReceiver(mIntentReceiver, filter); } /* monitor 12/24-hour display preference */ |