Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a3a9281 authored by Matt Pape's avatar Matt Pape Committed by Android (Google) Code Review
Browse files

Merge "Update GenerationRegistry to account for config table."

parents 007d85d5 6a769b52
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -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) {