SysUI: Log lockscreen gestures

Log the following lockscreen gestures:
 * Swipe up to unlock
 * Swipe down to enter full shade
 * Tap in empty area (causing unlock hint)
 * Swipe to camera
 * Swipe to dialer
 * Tap on lock to lock device
 * Tap on notification, activating it

For swipe gestures, includes length and velocity where available.

Bug: 18767135
Change-Id: Ib2c535e3a9d2b378f5a2a0a00c2be3fd916554ac
This commit is contained in:
Christoph Studer
2014-12-22 21:02:26 +01:00
parent 86e1788db4
commit b018399a3a
8 changed files with 93 additions and 6 deletions

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.systemui;
/**
* Constants to be passed as sysui_* eventlog parameters.
*/
public class EventLogConstants {
/** The user swiped up on the lockscreen, unlocking the device. */
public static final int SYSUI_LOCKSCREEN_GESTURE_SWIPE_UP_UNLOCK = 1;
/** The user swiped down on the lockscreen, going to the full shade. */
public static final int SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_FULL_SHADE = 2;
/** The user tapped in an empty area, causing the unlock hint to be shown. */
public static final int SYSUI_LOCKSCREEN_GESTURE_TAP_UNLOCK_HINT = 3;
/** The user swiped inward on the camera icon, launching the camera. */
public static final int SYSUI_LOCKSCREEN_GESTURE_SWIPE_CAMERA = 4;
/** The user swiped inward on the dialer icon, launching the dialer. */
public static final int SYSUI_LOCKSCREEN_GESTURE_SWIPE_DIALER = 5;
/** The user tapped the lock, locking the device. */
public static final int SYSUI_LOCKSCREEN_GESTURE_TAP_LOCK = 6;
/** The user tapped a notification, needs to tap again to launch. */
public static final int SYSUI_LOCKSCREEN_GESTURE_TAP_NOTIFICATION_ACTIVATE = 7;
}

View File

@@ -27,6 +27,15 @@ option java_package com.android.systemui;
# NotificationPanelView.java
# ---------------------------
36020 sysui_notificationpanel_touch (type|1),(x|1),(y|1)
## type: 1: SWIPE_UP_UNLOCK Swiped up to dismiss the lockscreen.
## 2: SWIPE_DOWN_FULL_SHADE Swiped down to enter full shade.
## 3: TAP_UNLOCK_HINT Tapped in empty area, causes unlock hint.
## 4: SWIPE_CAMERA Swiped the camera icon, launches.
## 5: SWIPE_DIALER Swiped the dialer icon, launches.
## 6: TAP_LOCK Tapped the (unlocked) lock icon, locks the device.
## 7: TAP_NOTIFICATION_ACTIVATE Tapped a lockscreen notification, causes "tap again" hint.
## Note: Second tap logged as notification_clicked.
36021 sysui_lockscreen_gesture (type|1),(lengthDp|1),(velocityDp|1)
# ---------------------------
# SettingsPanelView.java

View File

@@ -126,7 +126,8 @@ public class DragDownHelper implements Gefingerpoken {
}
return true;
case MotionEvent.ACTION_UP:
if (mDraggedFarEnough && mDragDownCallback.onDraggedDown(mStartingChild)) {
if (mDraggedFarEnough && mDragDownCallback.onDraggedDown(mStartingChild,
(int) (y - mInitialTouchY))) {
if (mStartingChild == null) {
mDragDownCallback.setEmptyDragAmount(0f);
}
@@ -221,7 +222,7 @@ public class DragDownHelper implements Gefingerpoken {
/**
* @return true if the interaction is accepted, false if it should be cancelled
*/
boolean onDraggedDown(View startingChild);
boolean onDraggedDown(View startingChild, int dragLengthY);
void onDragDownReset();
void onThresholdReached();
void onTouchSlopExceeded();

View File

@@ -317,7 +317,7 @@ public class KeyguardAffordanceHelper {
animator.addListener(mFlingEndListener);
if (!snapBack) {
startFinishingCircleAnimation(vel * 0.375f, mAnimationEndRunnable);
mCallback.onAnimationToSideStarted(mTranslation < 0);
mCallback.onAnimationToSideStarted(mTranslation < 0, mTranslation, vel);
} else {
reset(true);
}
@@ -461,7 +461,7 @@ public class KeyguardAffordanceHelper {
*
* @param rightPage Is the page animated to the right page?
*/
void onAnimationToSideStarted(boolean rightPage);
void onAnimationToSideStarted(boolean rightPage, float translation, float vel);
/**
* Notifies the callback the animation to a side page has ended.

View File

@@ -47,6 +47,8 @@ import android.widget.TextView;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.KeyguardAffordanceView;
@@ -320,6 +322,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
}
private void handleTrustCircleClick() {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_TAP_LOCK, 0 /* lengthDp - N/A */,
0 /* velocityDp - N/A */);
mIndicationController.showTransientIndication(
R.string.keyguard_indication_trust_disabled);
mLockPatternUtils.requireCredentialEntry(mLockPatternUtils.getCurrentUser());

View File

@@ -39,6 +39,8 @@ import android.widget.FrameLayout;
import android.widget.TextView;
import com.android.keyguard.KeyguardStatusView;
import com.android.systemui.EventLogTags;
import com.android.systemui.EventLogConstants;
import com.android.systemui.R;
import com.android.systemui.qs.QSContainer;
import com.android.systemui.qs.QSPanel;
@@ -1670,13 +1672,20 @@ public class NotificationPanelView extends PanelView implements
}
@Override
public void onAnimationToSideStarted(boolean rightPage) {
public void onAnimationToSideStarted(boolean rightPage, float translation, float vel) {
boolean start = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? rightPage : !rightPage;
mIsLaunchTransitionRunning = true;
mLaunchAnimationEndRunnable = null;
float displayDensity = mStatusBar.getDisplayDensity();
int lengthDp = Math.abs((int) (translation / displayDensity));
int velocityDp = Math.abs((int) (vel / displayDensity));
if (start) {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DIALER, lengthDp, velocityDp);
mKeyguardBottomArea.launchPhone();
} else {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_CAMERA, lengthDp, velocityDp);
mSecureCameraLaunchManager.startSecureCameraLaunch();
}
mStatusBar.startLaunchTransitionTimeout();

View File

@@ -32,6 +32,8 @@ import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.statusbar.FlingAnimationUtils;
@@ -338,6 +340,15 @@ public abstract class PanelView extends FrameLayout {
DozeLog.traceFling(expand, mTouchAboveFalsingThreshold,
mStatusBar.isFalsingThresholdNeeded(),
mStatusBar.isScreenOnComingFromTouch());
// Log collapse gesture if on lock screen.
if (!expand && mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
float displayDensity = mStatusBar.getDisplayDensity();
int heightDp = (int) Math.abs((y - mInitialTouchY) / displayDensity);
int velocityDp = (int) Math.abs(vel / displayDensity);
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_UP_UNLOCK,
heightDp, velocityDp);
}
fling(vel, expand);
mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown;
if (mUpdateFlingOnLayout) {
@@ -941,6 +952,9 @@ public abstract class PanelView extends FrameLayout {
switch (mStatusBar.getBarState()) {
case StatusBarState.KEYGUARD:
if (!mDozingOnDown) {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_TAP_UNLOCK_HINT,
0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
startUnlockHintAnimation();
}
return true;

View File

@@ -121,6 +121,7 @@ import com.android.keyguard.KeyguardHostView.OnDismissAction;
import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.BatteryMeterView;
import com.android.systemui.DemoMode;
import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.FontSizeUtils;
import com.android.systemui.R;
@@ -3078,6 +3079,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
}
float getDisplayDensity() {
return mDisplayMetrics.density;
}
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned,
final boolean dismissShade) {
if (onlyProvisioned && !isDeviceProvisioned()) return;
@@ -3882,6 +3887,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
@Override
public void onActivated(ActivatableNotificationView view) {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_TAP_NOTIFICATION_ACTIVATE,
0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */);
mKeyguardIndicationController.showTransientIndication(R.string.notification_tap_again);
ActivatableNotificationView previousView = mStackScroller.getActivatedChild();
if (previousView != null) {
@@ -3962,8 +3970,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
// ---------------------- DragDownHelper.OnDragDownListener ------------------------------------
@Override
public boolean onDraggedDown(View startingChild) {
public boolean onDraggedDown(View startingChild, int dragLengthY) {
if (hasActiveNotifications()) {
EventLogTags.writeSysuiLockscreenGesture(
EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_FULL_SHADE,
(int) (dragLengthY / mDisplayMetrics.density),
0 /* velocityDp - N/A */);
// We have notifications, go to locked shade.
goToLockedShade(startingChild);