diff options
author | d34d <clark@cyngn.com> | 2016-04-07 13:20:20 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-04-08 08:11:43 -0700 |
commit | 726377a9ffe482eb6adc66c7e98007a0c12b6c6c (patch) | |
tree | b7cf5f4b3fffb0a0a4c75940a43f68dc9b16d838 /packages | |
parent | f8d9e899dc835e2a0308cea7af81fae4dbdaa67d (diff) | |
download | frameworks_base-726377a9ffe482eb6adc66c7e98007a0c12b6c6c.zip frameworks_base-726377a9ffe482eb6adc66c7e98007a0c12b6c6c.tar.gz frameworks_base-726377a9ffe482eb6adc66c7e98007a0c12b6c6c.tar.bz2 |
SysUI: Add event logs for live lock screen interactions
Change-Id: I998ae96e9ae2047e37cee74e88ee2f3185d31755
TICKET: CYNGNOS-2380
Diffstat (limited to 'packages')
4 files changed, 62 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags index a584cf6..bd0799f 100644 --- a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags +++ b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags @@ -51,3 +51,19 @@ option java_package com.android.systemui; # SearchPanelView.java # --------------------------- 36050 sysui_searchpanel_touch (type|1),(x|1),(y|1) + +# --------------------------- +# LiveLockScreenController.java +# --------------------------- +# sysui_lls_keyguard_showing +## screenOn: 0:screen turned off +## 1:screen turned on +36060 sysui_lls_keyguard_showing (screenOn|1) +# sysui_lls_keyguard_dismissed: Logged when user unlocks the device +## onLls: 0:dismissed while showing notifications +## 1:dismissed while user interacting with LLS +36061 sysui_lls_keyguard_dismissed (onLls|1) +# sysui_lls_notification_panel_shown: Logged when the notification panel is swiped in and out +## shown: 0:panel is hidden +## 1:panel is visible +36062 sysui_lls_notification_panel_shown (shown|1) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 5aa6416..12f1863 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -290,6 +290,7 @@ public class NotificationPanelView extends PanelView implements mShowingExternalKeyguard = true; mCanDismissKeyguard = false; mStatusBar.focusKeyguardExternalView(); + mLiveLockscreenController.onLiveLockScreenFocusChanged(true /* hasFocus */); resetAlphaTranslation(); // Enables the left edge gesture to allow user // to return to keyguard @@ -1845,6 +1846,7 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed()); if (mShowingExternalKeyguard && expandedHeight >= getMaxPanelHeight()) { mStatusBar.unfocusKeyguardExternalView(); + mLiveLockscreenController.onLiveLockScreenFocusChanged(false /* hasFocus */); mShowingExternalKeyguard = false; } if (DEBUG) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index ca3d1bf..bf12a4d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -4942,14 +4942,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mDozeScrimController.onScreenTurnedOn(); mVisualizerView.setVisible(true); if (mLiveLockScreenController.isShowingLiveLockScreenView()) { - mLiveLockScreenController.getLiveLockScreenView().onScreenTurnedOn(); + mLiveLockScreenController.onScreenTurnedOn(); } } public void onScreenTurnedOff() { mVisualizerView.setVisible(false); if (mLiveLockScreenController.isShowingLiveLockScreenView()) { - mLiveLockScreenController.getLiveLockScreenView().onScreenTurnedOff(); + mLiveLockScreenController.onScreenTurnedOff(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LiveLockScreenController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LiveLockScreenController.java index 46b23d8..4e9419e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LiveLockScreenController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LiveLockScreenController.java @@ -5,13 +5,16 @@ import android.content.Context; import android.content.Intent; import android.os.Handler; import android.os.Looper; +import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; +import android.util.EventLog; +import com.android.systemui.EventLogTags; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.NotificationPanelView; - import com.android.systemui.statusbar.phone.PhoneStatusBar; + import cyanogenmod.app.CMContextConstants; import cyanogenmod.app.ILiveLockScreenChangeListener; import cyanogenmod.app.ILiveLockScreenManager; @@ -33,6 +36,10 @@ public class LiveLockScreenController { private int mStatusBarState; + private PowerManager mPowerManager; + + private boolean mLlsHasFocus = false; + public LiveLockScreenController(Context context, PhoneStatusBar bar, NotificationPanelView panelView) { mContext = context; @@ -42,6 +49,7 @@ public class LiveLockScreenController { CMContextConstants.CM_LIVE_LOCK_SCREEN_SERVICE)); mBar = bar; mPanelView = panelView; + mPowerManager = context.getSystemService(PowerManager.class); registerListener(); try { LiveLockScreenInfo llsInfo = mLLSM.getCurrentLiveLockScreen(); @@ -64,6 +72,11 @@ public class LiveLockScreenController { } public void setBarState(int statusBarState) { + if (mStatusBarState != StatusBarState.SHADE && statusBarState == StatusBarState.SHADE) { + // going from KEYGUARD or SHADE_LOCKED to SHADE so device has been unlocked + onKeyguardDismissed(); + } + mStatusBarState = statusBarState; if (statusBarState == StatusBarState.KEYGUARD || statusBarState == StatusBarState.SHADE_LOCKED) { @@ -201,6 +214,34 @@ public class LiveLockScreenController { return mLiveLockScreenView; } + public void onScreenTurnedOn() { + if (mLiveLockScreenView != null && mPowerManager.isInteractive()) { + mLiveLockScreenView.onScreenTurnedOn(); + EventLog.writeEvent(EventLogTags.SYSUI_LLS_KEYGUARD_SHOWING, 1); + } + } + + public void onScreenTurnedOff() { + if (mStatusBarState != StatusBarState.SHADE) { + EventLog.writeEvent(EventLogTags.SYSUI_LLS_KEYGUARD_SHOWING, 0); + } + } + + public void onLiveLockScreenFocusChanged(boolean hasFocus) { + if (hasFocus != mLlsHasFocus) { + mLlsHasFocus = hasFocus; + // don't log focus changes when screen is not interactive + if (mPowerManager.isInteractive()) { + EventLog.writeEvent(EventLogTags.SYSUI_LLS_NOTIFICATION_PANEL_SHOWN, + hasFocus ? 0 : 1); + } + } + } + + public void onKeyguardDismissed() { + EventLog.writeEvent(EventLogTags.SYSUI_LLS_KEYGUARD_DISMISSED, mLlsHasFocus ? 1 : 0); + } + private Runnable mAddNewLiveLockScreenRunnable = new Runnable() { @Override public void run() { |