Merge "Add debug logs with LogBuffer for touch/tap events" into tm-qpr-dev am: ad23a83ccf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20272304 Change-Id: I8124cce51035a34f94a5e044faedff327e3aabba Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -5681,6 +5681,7 @@ public final class NotificationPanelViewController {
|
|||||||
|
|
||||||
/** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */
|
/** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */
|
||||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||||
|
mShadeLog.logMotionEvent(event, "NPVC onInterceptTouchEvent");
|
||||||
if (SPEW_LOGCAT) {
|
if (SPEW_LOGCAT) {
|
||||||
Log.v(TAG,
|
Log.v(TAG,
|
||||||
"NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX()
|
"NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX()
|
||||||
@@ -5693,6 +5694,8 @@ public final class NotificationPanelViewController {
|
|||||||
// Do not let touches go to shade or QS if the bouncer is visible,
|
// Do not let touches go to shade or QS if the bouncer is visible,
|
||||||
// but still let user swipe down to expand the panel, dismissing the bouncer.
|
// but still let user swipe down to expand the panel, dismissing the bouncer.
|
||||||
if (mCentralSurfaces.isBouncerShowing()) {
|
if (mCentralSurfaces.isBouncerShowing()) {
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: "
|
||||||
|
+ "bouncer is showing");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mCommandQueue.panelsEnabled()
|
if (mCommandQueue.panelsEnabled()
|
||||||
@@ -5700,15 +5703,21 @@ public final class NotificationPanelViewController {
|
|||||||
&& mHeadsUpTouchHelper.onInterceptTouchEvent(event)) {
|
&& mHeadsUpTouchHelper.onInterceptTouchEvent(event)) {
|
||||||
mMetricsLogger.count(COUNTER_PANEL_OPEN, 1);
|
mMetricsLogger.count(COUNTER_PANEL_OPEN, 1);
|
||||||
mMetricsLogger.count(COUNTER_PANEL_OPEN_PEEK, 1);
|
mMetricsLogger.count(COUNTER_PANEL_OPEN_PEEK, 1);
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: "
|
||||||
|
+ "HeadsUpTouchHelper");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!shouldQuickSettingsIntercept(mDownX, mDownY, 0)
|
if (!shouldQuickSettingsIntercept(mDownX, mDownY, 0)
|
||||||
&& mPulseExpansionHandler.onInterceptTouchEvent(event)) {
|
&& mPulseExpansionHandler.onInterceptTouchEvent(event)) {
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: "
|
||||||
|
+ "PulseExpansionHandler");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFullyCollapsed() && onQsIntercept(event)) {
|
if (!isFullyCollapsed() && onQsIntercept(event)) {
|
||||||
debugLog("onQsIntercept true");
|
debugLog("onQsIntercept true");
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: "
|
||||||
|
+ "QsIntercept");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled || (mMotionAborted
|
if (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled || (mMotionAborted
|
||||||
@@ -5739,6 +5748,9 @@ public final class NotificationPanelViewController {
|
|||||||
if (mAnimatingOnDown && mClosing && !mHintAnimationRunning) {
|
if (mAnimatingOnDown && mClosing && !mHintAnimationRunning) {
|
||||||
cancelHeightAnimator();
|
cancelHeightAnimator();
|
||||||
mTouchSlopExceeded = true;
|
mTouchSlopExceeded = true;
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent intercepted:"
|
||||||
|
+ " mAnimatingOnDown: true, mClosing: true, mHintAnimationRunning:"
|
||||||
|
+ " false");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
mInitialExpandY = y;
|
mInitialExpandY = y;
|
||||||
@@ -5783,6 +5795,8 @@ public final class NotificationPanelViewController {
|
|||||||
&& hAbs > Math.abs(x - mInitialExpandX)) {
|
&& hAbs > Math.abs(x - mInitialExpandX)) {
|
||||||
cancelHeightAnimator();
|
cancelHeightAnimator();
|
||||||
startExpandMotion(x, y, true /* startTracking */, mExpandedHeight);
|
startExpandMotion(x, y, true /* startTracking */, mExpandedHeight);
|
||||||
|
mShadeLog.v("NotificationPanelViewController MotionEvent"
|
||||||
|
+ " intercepted: startExpandMotion");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class PulsingGestureListener @Inject constructor(
|
|||||||
private val centralSurfaces: CentralSurfaces,
|
private val centralSurfaces: CentralSurfaces,
|
||||||
private val ambientDisplayConfiguration: AmbientDisplayConfiguration,
|
private val ambientDisplayConfiguration: AmbientDisplayConfiguration,
|
||||||
private val statusBarStateController: StatusBarStateController,
|
private val statusBarStateController: StatusBarStateController,
|
||||||
|
private val shadeLogger: ShadeLogger,
|
||||||
tunerService: TunerService,
|
tunerService: TunerService,
|
||||||
dumpManager: DumpManager
|
dumpManager: DumpManager
|
||||||
) : GestureDetector.SimpleOnGestureListener(), Dumpable {
|
) : GestureDetector.SimpleOnGestureListener(), Dumpable {
|
||||||
@@ -77,18 +78,23 @@ class PulsingGestureListener @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onSingleTapUp(e: MotionEvent): Boolean {
|
override fun onSingleTapUp(e: MotionEvent): Boolean {
|
||||||
if (statusBarStateController.isDozing &&
|
val isNotDocked = !dockManager.isDocked
|
||||||
singleTapEnabled &&
|
shadeLogger.logSingleTapUp(statusBarStateController.isDozing, singleTapEnabled, isNotDocked)
|
||||||
!dockManager.isDocked &&
|
if (statusBarStateController.isDozing && singleTapEnabled && isNotDocked) {
|
||||||
!falsingManager.isProximityNear &&
|
val proximityIsNotNear = !falsingManager.isProximityNear
|
||||||
!falsingManager.isFalseTap(LOW_PENALTY)
|
val isNotAFalseTap = !falsingManager.isFalseTap(LOW_PENALTY)
|
||||||
) {
|
shadeLogger.logSingleTapUpFalsingState(proximityIsNotNear, isNotAFalseTap)
|
||||||
centralSurfaces.wakeUpIfDozing(
|
if (proximityIsNotNear && isNotAFalseTap) {
|
||||||
|
shadeLogger.d("Single tap handled, requesting centralSurfaces.wakeUpIfDozing")
|
||||||
|
centralSurfaces.wakeUpIfDozing(
|
||||||
SystemClock.uptimeMillis(),
|
SystemClock.uptimeMillis(),
|
||||||
notificationShadeWindowView,
|
notificationShadeWindowView,
|
||||||
"PULSING_SINGLE_TAP")
|
"PULSING_SINGLE_TAP"
|
||||||
|
)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
shadeLogger.d("onSingleTapUp event ignored")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
|
|||||||
buffer.log(TAG, LogLevel.VERBOSE, msg)
|
buffer.log(TAG, LogLevel.VERBOSE, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun d(@CompileTimeConstant msg: String) {
|
||||||
|
buffer.log(TAG, LogLevel.DEBUG, msg)
|
||||||
|
}
|
||||||
|
|
||||||
private inline fun log(
|
private inline fun log(
|
||||||
logLevel: LogLevel,
|
logLevel: LogLevel,
|
||||||
initializer: LogMessage.() -> Unit,
|
initializer: LogMessage.() -> Unit,
|
||||||
@@ -123,4 +127,25 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
|
|||||||
"animatingQs=$long1"
|
"animatingQs=$long1"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun logSingleTapUp(isDozing: Boolean, singleTapEnabled: Boolean, isNotDocked: Boolean) {
|
||||||
|
log(LogLevel.DEBUG, {
|
||||||
|
bool1 = isDozing
|
||||||
|
bool2 = singleTapEnabled
|
||||||
|
bool3 = isNotDocked
|
||||||
|
}, {
|
||||||
|
"PulsingGestureListener#onSingleTapUp all of this must true for single " +
|
||||||
|
"tap to be detected: isDozing: $bool1, singleTapEnabled: $bool2, isNotDocked: $bool3"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fun logSingleTapUpFalsingState(proximityIsNotNear: Boolean, isNotFalseTap: Boolean) {
|
||||||
|
log(LogLevel.DEBUG, {
|
||||||
|
bool1 = proximityIsNotNear
|
||||||
|
bool2 = isNotFalseTap
|
||||||
|
}, {
|
||||||
|
"PulsingGestureListener#onSingleTapUp all of this must true for single " +
|
||||||
|
"tap to be detected: proximityIsNotNear: $bool1, isNotFalseTap: $bool2"
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ import com.android.systemui.util.Assert;
|
|||||||
import com.android.systemui.util.DumpUtilsKt;
|
import com.android.systemui.util.DumpUtilsKt;
|
||||||
import com.android.systemui.util.LargeScreenUtils;
|
import com.android.systemui.util.LargeScreenUtils;
|
||||||
|
|
||||||
|
import com.google.errorprone.annotations.CompileTimeConstant;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -3693,6 +3695,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
|
|
||||||
@ShadeViewRefactor(RefactorComponent.INPUT)
|
@ShadeViewRefactor(RefactorComponent.INPUT)
|
||||||
void handleEmptySpaceClick(MotionEvent ev) {
|
void handleEmptySpaceClick(MotionEvent ev) {
|
||||||
|
logEmptySpaceClick(ev, isBelowLastNotification(mInitialTouchX, mInitialTouchY),
|
||||||
|
mStatusBarState, mTouchIsClick);
|
||||||
switch (ev.getActionMasked()) {
|
switch (ev.getActionMasked()) {
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
final float touchSlop = getTouchSlop(ev);
|
final float touchSlop = getTouchSlop(ev);
|
||||||
@@ -3704,12 +3708,34 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
if (mStatusBarState != StatusBarState.KEYGUARD && mTouchIsClick &&
|
if (mStatusBarState != StatusBarState.KEYGUARD && mTouchIsClick &&
|
||||||
isBelowLastNotification(mInitialTouchX, mInitialTouchY)) {
|
isBelowLastNotification(mInitialTouchX, mInitialTouchY)) {
|
||||||
|
debugLog("handleEmptySpaceClick: touch event propagated further");
|
||||||
mOnEmptySpaceClickListener.onEmptySpaceClicked(mInitialTouchX, mInitialTouchY);
|
mOnEmptySpaceClickListener.onEmptySpaceClicked(mInitialTouchX, mInitialTouchY);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
debugLog("handleEmptySpaceClick: MotionEvent ignored");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void debugLog(@CompileTimeConstant String s) {
|
||||||
|
if (mLogger == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLogger.d(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void logEmptySpaceClick(MotionEvent ev, boolean isTouchBelowLastNotification,
|
||||||
|
int statusBarState, boolean touchIsClick) {
|
||||||
|
if (mLogger == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mLogger.logEmptySpaceClick(
|
||||||
|
isTouchBelowLastNotification,
|
||||||
|
statusBarState,
|
||||||
|
touchIsClick,
|
||||||
|
MotionEvent.actionToString(ev.getActionMasked()));
|
||||||
|
}
|
||||||
|
|
||||||
@ShadeViewRefactor(RefactorComponent.INPUT)
|
@ShadeViewRefactor(RefactorComponent.INPUT)
|
||||||
void initDownStates(MotionEvent ev) {
|
void initDownStates(MotionEvent ev) {
|
||||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.android.systemui.statusbar.notification.stack
|
|||||||
|
|
||||||
import com.android.systemui.log.dagger.NotificationHeadsUpLog
|
import com.android.systemui.log.dagger.NotificationHeadsUpLog
|
||||||
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.INFO
|
import com.android.systemui.plugins.log.LogLevel.INFO
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||||
import com.android.systemui.statusbar.notification.logKey
|
import com.android.systemui.statusbar.notification.logKey
|
||||||
@@ -10,6 +11,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll
|
|||||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR
|
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR
|
||||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK
|
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK
|
||||||
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER
|
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER
|
||||||
|
import com.google.errorprone.annotations.CompileTimeConstant
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class NotificationStackScrollLogger @Inject constructor(
|
class NotificationStackScrollLogger @Inject constructor(
|
||||||
@@ -56,6 +58,25 @@ class NotificationStackScrollLogger @Inject constructor(
|
|||||||
"key: $str1 expected: $bool1 actual: $bool2"
|
"key: $str1 expected: $bool1 actual: $bool2"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun d(@CompileTimeConstant msg: String) = buffer.log(TAG, DEBUG, msg)
|
||||||
|
|
||||||
|
fun logEmptySpaceClick(
|
||||||
|
isBelowLastNotification: Boolean,
|
||||||
|
statusBarState: Int,
|
||||||
|
touchIsClick: Boolean,
|
||||||
|
motionEventDesc: String
|
||||||
|
) {
|
||||||
|
buffer.log(TAG, DEBUG, {
|
||||||
|
int1 = statusBarState
|
||||||
|
bool1 = touchIsClick
|
||||||
|
bool2 = isBelowLastNotification
|
||||||
|
str1 = motionEventDesc
|
||||||
|
}, {
|
||||||
|
"handleEmptySpaceClick: statusBarState: $int1 isTouchAClick: $bool1 " +
|
||||||
|
"isTouchBelowNotification: $bool2 motionEvent: $str1"
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val TAG = "NotificationStackScroll"
|
private const val TAG = "NotificationStackScroll"
|
||||||
@@ -66,6 +66,8 @@ class PulsingGestureListenerTest : SysuiTestCase() {
|
|||||||
private lateinit var dumpManager: DumpManager
|
private lateinit var dumpManager: DumpManager
|
||||||
@Mock
|
@Mock
|
||||||
private lateinit var statusBarStateController: StatusBarStateController
|
private lateinit var statusBarStateController: StatusBarStateController
|
||||||
|
@Mock
|
||||||
|
private lateinit var shadeLogger: ShadeLogger
|
||||||
|
|
||||||
private lateinit var tunableCaptor: ArgumentCaptor<Tunable>
|
private lateinit var tunableCaptor: ArgumentCaptor<Tunable>
|
||||||
private lateinit var underTest: PulsingGestureListener
|
private lateinit var underTest: PulsingGestureListener
|
||||||
@@ -81,6 +83,7 @@ class PulsingGestureListenerTest : SysuiTestCase() {
|
|||||||
centralSurfaces,
|
centralSurfaces,
|
||||||
ambientDisplayConfiguration,
|
ambientDisplayConfiguration,
|
||||||
statusBarStateController,
|
statusBarStateController,
|
||||||
|
shadeLogger,
|
||||||
tunerService,
|
tunerService,
|
||||||
dumpManager
|
dumpManager
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user