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

Commit b6841ac6 authored by Tony Wickham's avatar Tony Wickham
Browse files

Revert the changes that prevented touch on RecentsView during animation

The original bug that was solving seems to be fixed by other changes,
and this allows users to scroll, dismiss, etc on recent tasks before
fully reaching overview from an app.

Bug: 137487381
Change-Id: I28a708811bba3ce739ce261f19eb29558d8f0e7d
parent 3fca6aae
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -19,12 +19,12 @@ import static android.view.MotionEvent.ACTION_CANCEL;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_UP;

import static com.android.launcher3.Utilities.FLAG_NO_GESTURES;

import android.view.InputEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;

import androidx.annotation.UiThread;

import com.android.launcher3.util.Preconditions;
import com.android.quickstep.inputconsumers.InputConsumer;
import com.android.quickstep.util.SwipeAnimationTargetSet;
@@ -33,8 +33,6 @@ import com.android.systemui.shared.system.InputConsumerController;
import java.util.ArrayList;
import java.util.function.Supplier;

import androidx.annotation.UiThread;

/**
 * Wrapper around RecentsAnimationController to help with some synchronization
 */
@@ -184,10 +182,7 @@ public class RecentsAnimationWrapper {
            }
        }
        if (mInputConsumer != null) {
            int flags = ev.getEdgeFlags();
            ev.setEdgeFlags(flags | FLAG_NO_GESTURES);
            mInputConsumer.onMotionEvent(ev);
            ev.setEdgeFlags(flags);
        }

        return true;
+0 −5
Original line number Diff line number Diff line
@@ -473,11 +473,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        }
    }

    @Override
    protected boolean shouldBlockGestures(MotionEvent ev) {
        return Utilities.shouldDisableGestures(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        super.onTouchEvent(ev);
+0 −6
Original line number Diff line number Diff line
@@ -166,10 +166,4 @@ public class StatusBarTouchController implements TouchController {
        mSysUiProxy = RecentsModel.INSTANCE.get(mLauncher).getSystemUiProxy();
        return mSysUiProxy != null;
    }

    @Override
    public boolean allowWhenGesturesDisabled() {
        // Always allow intercepting touches for this controller.
        return true;
    }
}
 No newline at end of file
+2 −6
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
         */

        // Skip touch handling if there are no pages to swipe
        if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false;
        if (getChildCount() <= 0) return false;

        acquireVelocityTrackerAndAddMovement(ev);

@@ -1093,14 +1093,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
        mAllowOverScroll = enable;
    }

    protected boolean shouldBlockGestures(MotionEvent ev) {
        return false;
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        // Skip touch handling if there are no pages to swipe
        if (getChildCount() <= 0 || shouldBlockGestures(ev)) return false;
        if (getChildCount() <= 0) return false;

        acquireVelocityTrackerAndAddMovement(ev);

+2 −12
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.launcher3;

import static com.android.launcher3.ItemInfoWithIcon.FLAG_ICON_BADGED;

import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.app.ActivityManager;
@@ -92,8 +94,6 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static com.android.launcher3.ItemInfoWithIcon.FLAG_ICON_BADGED;

/**
 * Various utilities shared amongst the Launcher's classes.
 */
@@ -127,16 +127,6 @@ public final class Utilities {
     */
    public static final int EDGE_NAV_BAR = 1 << 8;

    /**
     * Set on a motion event do disallow any gestures and only handle touch.
     * See {@link MotionEvent#setEdgeFlags(int)}.
     */
    public static final int FLAG_NO_GESTURES = 1 << 9;

    public static boolean shouldDisableGestures(MotionEvent ev) {
        return (ev.getEdgeFlags() & FLAG_NO_GESTURES) == FLAG_NO_GESTURES;
    }

    /**
     * Indicates if the device has a debug build. Should only be used to store additional info or
     * add extra logging and not for changing the app behavior.
Loading