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

Commit e5e7a9b0 authored by Steve Elliott's avatar Steve Elliott
Browse files

add dump for status bar notif icon set

Flag: EXEMPT only logging
Bug: 427474197
Test: manual
Change-Id: I69deceffccf42e90a689bfc729becca85aa30a38
parent 75c6182d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import android.content.res.Resources
import android.graphics.Rect
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.plugins.DarkIconDispatcher
import com.android.systemui.res.R
@@ -27,6 +28,7 @@ import com.android.systemui.statusbar.headsup.shared.StatusBarNoHunBehavior
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationIconInteractor
import com.android.systemui.statusbar.notification.icon.domain.interactor.StatusBarNotificationIconsInteractor
import com.android.systemui.statusbar.phone.domain.interactor.DarkIconInteractor
import com.android.systemui.util.kotlin.FlowDumperImpl
import com.android.systemui.util.kotlin.pairwise
import com.android.systemui.util.kotlin.sample
import com.android.systemui.util.ui.AnimatableEvent
@@ -50,12 +52,13 @@ class NotificationIconContainerStatusBarViewModel
constructor(
    @Background private val bgContext: CoroutineContext,
    private val darkIconInteractor: DarkIconInteractor,
    dumpManager: DumpManager,
    iconsInteractor: StatusBarNotificationIconsInteractor,
    headsUpIconInteractor: HeadsUpNotificationIconInteractor,
    keyguardInteractor: KeyguardInteractor,
    @Main resources: Resources,
    shadeInteractor: ShadeInteractor,
) {
) : FlowDumperImpl(dumpManager) {

    private val maxIcons = resources.getInteger(R.integer.max_notif_static_icons)

@@ -92,6 +95,7 @@ constructor(
            .flowOn(bgContext)
            .conflate()
            .distinctUntilChanged()
            .dumpWhileCollecting("icons")

    /** An Icon to show "isolated" in the IconContainer. */
    val isolatedIcon: Flow<AnimatedValue<NotificationIconInfo?>> =
+15 −6
Original line number Diff line number Diff line
@@ -166,6 +166,8 @@ public class NotificationIconContainer extends ViewGroup {
    private IconState mFirstVisibleIconState;
    private float mVisualOverflowStart;
    private boolean mIsShowingOverflowDot;
    private int mFirstOverflowIndex;
    private boolean mWasOverflowForced;
    @Nullable private StatusBarIconView mIsolatedIcon;
    @Nullable private Rect mIsolatedIconLocation;
    private final int[] mAbsolutePosition = new int[2];
@@ -293,7 +295,12 @@ public class NotificationIconContainer extends ViewGroup {
                + " overrideIconColor=" + mOverrideIconColor
                + ", maxIcons=" + mMaxIcons
                + ", isStaticLayout=" + mIsStaticLayout
                + ", iconSize=" + mIconSize
                + ", rightBound=" + getRightBound()
                + ", themedTextColorPrimary=#" + Integer.toHexString(mThemedTextColorPrimary)
                + ", showingOverflowDot=" + mIsShowingOverflowDot
                + ", firstOverflowIndex=" + mFirstOverflowIndex
                + ", wasOverflowForced=" + mWasOverflowForced
                + " }";
    }

@@ -481,7 +488,9 @@ public class NotificationIconContainer extends ViewGroup {
     */
    public void calculateIconXTranslations() {
        float translationX = getLeftBound();
        int firstOverflowIndex = -1;
        mFirstOverflowIndex = -1;
        mIsShowingOverflowDot = false;
        mWasOverflowForced = false;
        int childCount = getChildCount();
        int maxVisibleIcons = mMaxIcons;
        float layoutRight = getRightBound();
@@ -509,18 +518,18 @@ public class NotificationIconContainer extends ViewGroup {
                    /* isLastChild= */ i == childCount - 1, translationX, layoutRight, mIconSize);

            // First icon to overflow.
            if (firstOverflowIndex == -1 && isOverflowing) {
                firstOverflowIndex = i;
            if (mFirstOverflowIndex == -1 && isOverflowing) {
                mFirstOverflowIndex = i;
                mWasOverflowForced = forceOverflow;
                mVisualOverflowStart = translationX;
            }

            final float drawingScale = getDrawingScale(view);
            translationX += iconState.iconAppearAmount * view.getWidth() * drawingScale;
        }
        mIsShowingOverflowDot = false;
        if (firstOverflowIndex != -1) {
        if (mFirstOverflowIndex != -1) {
            translationX = mVisualOverflowStart;
            for (int i = firstOverflowIndex; i < childCount; i++) {
            for (int i = mFirstOverflowIndex; i < childCount; i++) {
                View view = getChildAt(i);
                IconState iconState = mIconStates.get(view);
                int dotWidth = mStaticDotDiameter + mDotPadding;
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.icon.ui.viewmodel

import android.content.res.mainResources
import com.android.systemui.dump.dumpManager
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testDispatcher
@@ -30,6 +31,7 @@ val Kosmos.notificationIconContainerStatusBarViewModel by
        NotificationIconContainerStatusBarViewModel(
            bgContext = testDispatcher,
            darkIconInteractor = darkIconInteractor,
            dumpManager = dumpManager,
            iconsInteractor = statusBarNotificationIconsInteractor,
            headsUpIconInteractor = headsUpNotificationIconInteractor,
            keyguardInteractor = keyguardInteractor,