summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseBooleanArray.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-02-07 21:56:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-07 21:56:45 +0000
commit68ac5cef63a9fef595a0cd6b7d8f9170994672ad (patch)
tree22006d7568607ac44a27a00b87dfde43cccf1c37 /core/java/android/util/SparseBooleanArray.java
parent8852ab4357ffb653bafb36f3b9272866834f7a72 (diff)
parenteaf2ac464b1cd741d7d0fe700771b1b7c00ddb29 (diff)
Merge "Battery stats: more events, fixes."
Diffstat (limited to 'core/java/android/util/SparseBooleanArray.java')
-rw-r--r--core/java/android/util/SparseBooleanArray.java12
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