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

Commit c64a3fef authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Notify ClockChangedListeners on main thread

Bug: 146033031
Test: install clock plugin that is direct boot aware. Reboot, and check
that custom clock appears on lock screen.

Change-Id: I350c3d21a11a2c64078c31af3bee9364e3cd9062
parent 91270ddb
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -243,11 +243,12 @@ public final class ClockManager {
        mPreviewClocks.reloadCurrentClock();
        mListeners.forEach((listener, clocks) -> {
            clocks.reloadCurrentClock();
            ClockPlugin clock = clocks.getCurrentClock();
            if (clock instanceof DefaultClockController) {
                listener.onClockChanged(null);
            final ClockPlugin clock = clocks.getCurrentClock();
            if (Looper.myLooper() == Looper.getMainLooper()) {
                listener.onClockChanged(clock instanceof DefaultClockController ? null : clock);
            } else {
                listener.onClockChanged(clock);
                mMainHandler.post(() -> listener.onClockChanged(
                        clock instanceof DefaultClockController ? null : clock));
            }
        });
    }