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

Commit 58d05298 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Statsd atom: interactive"

parents 912a1e9e a66083f7
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ message Atom {
        BatteryLevelChanged battery_level_changed = 30;
        ChargingStateChanged charging_state_changed = 31;
        PluggedStateChanged plugged_state_changed = 32;
        // 33 - 34 are available
        InteractiveStateChanged interactive_state_changed = 33;
        // 34 is available
        WakeupAlarmOccurred wakeup_alarm_occurred = 35;
        KernelWakeupReported kernel_wakeup_reported = 36;
        WifiLockStateChanged wifi_lock_state_changed = 37;
@@ -664,6 +665,20 @@ message LongPartialWakelockStateChanged {
    optional State state = 4;
}

/**
 * Logs when the device is interactive, according to the PowerManager Notifier.
 *
 * Logged from:
 *   frameworks/base/services/core/java/com/android/server/power/Notifier.java
 */
message InteractiveStateChanged {
    enum State {
        OFF = 0;
        ON = 1;
    }
    optional State state = 1;
}

/**
 * Logs Battery Saver state change.
 *
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,8 @@ public class Notifier {
        try {
            mBatteryStats.noteInteractive(true);
        } catch (RemoteException ex) { }
        StatsLog.write(StatsLog.INTERACTIVE_STATE_CHANGED,
                StatsLog.INTERACTIVE_STATE_CHANGED__STATE__ON);
    }

    /**
@@ -401,6 +403,9 @@ public class Notifier {
            try {
                mBatteryStats.noteInteractive(interactive);
            } catch (RemoteException ex) { }
            StatsLog.write(StatsLog.INTERACTIVE_STATE_CHANGED,
                    interactive ? StatsLog.INTERACTIVE_STATE_CHANGED__STATE__ON :
                            StatsLog.INTERACTIVE_STATE_CHANGED__STATE__OFF);

            // Handle early behaviors.
            mInteractive = interactive;