Add additional logging for b/227115380

We've narrowed down the behavior of the bug to the if statement in
the move handling in onQsIntercept, but we need more logging to find
out why that check isn't activating.

Bug: 227115380
Test: atest and manual
Change-Id: I7b6b2e276b45a724d4a23007b6e07ed97bcf049b
This commit is contained in:
Justin Weir
2022-10-12 11:39:44 -04:00
parent ed10f73b9d
commit b9b3c7e1d9
2 changed files with 62 additions and 31 deletions

View File

@@ -1903,7 +1903,8 @@ public final class NotificationPanelViewController extends PanelViewController {
mShadeLog.logMotionEvent(event,
"onQsIntercept: move ignored because qs tracking disabled");
}
if ((h > getTouchSlop(event) || (h < -getTouchSlop(event) && mQsExpanded))
float touchSlop = getTouchSlop(event);
if ((h > touchSlop || (h < -touchSlop && mQsExpanded))
&& Math.abs(h) > Math.abs(x - mInitialTouchX)
&& shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, h)) {
if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept - start tracking expansion");
@@ -1918,6 +1919,9 @@ public final class NotificationPanelViewController extends PanelViewController {
mInitialTouchX = x;
mNotificationStackScrollLayoutController.cancelLongPress();
return true;
} else {
mShadeLog.logQsTrackingNotStarted(mInitialTouchY, y, h, touchSlop, mQsExpanded,
mCollapsedOnDown, mKeyguardShowing, isQsExpansionEnabled());
}
break;

View File

@@ -11,38 +11,65 @@ import javax.inject.Inject
private const val TAG = "systemui.shade"
/** Lightweight logging utility for the Shade. */
class ShadeLogger @Inject constructor(
@ShadeLog
private val buffer: LogBuffer
) {
fun v(@CompileTimeConstant msg: String) {
buffer.log(TAG, LogLevel.VERBOSE, msg)
}
class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
fun v(@CompileTimeConstant msg: String) {
buffer.log(TAG, LogLevel.VERBOSE, msg)
}
private inline fun log(
logLevel: LogLevel,
initializer: LogMessage.() -> Unit,
noinline printer: LogMessage.() -> String
) {
buffer.log(TAG, logLevel, initializer, printer)
}
private inline fun log(
logLevel: LogLevel,
initializer: LogMessage.() -> Unit,
noinline printer: LogMessage.() -> String
) {
buffer.log(TAG, logLevel, initializer, printer)
}
fun onQsInterceptMoveQsTrackingEnabled(h: Float) {
log(LogLevel.VERBOSE,
{ double1 = h.toDouble() },
{ "onQsIn[tercept: move action, QS tracking enabled. h = $double1" })
}
fun onQsInterceptMoveQsTrackingEnabled(h: Float) {
log(
LogLevel.VERBOSE,
{ double1 = h.toDouble() },
{ "onQsIntercept: move action, QS tracking enabled. h = $double1" })
}
fun logMotionEvent(event: MotionEvent, message: String) {
log(LogLevel.VERBOSE, {
str1 = message
long1 = event.eventTime
long2 = event.downTime
int1 = event.action
int2 = event.classification
double1 = event.y.toDouble()
}, {
"$str1\neventTime=$long1,downTime=$long2,y=$double1,action=$int1,classification=$int2"
fun logQsTrackingNotStarted(
initialTouchY: Float,
y: Float,
h: Float,
touchSlop: Float,
qsExpanded: Boolean,
collapsedOnDown: Boolean,
keyguardShowing: Boolean,
qsExpansionEnabled: Boolean
) {
log(
LogLevel.VERBOSE,
{
int1 = initialTouchY.toInt()
int2 = y.toInt()
long1 = h.toLong()
double1 = touchSlop.toDouble()
bool1 = qsExpanded
bool2 = collapsedOnDown
bool3 = keyguardShowing
bool4 = qsExpansionEnabled
},
{
"QsTrackingNotStarted: initTouchY=$int1,y=$int2,h=$long1,slop=$double1,qsExpanded=" +
"$bool1,collapsedDown=$bool2,keyguardShowing=$bool3,qsExpansion=$bool4"
})
}
}
fun logMotionEvent(event: MotionEvent, message: String) {
log(
LogLevel.VERBOSE,
{
str1 = message
long1 = event.eventTime
long2 = event.downTime
int1 = event.action
int2 = event.classification
double1 = event.y.toDouble()
},
{ "$str1\neventTime=$long1,downTime=$long2,y=$double1,action=$int1,classification=$int2" })
}
}