Loading cmds/statsd/src/atoms.proto +2 −0 Original line number Diff line number Diff line Loading @@ -3192,6 +3192,8 @@ message BackGesture { optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event. optional int32 left_boundary = 8; // left edge width + left inset optional int32 right_boundary = 9; // screen width - (right edge width + right inset) optional float ml_model_score = 10; // The score between 0 and 1 which is the prediction output // for the Back Gesture model. enum WindowHorizontalLocation { DEFAULT_LOCATION = 0; Loading packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +7 −4 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa private boolean mUseMLModel; private float mMLModelThreshold; private String mPackageName; private float mMLResults; private final GestureNavigationSettingsObserver mGestureNavigationSettingsObserver; Loading Loading @@ -531,10 +532,10 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa new long[]{(long) y}, }; final float results = mBackGestureTfClassifierProvider.predict(featuresVector); if (results == -1) return -1; mMLResults = mBackGestureTfClassifierProvider.predict(featuresVector); if (mMLResults == -1) return -1; return results >= mMLModelThreshold ? 1 : 0; return mMLResults >= mMLModelThreshold ? 1 : 0; } private boolean isWithinTouchRegion(int x, int y) { Loading Loading @@ -611,7 +612,8 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa (int) mDownPoint.x, (int) mDownPoint.y, (int) mEndPoint.x, (int) mEndPoint.y, mEdgeWidthLeft + mLeftInset, mDisplaySize.x - (mEdgeWidthRight + mRightInset)); mDisplaySize.x - (mEdgeWidthRight + mRightInset), mUseMLModel ? mMLResults : -2); } private void onMotionEvent(MotionEvent ev) { Loading @@ -621,6 +623,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa // either the bouncer is showing or the notification panel is hidden mInputEventReceiver.setBatchingEnabled(false); mIsOnLeftEdge = ev.getX() <= mEdgeWidthLeft + mLeftInset; mMLResults = 0; mLogGesture = false; mInRejectedExclusion = false; mAllowGesture = !mDisabledForQuickstep && mIsBackGestureAllowed Loading Loading
cmds/statsd/src/atoms.proto +2 −0 Original line number Diff line number Diff line Loading @@ -3192,6 +3192,8 @@ message BackGesture { optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event. optional int32 left_boundary = 8; // left edge width + left inset optional int32 right_boundary = 9; // screen width - (right edge width + right inset) optional float ml_model_score = 10; // The score between 0 and 1 which is the prediction output // for the Back Gesture model. enum WindowHorizontalLocation { DEFAULT_LOCATION = 0; Loading
packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java +7 −4 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa private boolean mUseMLModel; private float mMLModelThreshold; private String mPackageName; private float mMLResults; private final GestureNavigationSettingsObserver mGestureNavigationSettingsObserver; Loading Loading @@ -531,10 +532,10 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa new long[]{(long) y}, }; final float results = mBackGestureTfClassifierProvider.predict(featuresVector); if (results == -1) return -1; mMLResults = mBackGestureTfClassifierProvider.predict(featuresVector); if (mMLResults == -1) return -1; return results >= mMLModelThreshold ? 1 : 0; return mMLResults >= mMLModelThreshold ? 1 : 0; } private boolean isWithinTouchRegion(int x, int y) { Loading Loading @@ -611,7 +612,8 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa (int) mDownPoint.x, (int) mDownPoint.y, (int) mEndPoint.x, (int) mEndPoint.y, mEdgeWidthLeft + mLeftInset, mDisplaySize.x - (mEdgeWidthRight + mRightInset)); mDisplaySize.x - (mEdgeWidthRight + mRightInset), mUseMLModel ? mMLResults : -2); } private void onMotionEvent(MotionEvent ev) { Loading @@ -621,6 +623,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa // either the bouncer is showing or the notification panel is hidden mInputEventReceiver.setBatchingEnabled(false); mIsOnLeftEdge = ev.getX() <= mEdgeWidthLeft + mLeftInset; mMLResults = 0; mLogGesture = false; mInRejectedExclusion = false; mAllowGesture = !mDisabledForQuickstep && mIsBackGestureAllowed Loading