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

Commit 5db31c3d authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Ensure that ML model results are still bounded by the gesture insets"...

Merge "Ensure that ML model results are still bounded by the gesture insets" into rvc-qpr-dev am: 64394dec

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13812875

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id12b88d47334d77b436a2ac777a24dd51f43d5b5
parents 6ba52ac4 64394dec
Loading
Loading
Loading
Loading
+14 −13
Original line number Diff line number Diff line
@@ -560,20 +560,21 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa
        if (mVocab != null) {
            app = mVocab.getOrDefault(mPackageName, -1);
        }
        // Check if we are within the tightest bounds beyond which
        // we would not need to run the ML model.
        boolean withinRange = x <= mMLEnableWidth + mLeftInset
                || x >= (mDisplaySize.x - mMLEnableWidth - mRightInset);
        if (!withinRange) {
            int results = -1;
            if (mUseMLModel && (results = getBackGesturePredictionsCategory(x, y, app)) != -1) {
                withinRange = results == 1;
            } else {
                // Denotes whether we should proceed with the gesture.
                // Even if it is false, we may want to log it assuming
                // it is not invalid due to exclusion.
                withinRange = x <= mEdgeWidthLeft + mLeftInset

        // Denotes whether we should proceed with the gesture. Even if it is false, we may want to
        // log it assuming it is not invalid due to exclusion.
        boolean withinRange = x < mEdgeWidthLeft + mLeftInset
                || x >= (mDisplaySize.x - mEdgeWidthRight - mRightInset);
        if (withinRange) {
            int results = -1;

            // Check if we are within the tightest bounds beyond which we would not need to run the
            // ML model
            boolean withinMinRange = x < mMLEnableWidth + mLeftInset
                    || x >= (mDisplaySize.x - mMLEnableWidth - mRightInset);
            if (!withinMinRange && mUseMLModel
                    && (results = getBackGesturePredictionsCategory(x, y, app)) != -1) {
                withinRange = (results == 1);
            }
        }