From 83692b8a8c5eedfb5abc775f755a1549d9fcd654 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Fri, 17 Jun 2022 11:05:19 -0400 Subject: [PATCH] Determine if NPVC is intercepting touches from footer In normal cases, in taps on the FooterActionsView area, we should see NPVC#onInterceptTouchEvent called and then FooterActionsView#onInterceptTouchEvent. However, if NPVC is intercepting the touches, the second call won't happen. To enable, run: adb shell setprop log.tag.PanelView VERBOSE adb shell setprop log.tag.FooterActionsView VERBOSE adb shell am crash com.android.systemui This will restart SystemUI so needs to be done before observing the issue. Bug: 235072946 Test: logcat Change-Id: Ie0eaf9441162fc380ed373916a2acd824c8da930 --- .../android/systemui/qs/FooterActionsView.kt | 18 +++++++++++++++++- .../phone/NotificationPanelViewController.java | 5 +++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/FooterActionsView.kt b/packages/SystemUI/src/com/android/systemui/qs/FooterActionsView.kt index 3417d4977fa43..05038b7b1b1d7 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/FooterActionsView.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/FooterActionsView.kt @@ -22,6 +22,8 @@ import android.graphics.drawable.Drawable import android.graphics.drawable.RippleDrawable import android.os.UserManager import android.util.AttributeSet +import android.util.Log +import android.view.MotionEvent import android.view.View import android.widget.ImageView import android.widget.LinearLayout @@ -101,4 +103,18 @@ class FooterActionsView(context: Context?, attrs: AttributeSet?) : LinearLayout( } multiUserAvatar.setImageDrawable(pictureToSet) } -} \ No newline at end of file + + override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean { + if (VERBOSE) Log.d(TAG, "FooterActionsView onInterceptTouchEvent ${ev?.string}") + return super.onInterceptTouchEvent(ev) + } + + override fun onTouchEvent(event: MotionEvent?): Boolean { + if (VERBOSE) Log.d(TAG, "FooterActionsView onTouchEvent ${event?.string}") + return super.onTouchEvent(event) + } +} +private const val TAG = "FooterActionsView" +private val VERBOSE = Log.isLoggable(TAG, Log.VERBOSE) +private val MotionEvent.string + get() = "($id): ($x,$y)" \ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 557c995586df2..2cac0017db9c3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -4142,6 +4142,11 @@ public class NotificationPanelViewController extends PanelViewController { @Override public boolean onInterceptTouchEvent(MotionEvent event) { + if (SPEW_LOGCAT) { + Log.v(TAG, + "NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX() + + "," + event.getY() + ")"); + } if (mBlockTouches || mQs.disallowPanelTouches()) { return false; }