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

Commit aa378715 authored by Patrick Scott's avatar Patrick Scott
Browse files

Asynchronously handle TIME_TICK to not block the broadcast.

BUG: 2268458
parent 80124aa0
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -58,8 +58,13 @@ public class DigitalClock extends LinearLayout {
                            Intent.ACTION_TIMEZONE_CHANGED)) {
                    mCalendar = Calendar.getInstance();
                }
                // Post a runnable to avoid blocking the broadcast.
                mHandler.post(new Runnable() {
                        public void run() {
                            updateTime();
                        }
                });
            }
        };

    static class AmPm {
@@ -131,7 +136,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 */