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

Commit 0e6e5de7 authored by Steven Wu's avatar Steven Wu
Browse files

Add logging for the detailed reason of screen on/off.

Bug: 128437652
Test: manual
Change-Id: If5c281f80b6fce5291bb32eddd2ee7522bd19bb1
parent 53cc8bf1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -7124,6 +7124,14 @@ message MetricsEvent {
    // OS: Q
    DIALOG_FACE_REMOVE = 1693;

    // FIELD - Detailed reason in screen wake. One of WAKE_REASON_* in PowerManager.
    // OS: Q
    FIELD_SCREEN_WAKE_REASON = 1694;

    // FIELD - Detailed reason in screen sleep. One of GO_TO_SLEEP_REASON_* in PowerManager.
    // OS: Q
    FIELD_SCREEN_SLEEP_REASON = 1695;

    // ---- End Q Constants, all Q constants go above this line ----
    // Add new aosp constants above this line.
    // END OF AOSP CONSTANTS
+4 −0
Original line number Diff line number Diff line
@@ -486,6 +486,8 @@ public class Notifier {
                        log.setType(MetricsEvent.TYPE_OPEN);
                        log.setSubtype(why);
                        log.setLatency(interactiveChangeLatency);
                        log.addTaggedData(
                                MetricsEvent.FIELD_SCREEN_WAKE_REASON, mInteractiveChangeReason);
                        MetricsLogger.action(log);
                        EventLogTags.writePowerScreenState(1, 0, 0, 0, interactiveChangeLatency);
                        mPolicy.finishedWakingUp(why);
@@ -513,6 +515,8 @@ public class Notifier {
                        log.setType(MetricsEvent.TYPE_CLOSE);
                        log.setSubtype(why);
                        log.setLatency(interactiveChangeLatency);
                        log.addTaggedData(
                                MetricsEvent.FIELD_SCREEN_SLEEP_REASON, mInteractiveChangeReason);
                        MetricsLogger.action(log);
                        EventLogTags.writePowerScreenState(0, why, 0, 0, interactiveChangeLatency);
                        mPolicy.finishedGoingToSleep(why);