Merge "Add some gesture logs" into udc-qpr-dev

This commit is contained in:
Andy Wickham
2023-09-25 23:54:20 +00:00
committed by Android (Google) Code Review
8 changed files with 45 additions and 1 deletions

View File

@@ -893,7 +893,7 @@ public class TouchInteractionService extends Service {
}
if (mDeviceState.isFullyGesturalNavMode() || newGestureState.isTrackpadGesture()) {
String reasonPrefix = "device is in gesture navigation mode or 3-button mode with a"
+ "trackpad gesture";
+ " trackpad gesture";
if (mDeviceState.canTriggerAssistantAction(event)) {
reasonString.append(NEWLINE_PREFIX)
.append(reasonPrefix)
@@ -921,6 +921,11 @@ public class TouchInteractionService extends Service {
}
} else if (canStartSystemGesture && FeatureFlags.ENABLE_LONG_PRESS_NAV_HANDLE.get()
&& !previousGestureState.isRecentsAnimationRunning()) {
reasonString.append(NEWLINE_PREFIX)
.append(reasonPrefix)
.append(SUBSTRING_PREFIX)
.append("Long press nav handle enabled, "
+ "using NavHandleLongPressInputConsumer");
base = new NavHandleLongPressInputConsumer(this, base, mInputMonitorCompat);
}

View File

@@ -152,4 +152,9 @@ public class AccessibilityInputConsumer extends DelegateInputConsumer {
mDelegate.onMotionEvent(ev);
}
}
@Override
protected String getDelegatorName() {
return "AccessibilityInputConsumer";
}
}

View File

@@ -278,4 +278,9 @@ public class AssistantInputConsumer extends DelegateInputConsumer {
return true;
}
}
@Override
protected String getDelegatorName() {
return "AssistantInputConsumer";
}
}

View File

@@ -5,6 +5,7 @@ import android.view.MotionEvent;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.quickstep.InputConsumer;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.systemui.shared.system.InputMonitorCompat;
public abstract class DelegateInputConsumer implements InputConsumer {
@@ -42,7 +43,15 @@ public abstract class DelegateInputConsumer implements InputConsumer {
mDelegate.onConsumerAboutToBeSwitched();
}
/**
* Returns the name of this DelegateInputConsumer.
*/
protected abstract String getDelegatorName();
protected void setActive(MotionEvent ev) {
ActiveGestureLog.INSTANCE.addLog(new ActiveGestureLog.CompoundString(getDelegatorName())
.append(" became active"));
mState = STATE_ACTIVE;
TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
mInputMonitor.pilferPointers();

View File

@@ -80,4 +80,9 @@ public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
return distFromMiddle < areaFromMiddle;
}
@Override
protected String getDelegatorName() {
return "NavHandleLongPressInputConsumer";
}
}

View File

@@ -175,4 +175,9 @@ public class OneHandedModeInputConsumer extends DelegateInputConsumer {
final float angle = (float) Math.toDegrees(Math.atan2(deltaY, deltaX));
return angle > ANGLE_MIN && angle < ANGLE_MAX;
}
@Override
protected String getDelegatorName() {
return "OneHandedModeInputConsumer";
}
}

View File

@@ -346,4 +346,9 @@ public class TaskbarUnstashInputConsumer extends DelegateInputConsumer {
private boolean isMouseEvent(MotionEvent event) {
return event.getSource() == InputDevice.SOURCE_MOUSE;
}
@Override
protected String getDelegatorName() {
return "TaskbarUnstashInputConsumer";
}
}

View File

@@ -82,4 +82,9 @@ public class TrackpadStatusBarInputConsumer extends DelegateInputConsumer {
mSystemUiProxy.onStatusBarTrackpadEvent(ev);
}
}
@Override
protected String getDelegatorName() {
return "TrackpadStatusBarInputConsumer";
}
}