From 9c7b1319962673658ee28a7845fc0a7cf840c61e Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Wed, 28 Nov 2018 20:13:22 +0000 Subject: Revert "support work chain in pulled atoms" This reverts commit ce8e4dce609541f90c444f27250a6a341b3f1d23. Reason for revert: breaking multiple targets in master Change-Id: I3ee74b314e06cb2c4d3d6da82ca116a91aad67d4 --- core/java/android/os/StatsLogEventWrapper.java | 45 +++----------------------- 1 file changed, 5 insertions(+), 40 deletions(-) (limited to 'core/java/android/os/StatsLogEventWrapper.java') diff --git a/core/java/android/os/StatsLogEventWrapper.java b/core/java/android/os/StatsLogEventWrapper.java index acb9eac3572c..866bd9a17f41 100644 --- a/core/java/android/os/StatsLogEventWrapper.java +++ b/core/java/android/os/StatsLogEventWrapper.java @@ -43,7 +43,6 @@ public final class StatsLogEventWrapper implements Parcelable { int mTag; long mElapsedTimeNs; long mWallClockTimeNs; - WorkSource mWorkSource = null; public StatsLogEventWrapper(int tag, long elapsedTimeNs, long wallClockTimeNs) { this.mTag = tag; @@ -71,17 +70,6 @@ public final class StatsLogEventWrapper implements Parcelable { } }; - /** - * Set work source if any. - */ - public void setWorkSource(WorkSource ws) { - if (ws.getWorkChains() == null || ws.getWorkChains().size() == 0) { - Slog.w(TAG, "Empty worksource!"); - return; - } - mWorkSource = ws; - } - /** * Write a int value. */ @@ -131,6 +119,11 @@ public final class StatsLogEventWrapper implements Parcelable { mValues.add(val ? 1 : 0); } + /** + * Writes the stored fields to a byte array. Will first write a new-line character to denote + * END_LIST before writing contents to byte array. + */ + public void writeToParcel(Parcel out, int flags) { if (DEBUG) { Slog.d(TAG, @@ -140,34 +133,6 @@ public final class StatsLogEventWrapper implements Parcelable { out.writeInt(mTag); out.writeLong(mElapsedTimeNs); out.writeLong(mWallClockTimeNs); - if (mWorkSource != null) { - ArrayList workChains = mWorkSource.getWorkChains(); - // number of chains - out.writeInt(workChains.size()); - for (int i = 0; i < workChains.size(); i++) { - android.os.WorkSource.WorkChain wc = workChains.get(i); - if (wc.getSize() == 0) { - Slog.w(TAG, "Empty work chain."); - out.writeInt(0); - continue; - } - if (wc.getUids().length != wc.getTags().length - || wc.getUids().length != wc.getSize()) { - Slog.w(TAG, "Malformated work chain."); - out.writeInt(0); - continue; - } - // number of nodes - out.writeInt(wc.getSize()); - for (int j = 0; j < wc.getSize(); j++) { - out.writeInt(wc.getUids()[j]); - out.writeString(wc.getTags()[j] == null ? "" : wc.getTags()[j]); - } - } - } else { - // no chains - out.writeInt(0); - } out.writeInt(mTypes.size()); for (int i = 0; i < mTypes.size(); i++) { out.writeInt(mTypes.get(i)); -- cgit v1.2.3