settings: Use proper locking

Change-Id: I0f2c30cb0bb324602738800a8ff81359fa484223
This commit is contained in:
Luca Stefani
2022-01-03 13:22:33 +01:00
parent 2e050a5c98
commit d787f12781

View File

@@ -261,7 +261,7 @@ public final class LineageSettings {
long newValuesVersion = SystemProperties.getLong(mVersionSystemProperty, 0);
// Our own user's settings data uses a client-side cache
synchronized (this) {
synchronized (NameValueCache.this) {
if (mValuesVersion != newValuesVersion) {
if (LOCAL_LOGV || false) {
Log.v(TAG, "invalidate [" + mUri.getLastPathSegment() + "]: current "
@@ -298,7 +298,7 @@ public final class LineageSettings {
String value = b.getPairValue();
// Don't update our cache for reads of other users' data
if (isSelf) {
synchronized (this) {
synchronized (NameValueCache.this) {
mValues.put(name, value);
}
} else {
@@ -328,7 +328,7 @@ public final class LineageSettings {
}
String value = c.moveToNext() ? c.getString(0) : null;
synchronized (this) {
synchronized (NameValueCache.this) {
mValues.put(name, value);
}
if (LOCAL_LOGV) {