Merge "More logging for pause non-detection" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-30 03:20:50 +00:00
committed by Android (Google) Code Review
3 changed files with 35 additions and 3 deletions
@@ -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;
}
@@ -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);
}
@@ -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);
}