summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hyunyoung Song <hyunyoungs@google.com> 2019-08-12 16:45:52 -0700
committer android-build-merger <android-build-merger@google.com> 2019-08-12 16:45:52 -0700
commite2a5cc4e4a7e343d0b923441c4e20fcbef002e78 (patch)
treee50b31d8aa89ad2fc31cbadf352635ed0683cdcc
parent56a3d8fb1bea0b18c6f9137ac5b2d291b3d9b745 (diff)
parent2984f34075c9fa72d9333f5451b8ce300a9af810 (diff)
Merge "Log various types of back gesture using StatsLog Bug: 135152789 Test: m statsd_testdrive -j31 Test: out/host/linux-x86/bin/statsd_testdrive 224" into qt-r1-dev am: fa38ed5296
am: 2984f34075 Change-Id: I006eb3713e1c3acd935108e25fef2b4b3adf9fc9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java
index 6a7477945cdd..3bef5822291a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java
@@ -34,6 +34,7 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.util.Log;
import android.util.MathUtils;
+import android.util.StatsLog;
import android.view.Gravity;
import android.view.IPinnedStackController;
import android.view.IPinnedStackListener;
@@ -107,7 +108,11 @@ public class EdgeBackGestureHandler implements DisplayListener {
public void onSystemGestureExclusionChanged(int displayId,
Region systemGestureExclusion, Region unrestrictedOrNull) {
if (displayId == mDisplayId) {
- mMainExecutor.execute(() -> mExcludeRegion.set(systemGestureExclusion));
+ mMainExecutor.execute(() -> {
+ mExcludeRegion.set(systemGestureExclusion);
+ mUnrestrictedExcludeRegion.set(unrestrictedOrNull != null
+ ? unrestrictedOrNull : systemGestureExclusion);
+ });
}
}
};
@@ -121,6 +126,8 @@ public class EdgeBackGestureHandler implements DisplayListener {
private final Executor mMainExecutor;
private final Region mExcludeRegion = new Region();
+ private final Region mUnrestrictedExcludeRegion = new Region();
+
// The edge width where touch down is allowed
private int mEdgeWidth;
// The slop to distinguish between horizontal and vertical motion
@@ -139,6 +146,7 @@ public class EdgeBackGestureHandler implements DisplayListener {
private final PointF mDownPoint = new PointF();
private boolean mThresholdCrossed = false;
private boolean mAllowGesture = false;
+ private boolean mInRejectedExclusion = false;
private boolean mIsOnLeftEdge;
private int mImeHeight = 0;
@@ -318,6 +326,12 @@ public class EdgeBackGestureHandler implements DisplayListener {
if (isInExcludedRegion) {
mOverviewProxyService.notifyBackAction(false /* completed */, -1, -1,
false /* isButton */, !mIsOnLeftEdge);
+ StatsLog.write(StatsLog.BACK_GESTURE_REPORTED_REPORTED,
+ StatsLog.BACK_GESTURE__TYPE__INCOMPLETE_EXCLUDED, y,
+ mIsOnLeftEdge ? StatsLog.BACK_GESTURE__X_LOCATION__LEFT :
+ StatsLog.BACK_GESTURE__X_LOCATION__RIGHT);
+ } else {
+ mInRejectedExclusion = mUnrestrictedExcludeRegion.contains(x, y);
}
return !isInExcludedRegion;
}
@@ -325,6 +339,7 @@ public class EdgeBackGestureHandler implements DisplayListener {
private void cancelGesture(MotionEvent ev) {
// Send action cancel to reset all the touch events
mAllowGesture = false;
+ mInRejectedExclusion = false;
MotionEvent cancelEv = MotionEvent.obtain(ev);
cancelEv.setAction(MotionEvent.ACTION_CANCEL);
mEdgePanel.handleTouch(cancelEv);
@@ -338,6 +353,7 @@ public class EdgeBackGestureHandler implements DisplayListener {
// either the bouncer is showing or the notification panel is hidden
int stateFlags = mOverviewProxyService.getSystemUiStateFlags();
mIsOnLeftEdge = ev.getX() <= mEdgeWidth + mLeftInset;
+ mInRejectedExclusion = false;
mAllowGesture = !QuickStepContract.isBackGestureDisabled(stateFlags)
&& isWithinTouchRegion((int) ev.getX(), (int) ev.getY());
if (mAllowGesture) {
@@ -392,6 +408,14 @@ public class EdgeBackGestureHandler implements DisplayListener {
}
mOverviewProxyService.notifyBackAction(performAction, (int) mDownPoint.x,
(int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge);
+ int backtype = performAction ? (mInRejectedExclusion
+ ? StatsLog.BACK_GESTURE__TYPE__COMPLETED_REJECTED :
+ StatsLog.BACK_GESTURE__TYPE__COMPLETED) :
+ StatsLog.BACK_GESTURE__TYPE__INCOMPLETE;
+ StatsLog.write(StatsLog.BACK_GESTURE_REPORTED_REPORTED, backtype,
+ (int) mDownPoint.y, mIsOnLeftEdge
+ ? StatsLog.BACK_GESTURE__X_LOCATION__LEFT :
+ StatsLog.BACK_GESTURE__X_LOCATION__RIGHT);
}
if (isUp || action == MotionEvent.ACTION_CANCEL) {
mRegionSamplingHelper.stop();
@@ -463,7 +487,9 @@ public class EdgeBackGestureHandler implements DisplayListener {
pw.println("EdgeBackGestureHandler:");
pw.println(" mIsEnabled=" + mIsEnabled);
pw.println(" mAllowGesture=" + mAllowGesture);
+ pw.println(" mInRejectedExclusion" + mInRejectedExclusion);
pw.println(" mExcludeRegion=" + mExcludeRegion);
+ pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion);
pw.println(" mImeHeight=" + mImeHeight);
pw.println(" mIsAttached=" + mIsAttached);
pw.println(" mEdgeWidth=" + mEdgeWidth);