From 3fa76b2d7b7711f3efdb2bef53b6420d45b94b4e Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Sun, 8 Aug 2021 01:22:00 +0100 Subject: [PATCH] Add metrics for handed bouncer When one handed keyguard is enabled we want to track whether the keyguard has been switched to the other side. Also for an unlock attempt event we want to track the side the bouncer appears on. Example: https://paste.googleplex.com/6483938588491776 Test: m statsd_testdrive && statsd_testdrive 63 64 Bug: 194396934 Change-Id: I0f35c0013254149a41ba7cc95fab3c1e4960eb65 --- .../keyguard/KeyguardSecurityContainer.java | 6 ++++++ .../KeyguardSecurityContainerController.java | 21 +++++++++++++++++-- .../statusbar/phone/KeyguardBouncer.java | 2 -- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java index 2605906856741..64d214d1eee7e 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -54,6 +54,7 @@ import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; +import com.android.systemui.shared.system.SysUiStatsLog; import com.android.systemui.statusbar.notification.stack.StackStateAnimator; import java.util.ArrayList; @@ -472,6 +473,11 @@ public class KeyguardSecurityContainer extends FrameLayout { mIsSecurityViewLeftAligned ? Settings.Global.ONE_HANDED_KEYGUARD_SIDE_LEFT : Settings.Global.ONE_HANDED_KEYGUARD_SIDE_RIGHT); + int keyguardState = mIsSecurityViewLeftAligned + ? SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED__STATE__SWITCH_LEFT + : SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED__STATE__SWITCH_RIGHT; + SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, keyguardState); + updateSecurityViewLocation(animate); } } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java index 0df2d65d2acb2..9d649e78c3634 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java @@ -151,9 +151,17 @@ public class KeyguardSecurityContainerController extends ViewController