diff --git a/src/com/android/documentsui/DocumentsApplication.java b/src/com/android/documentsui/DocumentsApplication.java
index 60fbdaf..c5be414 100644
--- a/src/com/android/documentsui/DocumentsApplication.java
+++ b/src/com/android/documentsui/DocumentsApplication.java
@@ -83,20 +83,7 @@
     private Lookup<String, String> mFileTypeLookup;
 
     public static ProvidersCache getProvidersCache(Context context) {
-        ProvidersCache providers =
-                ((DocumentsApplication) context.getApplicationContext()).mProviders;
-        final ConfigStore configStore = getConfigStore();
-        // When private space in DocsUI is enabled then ProvidersCache should use UserManagerState
-        // else it should use UserIdManager. The following if-check will ensure the construction of
-        // a new ProvidersCache instance whenever there is a mismatch in this.
-        if (configStore.isPrivateSpaceInDocsUIEnabled()
-                != providers.isProvidersCacheUsingUserManagerState()) {
-            providers = configStore.isPrivateSpaceInDocsUIEnabled()
-                    ? new ProvidersCache(context, getUserManagerState(context), configStore)
-                    : new ProvidersCache(context, getUserIdManager(context), configStore);
-            ((DocumentsApplication) context.getApplicationContext()).mProviders = providers;
-        }
-        return providers;
+        return ((DocumentsApplication) context.getApplicationContext()).mProviders;
     }
 
     public static ThumbnailCache getThumbnailCache(Context context) {
@@ -212,16 +199,11 @@
         if (getConfigStore().isPrivateSpaceInDocsUIEnabled()) {
             mUserManagerState = UserManagerState.create(this);
             mUserIdManager = null;
-            synchronized (DocumentsApplication.class) {
-                mProviders = new ProvidersCache(this, mUserManagerState, getConfigStore());
-            }
         } else {
             mUserManagerState = null;
             mUserIdManager = UserIdManager.create(this);
-            synchronized (DocumentsApplication.class) {
-                mProviders = new ProvidersCache(this, mUserIdManager, getConfigStore());
-            }
         }
+        mProviders = new ProvidersCache(this);
 
         mProviders.updateAsync(/* forceRefreshAll= */ false, /* callback= */  null);
 
diff --git a/src/com/android/documentsui/roots/ProvidersCache.java b/src/com/android/documentsui/roots/ProvidersCache.java
index 080b729..6750584 100644
--- a/src/com/android/documentsui/roots/ProvidersCache.java
+++ b/src/com/android/documentsui/roots/ProvidersCache.java
@@ -49,11 +49,8 @@
 import androidx.annotation.Nullable;
 import androidx.localbroadcastmanager.content.LocalBroadcastManager;
 
-import com.android.documentsui.ConfigStore;
 import com.android.documentsui.DocumentsApplication;
 import com.android.documentsui.R;
-import com.android.documentsui.UserIdManager;
-import com.android.documentsui.UserManagerState;
 import com.android.documentsui.UserPackage;
 import com.android.documentsui.archives.ArchivesProvider;
 import com.android.documentsui.base.LookupApplicationName;
@@ -123,27 +120,8 @@
     @GuardedBy("mObservedAuthoritiesDetails")
     private final Map<UserAuthority, PackageDetails> mObservedAuthoritiesDetails = new HashMap<>();
 
-    private final UserIdManager mUserIdManager;
-    private final UserManagerState mUserManagerState;
-    private final ConfigStore mConfigStore;
-
-    public ProvidersCache(Context context, UserIdManager userIdManager, ConfigStore configStore) {
+    public ProvidersCache(Context context) {
         mContext = context;
-        mUserIdManager = userIdManager;
-        mUserManagerState = null;
-        mConfigStore = configStore;
-    }
-
-    public ProvidersCache(Context context, UserManagerState userManagerState,
-            ConfigStore configStore) {
-        mContext = context;
-        mUserIdManager = null;
-        mUserManagerState = userManagerState;
-        mConfigStore = configStore;
-    }
-
-    public boolean isProvidersCacheUsingUserManagerState() {
-        return mUserManagerState != null;
     }
 
     /**
@@ -220,7 +198,7 @@
         // For that reason we update our RecentsRoot to reflect
         // the current language.
         final String title = mContext.getString(R.string.root_recent);
-        List<UserId> userIds = getUserIds();
+        List<UserId> userIds = new ArrayList<>(getUserIds());
         for (UserId userId : userIds) {
             RootInfo recentRoot = createOrGetRecentsRoot(userId);
             recentRoot.title = title;
@@ -727,9 +705,9 @@
     }
 
     private List<UserId> getUserIds() {
-        if (mConfigStore.isPrivateSpaceInDocsUIEnabled()) {
-            return mUserManagerState.getUserIds();
+        if (DocumentsApplication.getConfigStore().isPrivateSpaceInDocsUIEnabled()) {
+            return DocumentsApplication.getUserManagerState(mContext).getUserIds();
         }
-        return mUserIdManager.getUserIds();
+        return DocumentsApplication.getUserIdManager(mContext).getUserIds();
     }
 }
