Merge "Add a method to note waking network packets to BatteryStats" am: b3238fc8a4

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2403112

Change-Id: I249d7181241140b8267544e27510d8758e057791
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-01-28 12:26:01 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 0 deletions

View File

@@ -16,6 +16,8 @@
package android.os;
import android.net.Network;
import com.android.internal.os.BinderCallsStats;
import com.android.internal.os.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
@@ -62,6 +64,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.
*/

View File

@@ -441,6 +441,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) {