diff options
| author | Fabian Kozynski <kozynski@google.com> | 2018-11-28 20:13:22 +0000 |
|---|---|---|
| committer | Fabian Kozynski <kozynski@google.com> | 2018-11-28 20:13:22 +0000 |
| commit | 9c7b1319962673658ee28a7845fc0a7cf840c61e (patch) | |
| tree | 80b330315e2ce7fbc31bdd04b105651265edf6ad /core/java/android/os/StatsLogEventWrapper.java | |
| parent | ce8e4dce609541f90c444f27250a6a341b3f1d23 (diff) | |
Revert "support work chain in pulled atoms"
This reverts commit ce8e4dce609541f90c444f27250a6a341b3f1d23.
Reason for revert: breaking multiple targets in master
Change-Id: I3ee74b314e06cb2c4d3d6da82ca116a91aad67d4
Diffstat (limited to 'core/java/android/os/StatsLogEventWrapper.java')
| -rw-r--r-- | core/java/android/os/StatsLogEventWrapper.java | 45 |
1 files changed, 5 insertions, 40 deletions
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; @@ -72,17 +71,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. */ public void writeInt(int val) { @@ -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<android.os.WorkSource.WorkChain> 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)); |
