summaryrefslogtreecommitdiff
path: root/core/java/android/util/IntArray.java
diff options
context:
space:
mode:
authorHai Zhang <zhanghai@google.com>2020-09-11 11:47:51 -0700
committerHai Zhang <zhanghai@google.com>2020-09-21 22:25:50 -0700
commit36744c716794df4b64f3975f165a2d7b2299316d (patch)
treef26567390978d40ebd2a296db013151edceef804 /core/java/android/util/IntArray.java
parent26b039a88f05523d8d7e7738680f465b270f1b3c (diff)
Refactor PermissionsState to be a data class for migration.
PackageManager Settings will now read permission state from PermissionManager as well, to maintain compatibility for dump and the package list file. As a result, we no longer need to write back to this legacy state before dump and writing package list. We still need to do so before we finish persistence migration though. The new AppIdPermissionState will be a system API once we finish migration of BasePermission. Bug: 158736025 Test: presubmit Change-Id: I3c7f20cef54084255108a0a889d8a3d7e3ab9d88
Diffstat (limited to 'core/java/android/util/IntArray.java')
-rw-r--r--core/java/android/util/IntArray.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/util/IntArray.java b/core/java/android/util/IntArray.java
index 5a74ec0e52c0..b77265b0ebf6 100644
--- a/core/java/android/util/IntArray.java
+++ b/core/java/android/util/IntArray.java
@@ -144,6 +144,17 @@ public class IntArray implements Cloneable {
}
/**
+ * Adds the values in the specified array to this array.
+ */
+ public void addAll(int[] values) {
+ final int count = values.length;
+ ensureCapacity(count);
+
+ System.arraycopy(values, 0, mValues, mSize, count);
+ mSize += count;
+ }
+
+ /**
* Ensures capacity to append at least <code>count</code> values.
*/
private void ensureCapacity(int count) {