summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/Settings.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 8cdb568b407c..73c29d4058cd 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3036,9 +3036,7 @@ public final class Settings {
public void destroy() {
try {
- // If this process is the system server process, mArray is the same object as
- // the memory int array kept inside SettingsProvider, so skipping the close()
- if (!Settings.isInSystemServer() && !mArray.isClosed()) {
+ if (!mArray.isClosed()) {
mArray.close();
}
} catch (IOException e) {
@@ -3218,8 +3216,9 @@ public final class Settings {
@UnsupportedAppUsage
public String getStringForUser(ContentResolver cr, String name, final int userHandle) {
final boolean isSelf = (userHandle == UserHandle.myUserId());
+ final boolean useCache = isSelf && !isInSystemServer();
boolean needsGenerationTracker = false;
- if (isSelf) {
+ if (useCache) {
synchronized (NameValueCache.this) {
final GenerationTracker generationTracker = mGenerationTrackers.get(name);
if (generationTracker != null) {
@@ -3365,9 +3364,12 @@ public final class Settings {
}
}
} else {
- if (LOCAL_LOGV) Log.i(TAG, "call-query of user " + userHandle
- + " by " + UserHandle.myUserId()
- + " so not updating cache");
+ if (DEBUG || LOCAL_LOGV) {
+ Log.i(TAG, "call-query of user " + userHandle
+ + " by " + UserHandle.myUserId()
+ + (isInSystemServer() ? " in system_server" : "")
+ + " so not updating cache");
+ }
}
return value;
}