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

Commit e7a5f0bf authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['ag/20911782', 'ag/20911787', 'ag/20928109',...

Merge cherrypicks of ['ag/20911782', 'ag/20911787', 'ag/20928109', 'ag/20931541', 'ag/20946106'] into tm-qpr2-release.

Change-Id: I3b539e4fe213b68109336c1ff1f69640e1dbd30e
parents 068ea566 2a7b7d08
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toolbar;
@@ -74,8 +75,8 @@ public class QSCustomizer extends LinearLayout {
        toolbar.setNavigationIcon(
                getResources().getDrawable(value.resourceId, mContext.getTheme()));

        toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0,
                mContext.getString(com.android.internal.R.string.reset));
        toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0, com.android.internal.R.string.reset)
                .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        toolbar.setTitle(R.string.qs_edit);
        mRecyclerView = findViewById(android.R.id.list);
        mTransparentView = findViewById(R.id.customizer_transparent_view);
+6 −2
Original line number Diff line number Diff line
@@ -175,9 +175,10 @@ class LargeScreenShadeHeaderController @Inject constructor(
     */
    var shadeExpandedFraction = -1f
        set(value) {
            if (visible && field != value) {
            if (field != value) {
                header.alpha = ShadeInterpolation.getContentAlpha(value)
                field = value
                updateVisibility()
            }
        }

@@ -331,6 +332,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
                .setDuration(duration)
                .alpha(if (show) 0f else 1f)
                .setInterpolator(if (show) Interpolators.ALPHA_OUT else Interpolators.ALPHA_IN)
                .setUpdateListener {
                    updateVisibility()
                }
                .start()
    }

@@ -414,7 +418,7 @@ class LargeScreenShadeHeaderController @Inject constructor(
    private fun updateVisibility() {
        val visibility = if (!largeScreenActive && !combinedHeaders || qsDisabled) {
            View.GONE
        } else if (qsVisible) {
        } else if (qsVisible && header.alpha > 0f) {
            View.VISIBLE
        } else {
            View.INVISIBLE
+16 −0
Original line number Diff line number Diff line
@@ -1431,6 +1431,22 @@ public class NotificationChildrenContainer extends ViewGroup
    @Override
    public void applyRoundnessAndInvalidate() {
        boolean last = true;
        if (mUseRoundnessSourceTypes) {
            if (mNotificationHeaderWrapper != null) {
                mNotificationHeaderWrapper.requestTopRoundness(
                        /* value = */ getTopRoundness(),
                        /* sourceType = */ FROM_PARENT,
                        /* animate = */ false
                );
            }
            if (mNotificationHeaderWrapperLowPriority != null) {
                mNotificationHeaderWrapperLowPriority.requestTopRoundness(
                        /* value = */ getTopRoundness(),
                        /* sourceType = */ FROM_PARENT,
                        /* animate = */ false
                );
            }
        }
        for (int i = mAttachedChildren.size() - 1; i >= 0; i--) {
            ExpandableNotificationRow child = mAttachedChildren.get(i);
            if (child.getVisibility() == View.GONE) {
+0 −1
Original line number Diff line number Diff line
@@ -5193,7 +5193,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            println(pw, "intrinsicPadding", mIntrinsicPadding);
            println(pw, "topPadding", mTopPadding);
            println(pw, "bottomPadding", mBottomPadding);
            mNotificationStackSizeCalculator.dump(pw, args);
        });
        pw.println();
        pw.println("Contents:");
+7 −25
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.util.Compile
import com.android.systemui.util.children
import java.io.PrintWriter
import javax.inject.Inject
import kotlin.math.max
import kotlin.math.min
@@ -54,8 +53,6 @@ constructor(
    @Main private val resources: Resources
) {

    private lateinit var lastComputeHeightLog : String

    /**
     * Maximum # notifications to show on Keyguard; extras will be collapsed in an overflow shelf.
     * If there are exactly 1 + mMaxKeyguardNotifications, and they fit in the available space
@@ -117,9 +114,7 @@ constructor(
        shelfIntrinsicHeight: Float
    ): Int {
        log { "\n" }

        val stackHeightSequence = computeHeightPerNotificationLimit(stack, shelfIntrinsicHeight,
            /* computeHeight= */ false)
        val stackHeightSequence = computeHeightPerNotificationLimit(stack, shelfIntrinsicHeight)

        var maxNotifications =
            stackHeightSequence.lastIndexWhile { heightResult ->
@@ -162,21 +157,18 @@ constructor(
        shelfIntrinsicHeight: Float
    ): Float {
        log { "\n" }
        lastComputeHeightLog = ""
        val heightPerMaxNotifications =
            computeHeightPerNotificationLimit(stack, shelfIntrinsicHeight,
                    /* computeHeight= */ true)
            computeHeightPerNotificationLimit(stack, shelfIntrinsicHeight)

        val (notificationsHeight, shelfHeightWithSpaceBefore) =
            heightPerMaxNotifications.elementAtOrElse(maxNotifications) {
                heightPerMaxNotifications.last() // Height with all notifications visible.
            }
        lastComputeHeightLog += "\ncomputeHeight(maxNotifications=$maxNotifications," +
        log {
            "computeHeight(maxNotifications=$maxNotifications," +
                "shelfIntrinsicHeight=$shelfIntrinsicHeight) -> " +
                "${notificationsHeight + shelfHeightWithSpaceBefore}" +
                " = ($notificationsHeight + $shelfHeightWithSpaceBefore)"
        log {
            lastComputeHeightLog
        }
        return notificationsHeight + shelfHeightWithSpaceBefore
    }
@@ -192,8 +184,7 @@ constructor(

    private fun computeHeightPerNotificationLimit(
        stack: NotificationStackScrollLayout,
        shelfHeight: Float,
        computeHeight: Boolean
        shelfHeight: Float
    ): Sequence<StackHeight> = sequence {
        log { "computeHeightPerNotificationLimit" }

@@ -222,14 +213,9 @@ constructor(
                            currentIndex = firstViewInShelfIndex)
                    spaceBeforeShelf + shelfHeight
                }

            val currentLog = "computeHeight | i=$i notificationsHeight=$notifications " +
                "shelfHeightWithSpaceBefore=$shelfWithSpaceBefore"
            if (computeHeight) {
                lastComputeHeightLog += "\n" + currentLog
            }
            log {
                currentLog
                "i=$i notificationsHeight=$notifications " +
                    "shelfHeightWithSpaceBefore=$shelfWithSpaceBefore"
            }
            yield(
                StackHeight(
@@ -274,10 +260,6 @@ constructor(
        return size
    }

    fun dump(pw: PrintWriter, args: Array<out String>) {
        pw.println("NotificationStackSizeCalculator lastComputeHeightLog = $lastComputeHeightLog")
    }

    private fun ExpandableView.isShowable(onLockscreen: Boolean): Boolean {
        if (visibility == GONE || hasNoContentHeight()) return false
        if (onLockscreen) {
Loading