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

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

Add dozeTimeTick method to ClockPlugin interface.

dozeTimeTick implementations provided by clock plugins
should update the time of the clock while the device
is dozing and deal with burn-in related issues.

Bug: 119035943
Test: KeyguardClockSwitchTest passes locally.
Test: Custom clock updates with time on AOD screen.
Change-Id: I5c31e6d856c5a80dc3e501831dda5a62c0be5ba0
parent f517f971
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -13,11 +13,11 @@
 */
package com.android.systemui.plugins;

import com.android.systemui.plugins.annotations.ProvidesInterface;

import android.graphics.Paint.Style;
import android.view.View;

import com.android.systemui.plugins.annotations.ProvidesInterface;

/**
 * This plugin is used to replace main clock in keyguard.
 */
@@ -44,4 +44,9 @@ public interface ClockPlugin extends Plugin {
     * @param color A color value.
     */
    void setTextColor(int color);

    /**
     * Notifies that time tick alarm from doze service fired.
     */
    default void dozeTimeTick() { }
}
+9 −0
Original line number Diff line number Diff line
@@ -142,6 +142,15 @@ public class KeyguardClockSwitch extends FrameLayout {
        mClockView.refresh();
    }

    /**
     * Notifies that time tick alarm from doze service fired.
     */
    public void dozeTimeTick() {
        if (mClockPlugin != null) {
            mClockPlugin.dozeTimeTick();
        }
    }

    /**
     * When plugin changes, set all kept parameters into newer plugin.
     */
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import com.android.internal.widget.ViewClippingUtil;
import com.android.systemui.Dependency;
import com.android.systemui.Interpolators;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.util.wakelock.KeepAwakeAnimationListener;

import com.google.android.collect.Sets;

@@ -276,6 +275,7 @@ public class KeyguardStatusView extends GridLayout implements
    public void dozeTimeTick() {
        refreshTime();
        mKeyguardSlice.refresh();
        mClockView.dozeTimeTick();
    }

    private void refreshTime() {