Merge "More exhaustive logs from NotificationWakeUpCoordinator" into tm-qpr-dev

This commit is contained in:
Jeff DeCew
2022-12-13 18:53:33 +00:00
committed by Android (Google) Code Review
2 changed files with 32 additions and 13 deletions

View File

@@ -244,7 +244,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
} }
override fun onDozeAmountChanged(linear: Float, eased: Float) { override fun onDozeAmountChanged(linear: Float, eased: Float) {
logger.logOnDozeAmountChanged(linear, eased) logger.logOnDozeAmountChanged(linear = linear, eased = eased)
if (overrideDozeAmountIfAnimatingScreenOff(linear)) { if (overrideDozeAmountIfAnimatingScreenOff(linear)) {
return return
} }
@@ -263,6 +263,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
fun setDozeAmount(linear: Float, eased: Float, source: String) { fun setDozeAmount(linear: Float, eased: Float, source: String) {
val changed = linear != mLinearDozeAmount val changed = linear != mLinearDozeAmount
logger.logSetDozeAmount(linear, eased, source, statusBarStateController.state, changed)
mLinearDozeAmount = linear mLinearDozeAmount = linear
mDozeAmount = eased mDozeAmount = eased
mDozeAmountSource = source mDozeAmountSource = source
@@ -276,7 +277,7 @@ class NotificationWakeUpCoordinator @Inject constructor(
} }
override fun onStateChanged(newState: Int) { override fun onStateChanged(newState: Int) {
logger.logOnStateChanged(newState) logger.logOnStateChanged(newState = newState, storedState = state)
if (state == StatusBarState.SHADE && newState == StatusBarState.SHADE) { if (state == StatusBarState.SHADE && newState == StatusBarState.SHADE) {
// The SHADE -> SHADE transition is only possible as part of cancelling the screen-off // The SHADE -> SHADE transition is only possible as part of cancelling the screen-off
// animation (e.g. by fingerprint unlock). This is done because the system is in an // animation (e.g. by fingerprint unlock). This is done because the system is in an
@@ -324,12 +325,8 @@ class NotificationWakeUpCoordinator @Inject constructor(
private fun overrideDozeAmountIfBypass(): Boolean { private fun overrideDozeAmountIfBypass(): Boolean {
if (bypassController.bypassEnabled) { if (bypassController.bypassEnabled) {
if (statusBarStateController.state == StatusBarState.KEYGUARD) { if (statusBarStateController.state == StatusBarState.KEYGUARD) {
logger.logSetDozeAmount("1.0", "1.0",
"Override: bypass (keyguard)", StatusBarState.KEYGUARD)
setDozeAmount(1f, 1f, source = "Override: bypass (keyguard)") setDozeAmount(1f, 1f, source = "Override: bypass (keyguard)")
} else { } else {
logger.logSetDozeAmount("0.0", "0.0",
"Override: bypass (shade)", statusBarStateController.state)
setDozeAmount(0f, 0f, source = "Override: bypass (shade)") setDozeAmount(0f, 0f, source = "Override: bypass (shade)")
} }
return true return true

View File

@@ -16,22 +16,33 @@ package com.android.systemui.statusbar.notification
import com.android.systemui.log.dagger.NotificationLog import com.android.systemui.log.dagger.NotificationLog
import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogBuffer
import com.android.systemui.plugins.log.LogLevel.DEBUG import com.android.systemui.plugins.log.LogLevel.DEBUG
import com.android.systemui.statusbar.StatusBarState
import javax.inject.Inject import javax.inject.Inject
class NotificationWakeUpCoordinatorLogger class NotificationWakeUpCoordinatorLogger
@Inject @Inject
constructor(@NotificationLog private val buffer: LogBuffer) { constructor(@NotificationLog private val buffer: LogBuffer) {
fun logSetDozeAmount(linear: String, eased: String, source: String, state: Int) { fun logSetDozeAmount(
linear: Float,
eased: Float,
source: String,
state: Int,
changed: Boolean,
) {
buffer.log( buffer.log(
TAG, TAG,
DEBUG, DEBUG,
{ {
str1 = linear double1 = linear.toDouble()
str2 = eased str2 = eased.toString()
str3 = source str3 = source
int1 = state int1 = state
bool1 = changed
}, },
{ "setDozeAmount: linear: $str1, eased: $str2, source: $str3, state: $int1" } {
"setDozeAmount(linear=$double1, eased=$str2, source=$str3)" +
" state=${StatusBarState.toString(int1)} changed=$bool1"
}
) )
} }
@@ -43,12 +54,23 @@ constructor(@NotificationLog private val buffer: LogBuffer) {
double1 = linear.toDouble() double1 = linear.toDouble()
str2 = eased.toString() str2 = eased.toString()
}, },
{ "onDozeAmountChanged($double1, $str2)" } { "onDozeAmountChanged(linear=$double1, eased=$str2)" }
) )
} }
fun logOnStateChanged(newState: Int) { fun logOnStateChanged(newState: Int, storedState: Int) {
buffer.log(TAG, DEBUG, { int1 = newState }, { "onStateChanged($int1)" }) buffer.log(
TAG,
DEBUG,
{
int1 = newState
int2 = storedState
},
{
"onStateChanged(newState=${StatusBarState.toString(int1)})" +
" stored=${StatusBarState.toString(int2)}"
}
)
} }
} }