Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 291f393b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents ac38ec99 77d8903f
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -116,8 +116,7 @@ public class NavBarToHomeTouchController implements TouchController,
            if (TestProtocol.sDebugTracing) {
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.PAUSE_NOT_DETECTED,
                Log.d(TestProtocol.PAUSE_NOT_DETECTED,
                        "NavBarToHomeTouchController.canInterceptTouch true 2 "
                        "NavBarToHomeTouchController.canInterceptTouch true 2 "
                                + AbstractFloatingView.getTopOpenView(mLauncher).getClass()
                                + AbstractFloatingView.getTopOpenView(mLauncher));
                                .getSimpleName());
            }
            }
            return true;
            return true;
        }
        }
+10 −0
Original line number Original line Diff line number Diff line
@@ -59,6 +59,7 @@ import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.shortcuts.DeepShortcutView;
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.
 * 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);
        view.setVisibility(INVISIBLE);
        parent.addView(view);
        parent.addView(view);
        dragLayer.addView(view.mListenerView);
        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.mListenerView.setListener(view::fastFinish);


        view.mEndRunnable = () -> {
        view.mEndRunnable = () -> {
@@ -639,6 +645,10 @@ public class FloatingIconView extends FrameLayout implements
    private void finish(DragLayer dragLayer) {
    private void finish(DragLayer dragLayer) {
        ((ViewGroup) dragLayer.getParent()).removeView(this);
        ((ViewGroup) dragLayer.getParent()).removeView(this);
        dragLayer.removeView(mListenerView);
        dragLayer.removeView(mListenerView);
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "listenerView removed from dragLayer. "
                    + "listenerView=" + mListenerView + ", fiv=" + this, new Exception());
        }
        recycle();
        recycle();
        mLauncher.getViewCache().recycleView(R.layout.floating_icon_view, this);
        mLauncher.getViewCache().recycleView(R.layout.floating_icon_view, this);
    }
    }
+24 −1
Original line number Original line Diff line number Diff line
@@ -17,18 +17,20 @@ package com.android.launcher3.views;


import android.content.Context;
import android.content.Context;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;


import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.testing.TestProtocol;


/**
/**
 * An invisible AbstractFloatingView that can run a callback when it is being closed.
 * An invisible AbstractFloatingView that can run a callback when it is being closed.
 */
 */
public class ListenerView extends AbstractFloatingView {
public class ListenerView extends AbstractFloatingView {


    public Runnable mCloseListener;
    private Runnable mCloseListener;


    public ListenerView(Context context, AttributeSet attrs) {
    public ListenerView(Context context, AttributeSet attrs) {
        super(context, attrs);
        super(context, attrs);
@@ -36,12 +38,20 @@ public class ListenerView extends AbstractFloatingView {
    }
    }


    public void setListener(Runnable listener) {
    public void setListener(Runnable listener) {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView setListener lv=" + this
                    + ", listener=" + listener, new Exception());
        }
        mCloseListener = listener;
        mCloseListener = listener;
    }
    }


    @Override
    @Override
    protected void onAttachedToWindow() {
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        super.onAttachedToWindow();
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView onAttachedToWindow lv=" + this,
                    new Exception());
        }
        mIsOpen = true;
        mIsOpen = true;
    }
    }


@@ -49,10 +59,19 @@ public class ListenerView extends AbstractFloatingView {
    protected void onDetachedFromWindow() {
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        super.onDetachedFromWindow();
        mIsOpen = false;
        mIsOpen = false;
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.PAUSE_NOT_DETECTED, "ListenerView onDetachedFromView lv=" + this,
                    new Exception());
        }
    }
    }


    @Override
    @Override
    protected void handleClose(boolean animate) {
    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 (mIsOpen) {
            if (mCloseListener != null) {
            if (mCloseListener != null) {
                mCloseListener.run();
                mCloseListener.run();
@@ -77,6 +96,10 @@ public class ListenerView extends AbstractFloatingView {


    @Override
    @Override
    public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
    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) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            handleClose(false);
            handleClose(false);
        }
        }