Add logs for the ungaze gesture.

-We add logs to track how much screen time we save with the ungaze feature.

Change-Id: I02bce959ce7ed5bc6c848e51256063c946ff3e87
This commit is contained in:
Mojtaba
2015-09-18 16:35:24 -07:00
parent 5c2bfa8ff0
commit 2d80edc232
2 changed files with 10 additions and 0 deletions

View File

@@ -29,6 +29,9 @@ option java_package com.android.server
# This is logged when the partial wake lock (keeping the device awake
# regardless of whether the screen is off) is acquired or released.
2729 power_partial_wake_state (releasedorAcquired|1|5),(tag|3)
# The device is being asked to go into a soft sleep (typically by the ungaze gesture).
# It logs the time remaining before the device would've normally gone to sleep without the request.
2731 power_soft_sleep_requested (savedwaketimems|2)
#
# Leave IDs through 2739 for more power logs (2730 used by battery_discharge above)

View File

@@ -1577,6 +1577,13 @@ public final class PowerManagerService extends SystemService
}
if (mUserActivitySummary != USER_ACTIVITY_SCREEN_DREAM && userInactiveOverride) {
if ((mUserActivitySummary &
(USER_ACTIVITY_SCREEN_BRIGHT | USER_ACTIVITY_SCREEN_DIM)) != 0) {
// Device is being kept awake by recent user activity
long savedWakeTimeMs = now - nextTimeout;
EventLog.writeEvent(
EventLogTags.POWER_SOFT_SLEEP_REQUESTED, savedWakeTimeMs);
}
mUserActivitySummary = USER_ACTIVITY_SCREEN_DREAM;
nextTimeout = -1;
}