From 36744c716794df4b64f3975f165a2d7b2299316d Mon Sep 17 00:00:00 2001 From: Hai Zhang Date: Fri, 11 Sep 2020 11:47:51 -0700 Subject: 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 --- core/java/android/util/IntArray.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/java/android/util/IntArray.java') 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 @@ -143,6 +143,17 @@ public class IntArray implements Cloneable { mSize += count; } + /** + * 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 count values. */ -- cgit v1.2.3