diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2018-05-16 15:54:31 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2018-05-21 12:27:46 -0700 |
commit | bd6fba9f589d02550c7542afa1906e2e3dd82a1b (patch) | |
tree | 551f130c3c83e2fb390d097b9d8a1454068f52c1 /src/com/android/launcher3/logging | |
parent | 7b19b16f09237508076d89d6fda2e3d335344b98 (diff) | |
download | android_packages_apps_Trebuchet-bd6fba9f589d02550c7542afa1906e2e3dd82a1b.tar.gz android_packages_apps_Trebuchet-bd6fba9f589d02550c7542afa1906e2e3dd82a1b.tar.bz2 android_packages_apps_Trebuchet-bd6fba9f589d02550c7542afa1906e2e3dd82a1b.zip |
onResume event should be logged (not twice but once)
Bug: 79541772
Change-Id: I5fe1271007e4579e1ec95d51c215ef48d0c6eedd
Diffstat (limited to 'src/com/android/launcher3/logging')
-rw-r--r-- | src/com/android/launcher3/logging/UserEventDispatcher.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 850c948c2..1842e19a4 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -125,6 +125,7 @@ public class UserEventDispatcher { return null; } + private boolean mSessionStarted; private long mElapsedContainerMillis; private long mElapsedSessionMillis; private long mActionDurationMillis; @@ -216,9 +217,11 @@ public class UserEventDispatcher { public void logActionCommand(int command, Target srcTarget, Target dstTarget) { LauncherEvent event = newLauncherEvent(newCommandAction(command), srcTarget); - if (command == Action.Command.STOP && mAppOrTaskLaunch) { - // Prevent double logging by skipping STOP when app or task has been launched. - return; + if (command == Action.Command.STOP) { + if (mAppOrTaskLaunch || !mSessionStarted) { + mSessionStarted = false; + return; + } } if (dstTarget != null) { @@ -405,7 +408,8 @@ public class UserEventDispatcher { } - public final void resetElapsedSessionMillis() { + public final void startSession() { + mSessionStarted = true; mElapsedSessionMillis = SystemClock.uptimeMillis(); mElapsedContainerMillis = SystemClock.uptimeMillis(); } |