summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2022-05-20 13:43:49 +0000
committer Jeff DeCew <jeffdq@google.com> 2022-05-21 12:20:05 +0000
commita98b58fe1ccbae1fc214c1b5dc5cbdcd538b6444 (patch)
treed7a47c3e997ff45af111eda82b8af4c5c84935f3
parentbe33a715bf781c81ef16dd8a80e426923a78ac65 (diff)
Allow debug logging of NotificationStackSizeCalculator
Bug: 232079794 Test: adb setprop log.tag.NotifStackSizeCalc VERBOSE ; adb shell am crash com.android.systemui ; adb logcat -s NotifStackSizeCalc Change-Id: Ibdea705b99eec40e3d8075483bddcc02db55209f
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
index 9ea36d540f4d..d05c3385e982 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculator.kt
@@ -28,14 +28,15 @@ import com.android.systemui.statusbar.StatusBarState.KEYGUARD
import com.android.systemui.statusbar.SysuiStatusBarStateController
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 javax.inject.Inject
import kotlin.math.max
import kotlin.math.min
import kotlin.properties.Delegates.notNull
-private const val TAG = "NotificationStackSizeCalculator"
-private const val DEBUG = false
+private const val TAG = "NotifStackSizeCalc"
+private val DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG)
/** Calculates number of notifications to display and the height of the notification stack. */
@SysUISingleton
@@ -229,7 +230,7 @@ constructor(
return true
}
- private fun log(s: () -> String) {
+ private inline fun log(s: () -> String) {
if (DEBUG) {
Log.d(TAG, s())
}