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

Commit c37ae1c5 authored by Stefan Andonian's avatar Stefan Andonian
Browse files

Stop clock icon from jankily changing on user tap.

Previously, when a user clicked on the clock icon, the icon redrew
itself to an incorrect time for a split second before the clock
application was launched. This change disables this janky redraw.

Bug: 188377749
Test: Verified bug no longer occurs after change.
Change-Id: Ie38573c45e1f634c306b7e1556b146d58bfe376e
parent 81f8cb36
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -422,6 +422,18 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
            reschedule();
        }

        @Override
        public boolean setState(int[] stateSet) {
            // If the user has just pressed the clock icon, and the clock app is launching,
            // we don't want to change the time shown. Doing so can result in jank.
            for (int state: stateSet) {
                if (state == android.R.attr.state_pressed) {
                    return false;
                }
            }
            return super.setState(stateSet);
        }

        @Override
        public boolean isThemed() {
            return mBgPaint.getColorFilter() != null;