summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhming Chen <ahmingchen@google.com>2019-05-02 05:52:59 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-03 10:22:41 (GMT)
commit9cb88f8e11f5ad50efa858eb5f6d46628e53813e (patch)
treec3fadb8869ff0993219cfea3c0667b0486725d5f
parente87069a04106a3bcd2f5546830ab49550ad2230c (diff)
downloadframeworks_base-9cb88f8e11f5ad50efa858eb5f6d46628e53813e.zip
frameworks_base-9cb88f8e11f5ad50efa858eb5f6d46628e53813e.tar.gz
frameworks_base-9cb88f8e11f5ad50efa858eb5f6d46628e53813e.tar.bz2
Revert "DO NOT MERGE Make a copy of data stored in LockSettingsStorage cache"
This reverts commit 567f2357f9fda4eb40594f52342b85540b817287. Reason for revert: <INSERT REASONING HERE> Change-Id: I0bc0183de916f29f79d0cee053043cf6c323f167 (cherry picked from commit bae09a535892453bf72741b0cd60e6502814f469)
-rw-r--r--services/core/java/com/android/server/locksettings/LockSettingsStorage.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsStorage.java b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java
index 2ede384..98f1740 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsStorage.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java
@@ -29,6 +29,7 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.os.Environment;
import android.os.UserHandle;
import android.os.UserManager;
+import android.os.storage.StorageManager;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Slog;
@@ -48,7 +49,6 @@ import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -808,7 +808,7 @@ class LockSettingsStorage {
}
byte[] peekFile(String fileName) {
- return copyOf((byte[]) peek(CacheKey.TYPE_FILE, fileName, -1 /* userId */));
+ return (byte[]) peek(CacheKey.TYPE_FILE, fileName, -1 /* userId */);
}
boolean hasFile(String fileName) {
@@ -816,11 +816,11 @@ class LockSettingsStorage {
}
void putFile(String key, byte[] value) {
- put(CacheKey.TYPE_FILE, key, copyOf(value), -1 /* userId */);
+ put(CacheKey.TYPE_FILE, key, value, -1 /* userId */);
}
void putFileIfUnchanged(String key, byte[] value, int version) {
- putIfUnchanged(CacheKey.TYPE_FILE, key, copyOf(value), -1 /* userId */, version);
+ putIfUnchanged(CacheKey.TYPE_FILE, key, value, -1 /* userId */, version);
}
void setFetched(int userId) {
@@ -868,10 +868,6 @@ class LockSettingsStorage {
mVersion++;
}
- private byte[] copyOf(byte[] data) {
- return data != null ? Arrays.copyOf(data, data.length) : null;
- }
-
synchronized void purgePath(String path) {
for (int i = mCache.size() - 1; i >= 0; i--) {
CacheKey entry = mCache.keyAt(i);