From 6a769b52e28559123f2615d2df82fc47c59bf193 Mon Sep 17 00:00:00 2001 From: Matt Pape Date: Fri, 12 Jul 2019 15:53:03 -0700 Subject: [PATCH] Update GenerationRegistry to account for config table. Update comments and increase the initial size of the backing store by one to account for the new table. Test: atest FrameworksCoreTests:DeviceConfigTest adding/updating/deleting global and secure settings via adb Change-Id: I68aad0c4c80611a35479f27a1bb03cdf751545fc --- .../settings/GenerationRegistry.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java b/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java index 044ec867aef43..56173310a8bb8 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/GenerationRegistry.java @@ -22,14 +22,16 @@ import android.provider.Settings; import android.util.MemoryIntArray; import android.util.Slog; import android.util.SparseIntArray; + import com.android.internal.annotations.GuardedBy; import java.io.IOException; /** - * This class tracks changes for global/secure/system tables on a - * per user basis and updates a shared memory region which client - * processes can read to determine if their local caches are stale, + * This class tracks changes for config/global/secure/system tables + * on a per user basis and updates a shared memory region which + * client processes can read to determine if their local caches are + * stale. */ final class GenerationRegistry { private static final String LOG_TAG = "GenerationRegistry"; @@ -114,11 +116,12 @@ final class GenerationRegistry { @GuardedBy("mLock") private MemoryIntArray getBackingStoreLocked() { if (mBackingStore == null) { - // One for the global table, two for system and secure tables for a - // managed profile (managed profile is not included in the max user - // count), ten for partially deleted users if users are quickly removed, - // and twice max user count for system and secure. - final int size = 1 + 2 + 10 + 2 * UserManager.getMaxSupportedUsers(); + // One for the config table, one for the global table, two for system + // and secure tables for a managed profile (managed profile is not + // included in the max user count), ten for partially deleted users if + // users are quickly removed, and twice max user count for system and + // secure. + final int size = 1 + 1 + 2 + 10 + 2 * UserManager.getMaxSupportedUsers(); try { mBackingStore = new MemoryIntArray(size); if (DEBUG) {