Merge "Allow debug logging of NotificationStackSizeCalculator" into tm-dev am: 53c5e67df6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18530881

Change-Id: I0eb1efb9cd1faf02ee30f8e8b788e20b1e0cbeb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jeff DeCew
2022-05-23 22:33:43 +00:00
committed by Automerger Merge Worker

View File

@@ -28,14 +28,15 @@ import com.android.systemui.statusbar.StatusBarState.KEYGUARD
import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.notification.row.ExpandableView
import com.android.systemui.util.Compile
import com.android.systemui.util.children import com.android.systemui.util.children
import javax.inject.Inject import javax.inject.Inject
import kotlin.math.max import kotlin.math.max
import kotlin.math.min import kotlin.math.min
import kotlin.properties.Delegates.notNull import kotlin.properties.Delegates.notNull
private const val TAG = "NotificationStackSizeCalculator" private const val TAG = "NotifStackSizeCalc"
private const val DEBUG = false private val DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG)
/** Calculates number of notifications to display and the height of the notification stack. */ /** Calculates number of notifications to display and the height of the notification stack. */
@SysUISingleton @SysUISingleton
@@ -229,7 +230,7 @@ constructor(
return true return true
} }
private fun log(s: () -> String) { private inline fun log(s: () -> String) {
if (DEBUG) { if (DEBUG) {
Log.d(TAG, s()) Log.d(TAG, s())
} }