Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 726377a9 authored by d34d's avatar d34d Committed by Gerrit Code Review
Browse files

SysUI: Add event logs for live lock screen interactions

Change-Id: I998ae96e9ae2047e37cee74e88ee2f3185d31755
TICKET: CYNGNOS-2380
parent f8d9e899
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -51,3 +51,19 @@ option java_package com.android.systemui;
# SearchPanelView.java
# SearchPanelView.java
# ---------------------------
# ---------------------------
36050 sysui_searchpanel_touch (type|1),(x|1),(y|1)
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)
+2 −0
Original line number Original line Diff line number Diff line
@@ -290,6 +290,7 @@ public class NotificationPanelView extends PanelView implements
            mShowingExternalKeyguard = true;
            mShowingExternalKeyguard = true;
            mCanDismissKeyguard = false;
            mCanDismissKeyguard = false;
            mStatusBar.focusKeyguardExternalView();
            mStatusBar.focusKeyguardExternalView();
            mLiveLockscreenController.onLiveLockScreenFocusChanged(true /* hasFocus */);
            resetAlphaTranslation();
            resetAlphaTranslation();
            // Enables the left edge gesture to allow user
            // Enables the left edge gesture to allow user
            // to return to keyguard
            // to return to keyguard
@@ -1845,6 +1846,7 @@ public class NotificationPanelView extends PanelView implements
        mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
        mNotificationStackScroller.setShadeExpanded(!isFullyCollapsed());
        if (mShowingExternalKeyguard && expandedHeight >= getMaxPanelHeight()) {
        if (mShowingExternalKeyguard && expandedHeight >= getMaxPanelHeight()) {
            mStatusBar.unfocusKeyguardExternalView();
            mStatusBar.unfocusKeyguardExternalView();
            mLiveLockscreenController.onLiveLockScreenFocusChanged(false /* hasFocus */);
            mShowingExternalKeyguard = false;
            mShowingExternalKeyguard = false;
        }
        }
        if (DEBUG) {
        if (DEBUG) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -4942,14 +4942,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mDozeScrimController.onScreenTurnedOn();
        mDozeScrimController.onScreenTurnedOn();
        mVisualizerView.setVisible(true);
        mVisualizerView.setVisible(true);
        if (mLiveLockScreenController.isShowingLiveLockScreenView()) {
        if (mLiveLockScreenController.isShowingLiveLockScreenView()) {
            mLiveLockScreenController.getLiveLockScreenView().onScreenTurnedOn();
            mLiveLockScreenController.onScreenTurnedOn();
        }
        }
    }
    }


    public void onScreenTurnedOff() {
    public void onScreenTurnedOff() {
        mVisualizerView.setVisible(false);
        mVisualizerView.setVisible(false);
        if (mLiveLockScreenController.isShowingLiveLockScreenView()) {
        if (mLiveLockScreenController.isShowingLiveLockScreenView()) {
            mLiveLockScreenController.getLiveLockScreenView().onScreenTurnedOff();
            mLiveLockScreenController.onScreenTurnedOff();
        }
        }
    }
    }


+42 −1
Original line number Original line Diff line number Diff line
@@ -5,13 +5,16 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.os.Handler;
import android.os.Handler;
import android.os.Looper;
import android.os.Looper;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager;
import android.util.EventLog;


import com.android.systemui.EventLogTags;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.NotificationPanelView;

import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.phone.PhoneStatusBar;

import cyanogenmod.app.CMContextConstants;
import cyanogenmod.app.CMContextConstants;
import cyanogenmod.app.ILiveLockScreenChangeListener;
import cyanogenmod.app.ILiveLockScreenChangeListener;
import cyanogenmod.app.ILiveLockScreenManager;
import cyanogenmod.app.ILiveLockScreenManager;
@@ -33,6 +36,10 @@ public class LiveLockScreenController {


    private int mStatusBarState;
    private int mStatusBarState;


    private PowerManager mPowerManager;

    private boolean mLlsHasFocus = false;

    public LiveLockScreenController(Context context, PhoneStatusBar bar,
    public LiveLockScreenController(Context context, PhoneStatusBar bar,
            NotificationPanelView panelView) {
            NotificationPanelView panelView) {
        mContext = context;
        mContext = context;
@@ -42,6 +49,7 @@ public class LiveLockScreenController {
                CMContextConstants.CM_LIVE_LOCK_SCREEN_SERVICE));
                CMContextConstants.CM_LIVE_LOCK_SCREEN_SERVICE));
        mBar = bar;
        mBar = bar;
        mPanelView = panelView;
        mPanelView = panelView;
        mPowerManager = context.getSystemService(PowerManager.class);
        registerListener();
        registerListener();
        try {
        try {
            LiveLockScreenInfo llsInfo = mLLSM.getCurrentLiveLockScreen();
            LiveLockScreenInfo llsInfo = mLLSM.getCurrentLiveLockScreen();
@@ -64,6 +72,11 @@ public class LiveLockScreenController {
    }
    }


    public void setBarState(int statusBarState) {
    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;
        mStatusBarState = statusBarState;
        if (statusBarState == StatusBarState.KEYGUARD ||
        if (statusBarState == StatusBarState.KEYGUARD ||
                statusBarState == StatusBarState.SHADE_LOCKED) {
                statusBarState == StatusBarState.SHADE_LOCKED) {
@@ -201,6 +214,34 @@ public class LiveLockScreenController {
        return mLiveLockScreenView;
        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() {
    private Runnable mAddNewLiveLockScreenRunnable = new Runnable() {
        @Override
        @Override
        public void run() {
        public void run() {