Add debug logs for haptics in NotificationPanelViewController.

Bug: 258138790
Test: manually, can see the logs in dump.
Change-Id: I84502e6837dbd935fa81f15d6a1a4f574ba83a0f
This commit is contained in:
Chandru S
2022-12-13 15:19:51 +00:00
parent 0a33f42345
commit 06fe9de637
2 changed files with 11 additions and 0 deletions

View File

@@ -4721,6 +4721,7 @@ public final class NotificationPanelViewController implements Dumpable {
if (!openingWithTouch || !mHasVibratedOnOpen) {
mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
mHasVibratedOnOpen = true;
mShadeLog.v("Vibrating on opening, mHasVibratedOnOpen=true");
}
}
}
@@ -6104,6 +6105,7 @@ public final class NotificationPanelViewController implements Dumpable {
if (isFullyCollapsed()) {
// If panel is fully collapsed, reset haptic effect before adding movement.
mHasVibratedOnOpen = false;
mShadeLog.logHasVibrated(mHasVibratedOnOpen, mExpandedFraction);
}
addMovement(event);
if (!isFullyCollapsed()) {

View File

@@ -117,6 +117,15 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
})
}
fun logHasVibrated(hasVibratedOnOpen: Boolean, fraction: Float) {
log(LogLevel.VERBOSE, {
bool1 = hasVibratedOnOpen
double1 = fraction.toDouble()
}, {
"hasVibratedOnOpen=$bool1, expansionFraction=$double1"
})
}
fun logQsExpansionChanged(
message: String,
qsExpanded: Boolean,