Loading packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +14 −0 Original line number Diff line number Diff line Loading @@ -5681,6 +5681,7 @@ public final class NotificationPanelViewController { /** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */ public boolean onInterceptTouchEvent(MotionEvent event) { mShadeLog.logMotionEvent(event, "NPVC onInterceptTouchEvent"); if (SPEW_LOGCAT) { Log.v(TAG, "NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX() Loading @@ -5693,6 +5694,8 @@ public final class NotificationPanelViewController { // 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. if (mCentralSurfaces.isBouncerShowing()) { mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "bouncer is showing"); return true; } if (mCommandQueue.panelsEnabled() Loading @@ -5700,15 +5703,21 @@ public final class NotificationPanelViewController { && mHeadsUpTouchHelper.onInterceptTouchEvent(event)) { mMetricsLogger.count(COUNTER_PANEL_OPEN, 1); mMetricsLogger.count(COUNTER_PANEL_OPEN_PEEK, 1); mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "HeadsUpTouchHelper"); return true; } if (!shouldQuickSettingsIntercept(mDownX, mDownY, 0) && mPulseExpansionHandler.onInterceptTouchEvent(event)) { mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "PulseExpansionHandler"); return true; } if (!isFullyCollapsed() && onQsIntercept(event)) { debugLog("onQsIntercept true"); mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "QsIntercept"); return true; } if (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled || (mMotionAborted Loading Loading @@ -5739,6 +5748,9 @@ public final class NotificationPanelViewController { if (mAnimatingOnDown && mClosing && !mHintAnimationRunning) { cancelHeightAnimator(); mTouchSlopExceeded = true; mShadeLog.v("NotificationPanelViewController MotionEvent intercepted:" + " mAnimatingOnDown: true, mClosing: true, mHintAnimationRunning:" + " false"); return true; } mInitialExpandY = y; Loading Loading @@ -5783,6 +5795,8 @@ public final class NotificationPanelViewController { && hAbs > Math.abs(x - mInitialExpandX)) { cancelHeightAnimator(); startExpandMotion(x, y, true /* startTracking */, mExpandedHeight); mShadeLog.v("NotificationPanelViewController MotionEvent" + " intercepted: startExpandMotion"); return true; } } Loading packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt +14 −8 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ class PulsingGestureListener @Inject constructor( private val centralSurfaces: CentralSurfaces, private val ambientDisplayConfiguration: AmbientDisplayConfiguration, private val statusBarStateController: StatusBarStateController, private val shadeLogger: ShadeLogger, tunerService: TunerService, dumpManager: DumpManager ) : GestureDetector.SimpleOnGestureListener(), Dumpable { Loading @@ -77,18 +78,23 @@ class PulsingGestureListener @Inject constructor( } override fun onSingleTapUp(e: MotionEvent): Boolean { if (statusBarStateController.isDozing && singleTapEnabled && !dockManager.isDocked && !falsingManager.isProximityNear && !falsingManager.isFalseTap(LOW_PENALTY) ) { val isNotDocked = !dockManager.isDocked shadeLogger.logSingleTapUp(statusBarStateController.isDozing, singleTapEnabled, isNotDocked) if (statusBarStateController.isDozing && singleTapEnabled && isNotDocked) { val proximityIsNotNear = !falsingManager.isProximityNear val isNotAFalseTap = !falsingManager.isFalseTap(LOW_PENALTY) shadeLogger.logSingleTapUpFalsingState(proximityIsNotNear, isNotAFalseTap) if (proximityIsNotNear && isNotAFalseTap) { shadeLogger.d("Single tap handled, requesting centralSurfaces.wakeUpIfDozing") centralSurfaces.wakeUpIfDozing( SystemClock.uptimeMillis(), notificationShadeWindowView, "PULSING_SINGLE_TAP") "PULSING_SINGLE_TAP" ) } return true } shadeLogger.d("onSingleTapUp event ignored") return false } Loading packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,10 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { buffer.log(TAG, LogLevel.VERBOSE, msg) } fun d(@CompileTimeConstant msg: String) { buffer.log(TAG, LogLevel.DEBUG, msg) } private inline fun log( logLevel: LogLevel, initializer: LogMessage.() -> Unit, Loading Loading @@ -123,4 +127,25 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { "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" }) } } packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +26 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ import com.android.systemui.util.Assert; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.LargeScreenUtils; import com.google.errorprone.annotations.CompileTimeConstant; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.util.ArrayList; Loading Loading @@ -3693,6 +3695,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.INPUT) void handleEmptySpaceClick(MotionEvent ev) { logEmptySpaceClick(ev, isBelowLastNotification(mInitialTouchX, mInitialTouchY), mStatusBarState, mTouchIsClick); switch (ev.getActionMasked()) { case MotionEvent.ACTION_MOVE: final float touchSlop = getTouchSlop(ev); Loading @@ -3704,10 +3708,32 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable case MotionEvent.ACTION_UP: if (mStatusBarState != StatusBarState.KEYGUARD && mTouchIsClick && isBelowLastNotification(mInitialTouchX, mInitialTouchY)) { debugLog("handleEmptySpaceClick: touch event propagated further"); mOnEmptySpaceClickListener.onEmptySpaceClicked(mInitialTouchX, mInitialTouchY); } 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) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt +21 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.systemui.statusbar.notification.stack import com.android.systemui.log.dagger.NotificationHeadsUpLog 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.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.logKey Loading @@ -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_CLICK import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER import com.google.errorprone.annotations.CompileTimeConstant import javax.inject.Inject class NotificationStackScrollLogger @Inject constructor( Loading Loading @@ -56,6 +58,25 @@ class NotificationStackScrollLogger @Inject constructor( "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" No newline at end of file Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +14 −0 Original line number Diff line number Diff line Loading @@ -5681,6 +5681,7 @@ public final class NotificationPanelViewController { /** @see ViewGroup#onInterceptTouchEvent(MotionEvent) */ public boolean onInterceptTouchEvent(MotionEvent event) { mShadeLog.logMotionEvent(event, "NPVC onInterceptTouchEvent"); if (SPEW_LOGCAT) { Log.v(TAG, "NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX() Loading @@ -5693,6 +5694,8 @@ public final class NotificationPanelViewController { // 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. if (mCentralSurfaces.isBouncerShowing()) { mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "bouncer is showing"); return true; } if (mCommandQueue.panelsEnabled() Loading @@ -5700,15 +5703,21 @@ public final class NotificationPanelViewController { && mHeadsUpTouchHelper.onInterceptTouchEvent(event)) { mMetricsLogger.count(COUNTER_PANEL_OPEN, 1); mMetricsLogger.count(COUNTER_PANEL_OPEN_PEEK, 1); mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "HeadsUpTouchHelper"); return true; } if (!shouldQuickSettingsIntercept(mDownX, mDownY, 0) && mPulseExpansionHandler.onInterceptTouchEvent(event)) { mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "PulseExpansionHandler"); return true; } if (!isFullyCollapsed() && onQsIntercept(event)) { debugLog("onQsIntercept true"); mShadeLog.v("NotificationPanelViewController MotionEvent intercepted: " + "QsIntercept"); return true; } if (mInstantExpanding || !mNotificationsDragEnabled || mTouchDisabled || (mMotionAborted Loading Loading @@ -5739,6 +5748,9 @@ public final class NotificationPanelViewController { if (mAnimatingOnDown && mClosing && !mHintAnimationRunning) { cancelHeightAnimator(); mTouchSlopExceeded = true; mShadeLog.v("NotificationPanelViewController MotionEvent intercepted:" + " mAnimatingOnDown: true, mClosing: true, mHintAnimationRunning:" + " false"); return true; } mInitialExpandY = y; Loading Loading @@ -5783,6 +5795,8 @@ public final class NotificationPanelViewController { && hAbs > Math.abs(x - mInitialExpandX)) { cancelHeightAnimator(); startExpandMotion(x, y, true /* startTracking */, mExpandedHeight); mShadeLog.v("NotificationPanelViewController MotionEvent" + " intercepted: startExpandMotion"); return true; } } Loading
packages/SystemUI/src/com/android/systemui/shade/PulsingGestureListener.kt +14 −8 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ class PulsingGestureListener @Inject constructor( private val centralSurfaces: CentralSurfaces, private val ambientDisplayConfiguration: AmbientDisplayConfiguration, private val statusBarStateController: StatusBarStateController, private val shadeLogger: ShadeLogger, tunerService: TunerService, dumpManager: DumpManager ) : GestureDetector.SimpleOnGestureListener(), Dumpable { Loading @@ -77,18 +78,23 @@ class PulsingGestureListener @Inject constructor( } override fun onSingleTapUp(e: MotionEvent): Boolean { if (statusBarStateController.isDozing && singleTapEnabled && !dockManager.isDocked && !falsingManager.isProximityNear && !falsingManager.isFalseTap(LOW_PENALTY) ) { val isNotDocked = !dockManager.isDocked shadeLogger.logSingleTapUp(statusBarStateController.isDozing, singleTapEnabled, isNotDocked) if (statusBarStateController.isDozing && singleTapEnabled && isNotDocked) { val proximityIsNotNear = !falsingManager.isProximityNear val isNotAFalseTap = !falsingManager.isFalseTap(LOW_PENALTY) shadeLogger.logSingleTapUpFalsingState(proximityIsNotNear, isNotAFalseTap) if (proximityIsNotNear && isNotAFalseTap) { shadeLogger.d("Single tap handled, requesting centralSurfaces.wakeUpIfDozing") centralSurfaces.wakeUpIfDozing( SystemClock.uptimeMillis(), notificationShadeWindowView, "PULSING_SINGLE_TAP") "PULSING_SINGLE_TAP" ) } return true } shadeLogger.d("onSingleTapUp event ignored") return false } Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,10 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { buffer.log(TAG, LogLevel.VERBOSE, msg) } fun d(@CompileTimeConstant msg: String) { buffer.log(TAG, LogLevel.DEBUG, msg) } private inline fun log( logLevel: LogLevel, initializer: LogMessage.() -> Unit, Loading Loading @@ -123,4 +127,25 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { "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" }) } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +26 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ import com.android.systemui.util.Assert; import com.android.systemui.util.DumpUtilsKt; import com.android.systemui.util.LargeScreenUtils; import com.google.errorprone.annotations.CompileTimeConstant; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.util.ArrayList; Loading Loading @@ -3693,6 +3695,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.INPUT) void handleEmptySpaceClick(MotionEvent ev) { logEmptySpaceClick(ev, isBelowLastNotification(mInitialTouchX, mInitialTouchY), mStatusBarState, mTouchIsClick); switch (ev.getActionMasked()) { case MotionEvent.ACTION_MOVE: final float touchSlop = getTouchSlop(ev); Loading @@ -3704,10 +3708,32 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable case MotionEvent.ACTION_UP: if (mStatusBarState != StatusBarState.KEYGUARD && mTouchIsClick && isBelowLastNotification(mInitialTouchX, mInitialTouchY)) { debugLog("handleEmptySpaceClick: touch event propagated further"); mOnEmptySpaceClickListener.onEmptySpaceClicked(mInitialTouchX, mInitialTouchY); } 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) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLogger.kt +21 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.systemui.statusbar.notification.stack import com.android.systemui.log.dagger.NotificationHeadsUpLog 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.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.logKey Loading @@ -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_CLICK import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER import com.google.errorprone.annotations.CompileTimeConstant import javax.inject.Inject class NotificationStackScrollLogger @Inject constructor( Loading Loading @@ -56,6 +58,25 @@ class NotificationStackScrollLogger @Inject constructor( "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" No newline at end of file