diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 962de99203957..733140e45ad22 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2690,6 +2690,9 @@ public final class NotificationPanelViewController { navigationBarView.onStatusBarPanelStateChanged(); } mShadeExpansionStateManager.onQsExpansionChanged(expanded); + mShadeLog.logQsExpansionChanged("QS Expansion Changed.", expanded, + mQsMinExpansionHeight, mQsMaxExpansionHeight, mStackScrollerOverscrolling, + mDozing, mQsAnimatorExpand, mAnimatingQS); } } @@ -3439,6 +3442,13 @@ public final class NotificationPanelViewController { } private void onHeightUpdated(float expandedHeight) { + if (expandedHeight <= 0) { + mShadeLog.logExpansionChanged("onHeightUpdated: fully collapsed.", + mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); + } else if (isFullyExpanded()) { + mShadeLog.logExpansionChanged("onHeightUpdated: fully expanded.", + mExpandedFraction, isExpanded(), mTracking, mExpansionDragDownAmountPx); + } if (!mQsExpanded || mQsExpandImmediate || mIsExpanding && mQsExpandedWhenExpandingStarted) { // Updating the clock position will set the top padding which might // trigger a new panel height and re-position the clock. @@ -6175,6 +6185,7 @@ public final class NotificationPanelViewController { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: + mShadeLog.logMotionEvent(event, "onTouch: down action"); startExpandMotion(x, y, false /* startTracking */, mExpandedHeight); mMinExpandHeight = 0.0f; mPanelClosedOnDown = isFullyCollapsed(); @@ -6263,6 +6274,7 @@ public final class NotificationPanelViewController { case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: + mShadeLog.logMotionEvent(event, "onTouch: up/cancel action"); addMovement(event); endMotionEvent(event, x, y, false /* forceCancel */); // mHeightAnimator is null, there is no remaining frame, ends instrumenting. diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt index 2b788d85a14c9..7f1bba350af1b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt @@ -77,4 +77,50 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { } ) } + + fun logExpansionChanged( + message: String, + fraction: Float, + expanded: Boolean, + tracking: Boolean, + dragDownPxAmount: Float, + ) { + log(LogLevel.VERBOSE, { + str1 = message + double1 = fraction.toDouble() + bool1 = expanded + bool2 = tracking + long1 = dragDownPxAmount.toLong() + }, { + "$str1 fraction=$double1,expanded=$bool1," + + "tracking=$bool2," + "dragDownPxAmount=$dragDownPxAmount" + }) + } + + fun logQsExpansionChanged( + message: String, + qsExpanded: Boolean, + qsMinExpansionHeight: Int, + qsMaxExpansionHeight: Int, + stackScrollerOverscrolling: Boolean, + dozing: Boolean, + qsAnimatorExpand: Boolean, + animatingQs: Boolean + ) { + log(LogLevel.VERBOSE, { + str1 = message + bool1 = qsExpanded + int1 = qsMinExpansionHeight + int2 = qsMaxExpansionHeight + bool2 = stackScrollerOverscrolling + bool3 = dozing + bool4 = qsAnimatorExpand + // 0 = false, 1 = true + long1 = animatingQs.compareTo(false).toLong() + }, { + "$str1 qsExpanded=$bool1,qsMinExpansionHeight=$int1,qsMaxExpansionHeight=$int2," + + "stackScrollerOverscrolling=$bool2,dozing=$bool3,qsAnimatorExpand=$bool4," + + "animatingQs=$long1" + }) + } }