diff options
| author | Dianne Hackborn <hackbod@google.com> | 2014-02-07 13:01:07 -0800 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2014-02-07 13:45:01 -0800 |
| commit | eaf2ac464b1cd741d7d0fe700771b1b7c00ddb29 (patch) | |
| tree | 713aa82660964bf18afdc6067f60f1d3663b73ec /core/java/android/util/SparseBooleanArray.java | |
| parent | 6eb0fdb99bc09210bea4df054a9c8a05daea3d1b (diff) | |
Battery stats: more events, fixes.
Add new history events for top application package and
foreground application packages.
Doing this involved a fair amount of improvement to history
events. The event code is now separated out to have "start"
and "finish" identifies, and we use that to now keep track
of which events are active. With that, when resetting the
stats, we can spit out all of the currently active events at
the front of the new history.
Also fixed some problems when I re-arranged the history delta
int bits that were conflicting with the packing of the battery
status bits. These packing structures are changed to work
together correctly.
Change-Id: Ic8b815060dd8a50ff4a0a209efc2e1044215cd88
Diffstat (limited to 'core/java/android/util/SparseBooleanArray.java')
| -rw-r--r-- | core/java/android/util/SparseBooleanArray.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/util/SparseBooleanArray.java b/core/java/android/util/SparseBooleanArray.java index 905dcb018b96..f59ef0f6de07 100644 --- a/core/java/android/util/SparseBooleanArray.java +++ b/core/java/android/util/SparseBooleanArray.java @@ -115,6 +115,13 @@ public class SparseBooleanArray implements Cloneable { } } + /** @hide */ + public void removeAt(int index) { + System.arraycopy(mKeys, index + 1, mKeys, index, mSize - (index + 1)); + System.arraycopy(mValues, index + 1, mValues, index, mSize - (index + 1)); + mSize--; + } + /** * Adds a mapping from the specified key to the specified value, * replacing the previous mapping from the specified key if there @@ -191,6 +198,11 @@ public class SparseBooleanArray implements Cloneable { return mValues[index]; } + /** @hide */ + public void setValueAt(int index, boolean value) { + mValues[index] = value; + } + /** * Returns the index for which {@link #keyAt} would return the * specified key, or a negative number if the specified |
