From 77d8903f4a567bc91b0938b009d33316ea3fa4c1 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Fri, 29 May 2020 19:41:11 -0700 Subject: [PATCH] More logging for pause non-detection Bug: 156044202 Change-Id: I0831735aa743360c16e1f940c30875f32432fec5 --- .../NavBarToHomeTouchController.java | 3 +-- .../launcher3/views/FloatingIconView.java | 10 ++++++++ .../android/launcher3/views/ListenerView.java | 25 ++++++++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java index bf0690c77d..2ae90a5c57 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java @@ -116,8 +116,7 @@ public class NavBarToHomeTouchController implements TouchController, if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.PAUSE_NOT_DETECTED, "NavBarToHomeTouchController.canInterceptTouch true 2 " - + AbstractFloatingView.getTopOpenView(mLauncher).getClass() - .getSimpleName()); + + AbstractFloatingView.getTopOpenView(mLauncher)); } return true; } diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index bd12e06b60..177aff4a89 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -59,6 +59,7 @@ import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.shortcuts.DeepShortcutView; +import com.android.launcher3.testing.TestProtocol; /** * A view that is created to look like another view with the purpose of creating fluid animations. @@ -560,6 +561,11 @@ public class FloatingIconView extends FrameLayout implements view.setVisibility(INVISIBLE); parent.addView(view); dragLayer.addView(view.mListenerView); + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "getFloatingIconView. listenerView " + + "added to dragLayer. listenerView=" + view.mListenerView + ", fiv=" + view, + new Exception()); + } view.mListenerView.setListener(view::fastFinish); view.mEndRunnable = () -> { @@ -639,6 +645,10 @@ public class FloatingIconView extends FrameLayout implements private void finish(DragLayer dragLayer) { ((ViewGroup) dragLayer.getParent()).removeView(this); dragLayer.removeView(mListenerView); + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "listenerView removed from dragLayer. " + + "listenerView=" + mListenerView + ", fiv=" + this, new Exception()); + } recycle(); mLauncher.getViewCache().recycleView(R.layout.floating_icon_view, this); } diff --git a/src/com/android/launcher3/views/ListenerView.java b/src/com/android/launcher3/views/ListenerView.java index 263f7c4c32..575f86454c 100644 --- a/src/com/android/launcher3/views/ListenerView.java +++ b/src/com/android/launcher3/views/ListenerView.java @@ -17,18 +17,20 @@ package com.android.launcher3.views; import android.content.Context; import android.util.AttributeSet; +import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import com.android.launcher3.AbstractFloatingView; +import com.android.launcher3.testing.TestProtocol; /** * An invisible AbstractFloatingView that can run a callback when it is being closed. */ public class ListenerView extends AbstractFloatingView { - public Runnable mCloseListener; + private Runnable mCloseListener; public ListenerView(Context context, AttributeSet attrs) { super(context, attrs); @@ -36,12 +38,20 @@ public class ListenerView extends AbstractFloatingView { } public void setListener(Runnable listener) { + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView setListener lv=" + this + + ", listener=" + listener, new Exception()); + } mCloseListener = listener; } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView onAttachedToWindow lv=" + this, + new Exception()); + } mIsOpen = true; } @@ -49,10 +59,19 @@ public class ListenerView extends AbstractFloatingView { protected void onDetachedFromWindow() { super.onDetachedFromWindow(); mIsOpen = false; + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView onDetachedFromView lv=" + this, + new Exception()); + } } @Override protected void handleClose(boolean animate) { + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView handeClose lv=" + this + + ", mIsOpen=" + mIsOpen + ", mCloseListener=" + mCloseListener + + ", getParent()=" + getParent(), new Exception()); + } if (mIsOpen) { if (mCloseListener != null) { mCloseListener.run(); @@ -77,6 +96,10 @@ public class ListenerView extends AbstractFloatingView { @Override public boolean onControllerInterceptTouchEvent(MotionEvent ev) { + if (TestProtocol.sDebugTracing) { + Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView touchEvent lv=" + this + + ", ev=" + ev, new Exception()); + } if (ev.getAction() == MotionEvent.ACTION_DOWN) { handleClose(false); }