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

Commit 7d54ec7b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6294165 from 97ce9ee9 to qt-qpr3-release

Change-Id: I1e4e13c9193cb7a2d83ffd07cc084333b39475b1
parents 150805f9 97ce9ee9
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -563,9 +563,13 @@ public class TouchInteractionService extends Service implements
                // not interrupt it. QuickSwitch assumes that interruption can only happen if the
                // next gesture is also quick switch.
                mUncheckedConsumer =
                        new AssistantTouchConsumer(this, mISystemUiProxy,
                        new AssistantTouchConsumer(
                                this,
                                mISystemUiProxy,
                                mOverviewComponentObserver.getActivityControlHelper(),
                                InputConsumer.NO_OP, mInputMonitorCompat);
                                InputConsumer.NO_OP,
                                mInputMonitorCompat,
                                mOverviewComponentObserver.assistantGestureIsConstrained());
            } else {
                mUncheckedConsumer = InputConsumer.NO_OP;
            }
@@ -612,8 +616,13 @@ public class TouchInteractionService extends Service implements
            final ActivityControlHelper activityControl =
                    mOverviewComponentObserver.getActivityControlHelper();
            if (canTriggerAssistantAction(event)) {
                base = new AssistantTouchConsumer(this, mISystemUiProxy, activityControl, base,
                        mInputMonitorCompat);
                base = new AssistantTouchConsumer(
                        this,
                        mISystemUiProxy,
                        activityControl,
                        base,
                        mInputMonitorCompat,
                        mOverviewComponentObserver.assistantGestureIsConstrained());
            }

            if ((mSystemUiStateFlags & SYSUI_STATE_SCREEN_PINNING) != 0) {
+8 −5
Original line number Diff line number Diff line
@@ -91,14 +91,16 @@ public class AssistantTouchConsumer extends DelegateInputConsumer {
    private final ISystemUiProxy mSysUiProxy;
    private final Context mContext;
    private final GestureDetector mGestureDetector;
    private final boolean mIsAssistGestureConstrained;

    public AssistantTouchConsumer(Context context, ISystemUiProxy systemUiProxy,
            ActivityControlHelper activityControlHelper, InputConsumer delegate,
            InputMonitorCompat inputMonitor) {
        InputMonitorCompat inputMonitor, boolean isAssistGestureConstrained) {
        super(delegate, inputMonitor);
        final Resources res = context.getResources();
        mContext = context;
        mSysUiProxy = systemUiProxy;
        mIsAssistGestureConstrained = isAssistGestureConstrained;
        mDragDistThreshold = res.getDimension(R.dimen.gestures_assistant_drag_threshold);
        mFlingDistThreshold = res.getDimension(R.dimen.gestures_assistant_fling_threshold);
        mTimeThreshold = res.getInteger(R.integer.assistant_gesture_min_time_threshold);
@@ -273,7 +275,8 @@ public class AssistantTouchConsumer extends DelegateInputConsumer {
    private class AssistantGestureListener extends SimpleOnGestureListener {
        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
            if (isValidAssistantGestureAngle(velocityX, -velocityY)
            if (!mIsAssistGestureConstrained
                    && isValidAssistantGestureAngle(velocityX, -velocityY)
                    && mDistance >= mFlingDistThreshold
                    && !mLaunchedAssistant
                    && mState != STATE_DELEGATE_ACTIVE) {
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.content.Intent.ACTION_PACKAGE_REMOVED;

import static com.android.launcher3.util.PackageManagerHelper.getPackageFilter;
import static com.android.systemui.shared.system.PackageManagerWrapper.ACTION_PREFERRED_ACTIVITY_CHANGED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;

import android.content.BroadcastReceiver;
@@ -107,6 +108,10 @@ public final class OverviewComponentObserver {
        }
    }

    public boolean assistantGestureIsConstrained() {
        return (mSystemUiStateFlags & SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED) != 0;
    }

    /**
     * Update overview intent and {@link ActivityControlHelper} based off the current launcher home
     * component.