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

Commit 882f1a73 authored by Suprabh Shukla's avatar Suprabh Shukla Committed by Android (Google) Code Review
Browse files

Merge "Add a method to note waking network packets to BatteryStats"

parents 52a2b511 53b10b22
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.os;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.net.Network;

import com.android.internal.os.BinderCallsStats;
import com.android.server.power.stats.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
@@ -81,6 +82,15 @@ public abstract class BatteryStatsInternal {
     */
    public abstract void noteJobsDeferred(int uid, int numDeferred, long sinceLast);

    /**
     * Informs battery stats of a data packet that woke up the CPU.
     *
     * @param network The network over which the packet arrived.
     * @param elapsedMillis The time of the packet's arrival in elapsed timebase.
     * @param uid The uid that received the packet.
     */
    public abstract void noteCpuWakingNetworkPacket(Network network, long elapsedMillis, int uid);

    /**
     * Informs battery stats of binder stats for the given work source UID.
     */
+5 −0
Original line number Diff line number Diff line
@@ -456,6 +456,11 @@ public final class BatteryStatsService extends IBatteryStats.Stub
            BatteryStatsService.this.noteJobsDeferred(uid, numDeferred, sinceLast);
        }

        @Override
        public void noteCpuWakingNetworkPacket(Network network, long elapsedMillis, int uid) {
            Slog.d(TAG, "Wakeup due to incoming packet on network " + network + " to uid " + uid);
        }

        @Override
        public void noteBinderCallStats(int workSourceUid, long incrementatCallCount,
                Collection<BinderCallsStats.CallStat> callStats) {