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

Commit 024a003d authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "batstats: fix wake lock tracking, service bug"

parents 5c3f7236 40c87258
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -577,6 +577,8 @@ public abstract class BatteryStats implements Parcelable {

        public int states;

        public int states2;

        // The wake lock that was acquired at this point.
        public HistoryTag wakelockTag;

@@ -1215,6 +1217,11 @@ public abstract class BatteryStats implements Parcelable {
     */
    public abstract int getHighDischargeAmountSinceCharge();

    /**
     * Retrieve the discharge amount over the selected discharge period <var>which</var>.
     */
    public abstract int getDischargeAmount(int which);

    /**
     * Get the amount the battery has discharged while the screen was on,
     * since the last time power was unplugged.
+149 −89

File changed.

Preview size limit exceeded, changes collapsed.

+6 −4
Original line number Diff line number Diff line
@@ -2087,10 +2087,12 @@ public final class ActiveServices {

            // Sanity check: if the service listed for the app is not one
            // we actually are maintaining, just let it drop.
            if (smap.mServicesByName.get(sr.name) != sr) {
                ServiceRecord cur = smap.mServicesByName.get(sr.name);
            final ServiceRecord curRec = smap.mServicesByName.get(sr.name);
            if (curRec != sr) {
                if (curRec != null) {
                    Slog.wtf(TAG, "Service " + sr + " in process " + app
                        + " not same as in map: " + cur);
                            + " not same as in map: " + curRec);
                }
                continue;
            }

+3 −2
Original line number Diff line number Diff line
@@ -135,14 +135,15 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
        enforceCallingPermission();
        synchronized (mStats) {
            mStats.noteStartWakeLocked(uid, pid, name, historyName, type, unimportantForLogging,
                    SystemClock.elapsedRealtime());
                    SystemClock.elapsedRealtime(), SystemClock.uptimeMillis());
        }
    }

    public void noteStopWakelock(int uid, int pid, String name, int type) {
        enforceCallingPermission();
        synchronized (mStats) {
            mStats.noteStopWakeLocked(uid, pid, name, type, SystemClock.elapsedRealtime());
            mStats.noteStopWakeLocked(uid, pid, name, type, SystemClock.elapsedRealtime(),
                    SystemClock.uptimeMillis());
        }
    }