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

Commit 72f7918b authored by Lyn Han's avatar Lyn Han Committed by Android Build Coastguard Worker
Browse files

Revert "Add dumpsys logs to debug lockscreen stack height"

This reverts commit a3316397.

Reason for revert: minimize logging for qpr2

Bug: 265067133

Change-Id: Ife9918c947ff521c7b6fb808a4c8d3ce27a02d67
(cherry picked from commit 8e50c40b0563b9dda8bf6a5d66fa2922526feb16)
Merged-In: Ife9918c947ff521c7b6fb808a4c8d3ce27a02d67
parent 835d37a8
Loading
Loading
Loading
Loading
+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) {