Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bd19b03 authored by Justin Weir's avatar Justin Weir
Browse files

Additional logging for dropped shade touches

Add additional info to log buffers to help debug a cluster of recent
issues related to dropped Shade touches.

Bug: 341596939
Bug: 341916203
Test: Logging only, so presubmits are sufficient
Flag: EXEMPT logging only
Change-Id: I8ca94078f8faeebf65e14d6536c6ef229586d945
parent ebd2d073
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -427,7 +427,11 @@ public class NotificationShadeWindowViewController implements Dumpable {
                            } else {
                                return logDownDispatch(ev, "hidden or hiding", true);
                            }
                        } else {
                            mShadeLogger.d("NSWVC: bouncer not showing");
                        }
                    } else {
                        mShadeLogger.d("NSWVC: touch not within view");
                    }
                } else if (mIsTrackingBarGesture) {
                    final boolean sendToStatusBar = mStatusBarViewController.sendTouchToView(ev);
@@ -437,6 +441,9 @@ public class NotificationShadeWindowViewController implements Dumpable {
                    return logDownDispatch(ev, "sending bar gesture to status bar",
                            sendToStatusBar);
                }
                if (isDown) {
                    mShadeLogger.logNoTouchDispatch(mIsTrackingBarGesture, mExpandAnimationRunning);
                }
                return logDownDispatch(ev, "no custom touch dispatch of down event", null);
            }

@@ -698,12 +705,22 @@ public class NotificationShadeWindowViewController implements Dumpable {

    @Override
    public void dump(PrintWriter pw, String[] args) {
        pw.print("  mExpandingBelowNotch=");
        pw.println(mExpandingBelowNotch);
        pw.print("  mExpandAnimationRunning=");
        pw.println(mExpandAnimationRunning);
        pw.print("  mTouchCancelled=");
        pw.println(mTouchCancelled);
        pw.print("  mExternalTouchIntercepted=");
        pw.println(mExternalTouchIntercepted);
        pw.print("  mIsOcclusionTransitionRunning=");
        pw.println(mIsOcclusionTransitionRunning);
        pw.print("  mIsTrackingBarGesture=");
        pw.println(mIsTrackingBarGesture);
        pw.print("  mLaunchAnimationTimeout=");
        pw.println(mLaunchAnimationTimeout);
        pw.print("  mTouchActive=");
        pw.println(mTouchActive);
        pw.print("  mTouchCancelled=");
        pw.println(mTouchCancelled);
    }

    @VisibleForTesting
+97 −83
Original line number Diff line number Diff line
@@ -88,9 +88,7 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
                int1 = event.action
                int2 = event.classification
            },
                {
                    "$str1: eventTime=$long1,downTime=$long2,action=$int1,class=$int2"
                }
            { "$str1: eventTime=$long1,downTime=$long2,action=$int1,class=$int2" }
        )
    }

@@ -105,7 +103,8 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
                long2 = event.downTime
            },
            {
                    val prefix = when (result) {
                val prefix =
                    when (result) {
                        true -> "SHADE TOUCH REROUTED"
                        false -> "SHADE TOUCH BLOCKED"
                        null -> "SHADE TOUCH DISPATCHED"
@@ -158,7 +157,8 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
            },
            {
                "$str1 fraction=$double1,expanded=$bool1," +
                    "tracking=$bool2," + "dragDownPxAmount=$dragDownPxAmount"
                    "tracking=$bool2," +
                    "dragDownPxAmount=$dragDownPxAmount"
            }
        )
    }
@@ -176,14 +176,7 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
    }

    fun logQsExpandImmediateChanged(newValue: Boolean) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                bool1 = newValue
            },
            { "qsExpandImmediate=$bool1" }
        )
        buffer.log(TAG, LogLevel.VERBOSE, { bool1 = newValue }, { "qsExpandImmediate=$bool1" })
    }

    fun logQsExpansionChanged(
@@ -227,8 +220,10 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
            },
            {
                "PulsingGestureListener#onSingleTapUp all of this must true for single " +
               "tap to be detected: isDozing: $bool1, singleTapEnabled: $bool2, isNotDocked: $bool3"
        })
                    "tap to be detected: isDozing: $bool1, singleTapEnabled: $bool2," +
                    " isNotDocked: $bool3"
            }
        )
    }

    fun logSingleTapUpFalsingState(proximityIsNotNear: Boolean, isNotFalseTap: Boolean) {
@@ -294,9 +289,11 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
                bool1 = expansionOverHalf
                bool2 = allowExpandForSmallExpansion
            },
            { "NPVC flingExpands called with vel: $long1, vectorVel: $long2, " +
            {
                "NPVC flingExpands called with vel: $long1, vectorVel: $long2, " +
                    "interactionType: $int1, minVelocityPxPerSecond: $double1 " +
                    "expansionOverHalf: $bool1, allowExpandForSmallExpansion: $bool2" }
                    "expansionOverHalf: $bool1, allowExpandForSmallExpansion: $bool2"
            }
        )
    }

@@ -338,9 +335,7 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                str1 = panelState.panelStateToString()
            },
            { str1 = panelState.panelStateToString() },
            { "New panel State: $str1" }
        )
    }
@@ -357,7 +352,8 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
        )
    }

    private fun flingTypeToString(flingType: Int) = when (flingType) {
    private fun flingTypeToString(flingType: Int) =
        when (flingType) {
            FLING_EXPAND -> "FLING_EXPAND"
            FLING_COLLAPSE -> "FLING_COLLAPSE"
            FLING_HIDE -> "FLING_HIDE"
@@ -397,4 +393,22 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
            }
        )
    }

    fun logNoTouchDispatch(
        isTrackingBarGesture: Boolean,
        isExpandAnimationRunning: Boolean,
    ) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                bool1 = isTrackingBarGesture
                bool2 = isExpandAnimationRunning
            },
            {
                "NSWVC: touch not dispatched: isTrackingBarGesture: $bool1, " +
                    "isExpandAnimationRunning: $bool2"
            }
        )
    }
}