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

Commit 6ed715cf authored by Dmitri Plotnikov's avatar Dmitri Plotnikov Committed by Android (Google) Code Review
Browse files

Merge "Include released wake lock UID and name in battery history event"

parents 27c99a82 55102ab0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1046,6 +1046,17 @@ public class BatteryStatsHistory {
        return true;
    }

    /**
     * Records a wakelock release event.
     */
    public void recordWakelockStopEvent(long elapsedRealtimeMs, long uptimeMs, String historyName,
            int uid) {
        mHistoryCur.wakelockTag = mHistoryCur.localWakelockTag;
        mHistoryCur.wakelockTag.string = historyName != null ? historyName : "";
        mHistoryCur.wakelockTag.uid = uid;
        recordStateStopEvent(elapsedRealtimeMs, uptimeMs, HistoryItem.STATE_WAKE_LOCK_FLAG);
    }

    /**
     * Records an event when some state flag changes to true.
     */
+5 −5
Original line number Diff line number Diff line
@@ -4658,10 +4658,10 @@ public class BatteryStatsImpl extends BatteryStats {
        final int mappedUid = mapUid(uid);
        if (type == WAKE_TYPE_PARTIAL) {
            mWakeLockNesting--;
            if (mRecordAllHistory) {
            if (historyName == null) {
                historyName = name;
            }
            if (mRecordAllHistory) {
                if (mActiveEvents.updateState(HistoryItem.EVENT_WAKE_LOCK_FINISH, historyName,
                        mappedUid, 0)) {
                    mHistory.recordEvent(elapsedRealtimeMs, uptimeMs,
@@ -4669,8 +4669,8 @@ public class BatteryStatsImpl extends BatteryStats {
                }
            }
            if (mWakeLockNesting == 0) {
                mHistory.recordStateStopEvent(elapsedRealtimeMs, uptimeMs,
                        HistoryItem.STATE_WAKE_LOCK_FLAG);
                mHistory.recordWakelockStopEvent(elapsedRealtimeMs, uptimeMs, historyName,
                        mappedUid);
            }
        }
        if (mappedUid >= 0) {