diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-01-25 17:14:11 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-01-25 17:14:11 +0000 |
| commit | 3bcddc94acd311af599a8dc6548b22474b63ca38 (patch) | |
| tree | ae07dfa059fa2022634ecec6f11cb8b4def6ae61 /core/java/android | |
| parent | f8fc7235d46b605c845552c23912b0f7a9009013 (diff) | |
| parent | 32684ddf3c4b377c6fd6dccd2119942c0afb04f5 (diff) | |
Merge "Chained attribution for GnssLocationProvider."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/WorkSource.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/os/WorkSource.java b/core/java/android/os/WorkSource.java index 81d750682c78..d59200095e60 100644 --- a/core/java/android/os/WorkSource.java +++ b/core/java/android/os/WorkSource.java @@ -493,6 +493,29 @@ public class WorkSource implements Parcelable { return mChains; } + /** + * DO NOT USE: Hacky API provided solely for {@code GnssLocationProvider}. See + * {@code setReturningDiffs} as well. + * + * @hide + */ + public void transferWorkChains(WorkSource other) { + if (mChains != null) { + mChains.clear(); + } + + if (other.mChains == null || other.mChains.isEmpty()) { + return; + } + + if (mChains == null) { + mChains = new ArrayList<>(4); + } + + mChains.addAll(other.mChains); + other.mChains.clear(); + } + private boolean removeUids(WorkSource other) { int N1 = mNum; final int[] uids1 = mUids; @@ -880,6 +903,13 @@ public class WorkSource implements Parcelable { return mUids[0]; } + /** + * Return the tag associated with the attribution UID. See (@link #getAttributionUid}. + */ + public String getAttributionTag() { + return mTags[0]; + } + // TODO: The following three trivial getters are purely for testing and will be removed // once we have higher level logic in place, e.g for serializing this WorkChain to a proto, // diffing it etc. |
