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

Commit 0674cd7e authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Check pointer count for trackpad gesture features" into udc-dev

parents f0343005 2daf6aaa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.systemui.navigationbar.gestural;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;

import static com.android.systemui.classifier.Classifier.BACK_GESTURE;
import static com.android.systemui.navigationbar.gestural.Utilities.isTrackpadMotionEvent;
import static com.android.systemui.navigationbar.gestural.Utilities.isTrackpadThreeFingerSwipe;

import android.annotation.NonNull;
import android.app.ActivityManager;
@@ -244,7 +244,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
    private boolean mIsBackGestureAllowed;
    private boolean mGestureBlockingActivityRunning;
    private boolean mIsNewBackAffordanceEnabled;
    private boolean mIsTrackpadGestureBackEnabled;
    private boolean mIsTrackpadGestureFeaturesEnabled;
    private boolean mIsButtonForceVisible;

    private InputMonitor mInputMonitor;
@@ -590,7 +590,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack

            // Add a nav bar panel window
            mIsNewBackAffordanceEnabled = mFeatureFlags.isEnabled(Flags.NEW_BACK_AFFORDANCE);
            mIsTrackpadGestureBackEnabled = mFeatureFlags.isEnabled(
            mIsTrackpadGestureFeaturesEnabled = mFeatureFlags.isEnabled(
                    Flags.TRACKPAD_GESTURE_FEATURES);
            resetEdgeBackPlugin();
            mPluginManager.addPluginListener(
@@ -883,7 +883,7 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
    }

    private void onMotionEvent(MotionEvent ev) {
        boolean isTrackpadEvent = isTrackpadMotionEvent(mIsTrackpadGestureBackEnabled, ev);
        boolean isTrackpadEvent = isTrackpadThreeFingerSwipe(mIsTrackpadGestureFeaturesEnabled, ev);
        int action = ev.getActionMasked();
        if (action == MotionEvent.ACTION_DOWN) {
            if (DEBUG_MISSING_GESTURE) {
+4 −3
Original line number Diff line number Diff line
@@ -22,9 +22,10 @@ import android.view.MotionEvent;

public final class Utilities {

    public static boolean isTrackpadMotionEvent(boolean isTrackpadGestureBackEnabled,
    public static boolean isTrackpadThreeFingerSwipe(boolean isTrackpadGestureFeaturesEnabled,
            MotionEvent event) {
        return isTrackpadGestureBackEnabled
                && event.getClassification() == CLASSIFICATION_MULTI_FINGER_SWIPE;
        return isTrackpadGestureFeaturesEnabled
                && event.getClassification() == CLASSIFICATION_MULTI_FINGER_SWIPE
                && event.getPointerCount() == 3;
    }
}