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

Commit 2d80edc2 authored by Mojtaba's avatar Mojtaba
Browse files

Add logs for the ungaze gesture.

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

Change-Id: I02bce959ce7ed5bc6c848e51256063c946ff3e87
parent 5c2bfa8f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)
+7 −0
Original line number Diff line number Diff line
@@ -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;
                }