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

Commit c2754952 authored by Hawkwood Glazier's avatar Hawkwood Glazier
Browse files

Add ClockId to AOD CUJs

Bug: 295896924
Test: Manually checked CUJ logging
Change-Id: I06c03cb43ba7a482c2f3c7aaaae7ea2df26e900c
parent 9c708647
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ class DefaultClockController(
    private val defaultLineSpacing = resources.getFloat(R.dimen.keyguard_clock_line_spacing_scale)

    override val events: DefaultClockEvents
    override val config = ClockConfig()
    override val config = ClockConfig(DEFAULT_CLOCK_ID)

    init {
        val parent = FrameLayout(ctx)
+2 −0
Original line number Diff line number Diff line
@@ -196,6 +196,8 @@ data class ClockMetadata(

/** Render configuration for the full clock. Modifies the way systemUI behaves with this clock. */
data class ClockConfig(
    val id: String,

    /** Transition to AOD should move smartspace like large clock instead of small clock */
    val useAlternateSmartspaceAODTransition: Boolean = false,

+9 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import java.lang.annotation.RetentionPolicy;
public class KeyguardClockSwitch extends RelativeLayout {

    private static final String TAG = "KeyguardClockSwitch";
    public static final String MISSING_CLOCK_ID = "CLOCK_MISSING";

    private static final long CLOCK_OUT_MILLIS = 133;
    private static final long CLOCK_IN_MILLIS = 167;
@@ -190,6 +191,14 @@ public class KeyguardClockSwitch extends RelativeLayout {
        return mLogBuffer;
    }

    /** Returns the id of the currently rendering clock */
    public String getClockId() {
        if (mClock == null) {
            return MISSING_CLOCK_ID;
        }
        return mClock.getConfig().getId();
    }

    void setClock(ClockController clock, int statusBarState) {
        mClock = clock;

+22 −0
Original line number Diff line number Diff line
@@ -48,8 +48,10 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.internal.jank.InteractionJankMonitor.Configuration;
import com.android.internal.logging.UiEventLogger;
import com.android.keyguard.KeyguardClockSwitch;
import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
@@ -420,6 +422,25 @@ public class StatusBarStateControllerImpl implements
        }
    }

    /** Returns the id of the currently rendering clock */
    public String getClockId() {
        if (mView == null) {
            return KeyguardClockSwitch.MISSING_CLOCK_ID;
        }

        View clockSwitch = mView.findViewById(R.id.keyguard_clock_container);
        if (clockSwitch == null) {
            Log.e(TAG, "Clock container was missing");
            return KeyguardClockSwitch.MISSING_CLOCK_ID;
        }
        if (!(clockSwitch instanceof KeyguardClockSwitch)) {
            Log.e(TAG, "Clock container was incorrect type: " + clockSwitch);
            return KeyguardClockSwitch.MISSING_CLOCK_ID;
        }

        return ((KeyguardClockSwitch) clockSwitch).getClockId();
    }

    private void beginInteractionJankMonitor() {
        final boolean shouldPost =
                (mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1);
@@ -429,6 +450,7 @@ public class StatusBarStateControllerImpl implements
                        Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null);
            } else {
                Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView)
                        .setTag(getClockId())
                        .setDeferMonitorForAnimationStart(false);
                mInteractionJankMonitor.begin(builder);
            }
+8 −4
Original line number Diff line number Diff line
@@ -223,10 +223,14 @@ class UnlockedScreenOffAnimationController @Inject constructor(
                }
                .setCustomInterpolator(View.ALPHA, Interpolators.FAST_OUT_SLOW_IN),
            true /* animate */)
        interactionJankMonitor.begin(
                notifShadeWindowControllerLazy.get().windowRootView,
            CUJ_SCREEN_OFF_SHOW_AOD
        val builder = InteractionJankMonitor.Configuration.Builder
            .withView(
                    InteractionJankMonitor.CUJ_SCREEN_OFF_SHOW_AOD,
                    notifShadeWindowControllerLazy.get().windowRootView
            )
            .setTag(statusBarStateControllerImpl.getClockId())

        interactionJankMonitor.begin(builder)
    }

    override fun onStartedWakingUp() {
Loading