diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index d6b962d..124c441 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -16,6 +16,11 @@
 
 package com.android.settings;
 
+import static android.content.Intent.EXTRA_USER;
+import static android.content.Intent.EXTRA_USER_ID;
+import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
+import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
+
 import android.annotation.Nullable;
 import android.app.ActivityManager;
 import android.app.AlertDialog;
@@ -104,11 +109,6 @@
 import java.util.List;
 import java.util.Locale;
 
-import static android.content.Intent.EXTRA_USER;
-import static android.content.Intent.EXTRA_USER_ID;
-import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
-import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
-
 public final class Utils extends com.android.settingslib.Utils {
 
     private static final String TAG = "Settings";
diff --git a/src/com/android/settings/applications/UserManagerWrapper.java b/src/com/android/settings/applications/UserManagerWrapper.java
index 5b4ed2a..daefb84 100644
--- a/src/com/android/settings/applications/UserManagerWrapper.java
+++ b/src/com/android/settings/applications/UserManagerWrapper.java
@@ -17,7 +17,6 @@
 package com.android.settings.applications;
 
 import android.content.pm.UserInfo;
-
 import java.util.List;
 
 /**
diff --git a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
index 0160534..d65eb75 100644
--- a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
@@ -16,40 +16,50 @@
 
 package com.android.settings.deviceinfo;
 
+import android.app.LoaderManager;
 import android.content.Context;
+import android.content.Loader;
 import android.os.Bundle;
+import android.os.UserHandle;
 import android.os.UserManager;
 import android.os.storage.StorageManager;
 import android.os.storage.VolumeInfo;
 import android.provider.SearchIndexableResource;
 import android.support.annotation.VisibleForTesting;
+import android.util.SparseArray;
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
+import com.android.settings.applications.PackageManagerWrapperImpl;
 import com.android.settings.applications.UserManagerWrapper;
 import com.android.settings.applications.UserManagerWrapperImpl;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.deviceinfo.storage.SecondaryUserController;
+import com.android.settings.deviceinfo.storage.StorageAsyncLoader;
 import com.android.settings.deviceinfo.storage.StorageItemPreferenceController;
 import com.android.settings.deviceinfo.storage.StorageSummaryDonutPreferenceController;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
+import com.android.settingslib.applications.StorageStatsSource;
 import com.android.settingslib.deviceinfo.StorageManagerVolumeProvider;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
-public class StorageDashboardFragment extends DashboardFragment {
+public class StorageDashboardFragment extends DashboardFragment
+    implements LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.AppsStorageResult>> {
     private static final String TAG = "StorageDashboardFrag";
-    private static final int APPS_JOB_ID = 0;
+    private static final int STORAGE_JOB_ID = 0;
 
     private VolumeInfo mVolume;
 
     private StorageSummaryDonutPreferenceController mSummaryController;
     private StorageItemPreferenceController mPreferenceController;
+    private List<PreferenceController> mSecondaryUsers;
 
     private boolean isVolumeValid() {
         return (mVolume != null) && (mVolume.getType() == VolumeInfo.TYPE_PRIVATE)
@@ -59,7 +69,29 @@
     @Override
     public void onResume() {
         super.onResume();
-        getLoaderManager().initLoader(APPS_JOB_ID, Bundle.EMPTY, mPreferenceController);
+        getLoaderManager().initLoader(STORAGE_JOB_ID, Bundle.EMPTY, this);
+    }
+
+    @Override
+    public Loader<SparseArray<StorageAsyncLoader.AppsStorageResult>> onCreateLoader(int id,
+            Bundle args) {
+        Context context = getContext();
+        return new StorageAsyncLoader(context,
+                new UserManagerWrapperImpl(context.getSystemService(UserManager.class)),
+                mVolume.fsUuid,
+                new StorageStatsSource(context),
+                new PackageManagerWrapperImpl(context.getPackageManager()));
+    }
+
+    @Override
+    public void onLoadFinished(Loader<SparseArray<StorageAsyncLoader.AppsStorageResult>> loader,
+            SparseArray<StorageAsyncLoader.AppsStorageResult> data) {
+        mPreferenceController.onLoadFinished(data.get(UserHandle.myUserId()));
+        updateSecondaryUserControllers(mSecondaryUsers, data);
+    }
+
+    @Override
+    public void onLoaderReset(Loader<SparseArray<StorageAsyncLoader.AppsStorageResult>> loader) {
     }
 
     @Override
@@ -117,7 +149,9 @@
 
         UserManagerWrapper userManager =
                 new UserManagerWrapperImpl(context.getSystemService(UserManager.class));
-        SecondaryUserController.addAllSecondaryUserControllers(context, userManager, controllers);
+        mSecondaryUsers = SecondaryUserController.getSecondaryUserControllers(context, userManager);
+        controllers.addAll(mSecondaryUsers);
+
         controllers.add(new ManageStoragePreferenceController(context));
         return controllers;
     }
@@ -134,6 +168,24 @@
     }
 
     /**
+     * Updates the secondary user controller sizes.
+     */
+    private void updateSecondaryUserControllers(List<PreferenceController> controllers,
+            SparseArray<StorageAsyncLoader.AppsStorageResult> stats) {
+        for (int i = 0, size = controllers.size(); i < size; i++) {
+            PreferenceController controller = controllers.get(i);
+            if (controller instanceof SecondaryUserController) {
+                SecondaryUserController userController = (SecondaryUserController) controller;
+                int userId = userController.getUser().id;
+                StorageAsyncLoader.AppsStorageResult result = stats.get(userId);
+                if (result != null) {
+                    userController.setSize(result.externalStats.totalBytes);
+                }
+            }
+        }
+    }
+
+    /**
      * For Search.
      */
     public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
diff --git a/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java b/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
index b27dfa3..d45c6e3 100644
--- a/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
+++ b/src/com/android/settings/deviceinfo/storage/SecondaryUserController.java
@@ -18,7 +18,8 @@
 
 import android.content.Context;
 import android.content.pm.UserInfo;
-import android.os.UserManager;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.VisibleForTesting;
 import android.support.v7.preference.PreferenceGroup;
 import android.support.v7.preference.PreferenceScreen;
@@ -27,6 +28,7 @@
 import com.android.settings.applications.UserManagerWrapper;
 import com.android.settings.core.PreferenceController;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -37,24 +39,27 @@
     // PreferenceGroupKey to try to add our preference onto.
     private static final String TARGET_PREFERENCE_GROUP_KEY = "pref_secondary_users";
     private static final String PREFERENCE_KEY_BASE = "pref_user_";
+    private static final int SIZE_NOT_SET = -1;
 
-    private UserInfo mUser;
-    private StorageItemPreferenceAlternate mPreference;
+    private @NonNull UserInfo mUser;
+    private @Nullable StorageItemPreferenceAlternate mStoragePreference;
+    private long mSize;
 
     /**
      * Adds the appropriate controllers to a controller list for handling all secondary users on
      * a device.
      * @param context Context for initializing the preference controllers.
-     * @param controllers List of preference controllers for a Settings fragment.
+     * @param userManager UserManagerWrapper for figuring out which controllers to add.
      */
-    public static void addAllSecondaryUserControllers(Context context,
-            UserManagerWrapper userManager, List<PreferenceController> controllers) {
+    public static List<PreferenceController> getSecondaryUserControllers(
+            Context context, UserManagerWrapper userManager) {
+        List<PreferenceController> controllers = new ArrayList<>();
         UserInfo primaryUser = userManager.getPrimaryUser();
         boolean addedUser = false;
         List<UserInfo> infos = userManager.getUsers();
         for (int i = 0, size = infos.size(); i < size; i++) {
             UserInfo info = infos.get(i);
-            if (Utils.isProfileOf(primaryUser, info)) {
+            if (info == null || Utils.isProfileOf(primaryUser, info)) {
                 continue;
             }
 
@@ -65,6 +70,7 @@
         if (!addedUser) {
             controllers.add(new NoSecondaryUserController(context));
         }
+        return controllers;
     }
 
     /**
@@ -73,22 +79,26 @@
      * @param info {@link UserInfo} for the secondary user which this controllers covers.
      */
     @VisibleForTesting
-    SecondaryUserController(Context context, UserInfo info) {
+    SecondaryUserController(Context context, @NonNull UserInfo info) {
         super(context);
         mUser = info;
+        mSize = SIZE_NOT_SET;
     }
 
     @Override
     public void displayPreference(PreferenceScreen screen) {
-        if (mPreference == null) {
-            mPreference = new StorageItemPreferenceAlternate(mContext);
+        if (mStoragePreference == null) {
+            mStoragePreference = new StorageItemPreferenceAlternate(mContext);
 
             PreferenceGroup group =
                     (PreferenceGroup) screen.findPreference(TARGET_PREFERENCE_GROUP_KEY);
-            mPreference.setTitle(mUser.name);
-            mPreference.setKey(PREFERENCE_KEY_BASE + mUser.id);
+            mStoragePreference.setTitle(mUser.name);
+            mStoragePreference.setKey(PREFERENCE_KEY_BASE + mUser.id);
+            if (mSize != SIZE_NOT_SET) {
+                mStoragePreference.setStorageSize(mSize);
+            }
             group.setVisible(true);
-            group.addPreference(mPreference);
+            group.addPreference(mStoragePreference);
         }
     }
 
@@ -99,7 +109,15 @@
 
     @Override
     public String getPreferenceKey() {
-        return (mPreference != null) ? mPreference.getKey() : null;
+        return mStoragePreference != null ? mStoragePreference.getKey() : null;
+    }
+
+    /**
+     * Returns the user for which this is the secondary user controller.
+     */
+    @NonNull
+    public UserInfo getUser() {
+        return mUser;
     }
 
     /**
@@ -107,8 +125,9 @@
      * @param size Size in bytes.
      */
     public void setSize(long size) {
-        if (mPreference != null) {
-            mPreference.setStorageSize(size);
+        mSize = size;
+        if (mStoragePreference != null) {
+            mStoragePreference.setStorageSize(mSize);
         }
     }
 
diff --git a/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java b/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
index b16590e..4e39bb3 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageAsyncLoader.java
@@ -21,46 +21,61 @@
 
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
+import android.content.pm.UserInfo;
 import android.os.UserHandle;
+import android.util.ArrayMap;
 import android.util.ArraySet;
+import android.util.SparseArray;
 
 import com.android.settings.applications.PackageManagerWrapper;
+import com.android.settings.applications.UserManagerWrapper;
 import com.android.settings.utils.AsyncLoader;
+import com.android.settingslib.applications.StorageStatsSource;
 
 import java.util.List;
+import java.util.Map;
 
 /**
- * AppsAsyncLoader is a Loader which loads app storage information and categories it by the app's
- * specified categorization.
+ * StorageAsyncLoader is a Loader which loads categorized app information and external stats for all
+ * users
  */
-public class StorageAsyncLoader extends AsyncLoader<StorageAsyncLoader.AppsStorageResult> {
-    private int mUserId;
+public class StorageAsyncLoader
+        extends AsyncLoader<SparseArray<StorageAsyncLoader.AppsStorageResult>> {
+    private UserManagerWrapper mUserManager;
     private String mUuid;
     private StorageStatsSource mStatsManager;
     private PackageManagerWrapper mPackageManager;
 
-    public StorageAsyncLoader(Context context, int userId, String uuid, StorageStatsSource source,
-            PackageManagerWrapper pm) {
+    public StorageAsyncLoader(Context context, UserManagerWrapper userManager,
+            String uuid, StorageStatsSource source, PackageManagerWrapper pm) {
         super(context);
-        mUserId = userId;
+        mUserManager = userManager;
         mUuid = uuid;
         mStatsManager = source;
         mPackageManager = pm;
     }
 
     @Override
-    public AppsStorageResult loadInBackground() {
+    public SparseArray<AppsStorageResult> loadInBackground() {
         return loadApps();
     }
 
-    private AppsStorageResult loadApps() {
-        AppsStorageResult result = new AppsStorageResult();
-        ArraySet<Integer> seenUid = new ArraySet<>(); // some apps share a uid
+    private SparseArray<AppsStorageResult> loadApps() {
+        SparseArray<AppsStorageResult> result = new SparseArray<>();
+        List<UserInfo> infos = mUserManager.getUsers();
+        for (int i = 0, userCount = infos.size(); i < userCount; i++) {
+            UserInfo info = infos.get(i);
+            result.put(info.id, getStorageResultForUser(info.id));
+        }
+        return result;
+    }
 
+    private AppsStorageResult getStorageResultForUser(int userId) {
         List<ApplicationInfo> applicationInfos =
-                mPackageManager.getInstalledApplicationsAsUser(0, mUserId);
-        int size = applicationInfos.size();
-        for (int i = 0; i < size; i++) {
+                mPackageManager.getInstalledApplicationsAsUser(0, userId);
+        ArraySet<Integer> seenUid = new ArraySet<>(); // some apps share a uid
+        AppsStorageResult result = new AppsStorageResult();
+        for (int i = 0, size = applicationInfos.size(); i < size; i++) {
             ApplicationInfo app = applicationInfos.get(i);
             if (seenUid.contains(app.uid)) {
                 continue;
@@ -83,12 +98,12 @@
             }
         }
 
-        result.externalStats = mStatsManager.getExternalStorageStats(mUuid, UserHandle.of(mUserId));
+        result.externalStats = mStatsManager.getExternalStorageStats(mUuid, UserHandle.of(userId));
         return result;
     }
 
     @Override
-    protected void onDiscardResult(AppsStorageResult result) {
+    protected void onDiscardResult(SparseArray<AppsStorageResult> result) {
     }
 
     public static class AppsStorageResult {
diff --git a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceAlternate.java b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceAlternate.java
index 932a779..d5a36b9 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceAlternate.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceAlternate.java
@@ -18,10 +18,8 @@
 
 import android.content.Context;
 import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceViewHolder;
 import android.text.format.Formatter;
 import android.util.AttributeSet;
-import android.view.View;
 
 import com.android.settings.R;
 
diff --git a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
index 7afd061..88ba152 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
@@ -17,11 +17,9 @@
 package com.android.settings.deviceinfo.storage;
 
 import android.app.Fragment;
-import android.app.LoaderManager;
 import android.content.ActivityNotFoundException;
 import android.content.Context;
 import android.content.Intent;
-import android.content.Loader;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -36,22 +34,21 @@
 import com.android.settings.Settings;
 import com.android.settings.Utils;
 import com.android.settings.applications.ManageApplications;
-import com.android.settings.applications.PackageManagerWrapperImpl;
 import com.android.settings.core.PreferenceController;
 import com.android.settings.core.instrumentation.MetricsFeatureProvider;
 
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.deviceinfo.StorageMeasurement;
 import com.android.settingslib.deviceinfo.StorageVolumeProvider;
+import com.android.settingslib.applications.StorageStatsSource;
 
-import java.util.HashMap;
+import java.util.Map;
 
 /**
  * StorageItemPreferenceController handles the storage line items which summarize the storage
  * categorization breakdown.
  */
-public class StorageItemPreferenceController extends PreferenceController
-        implements LoaderManager.LoaderCallbacks<StorageAsyncLoader.AppsStorageResult> {
+public class StorageItemPreferenceController extends PreferenceController {
     private static final String TAG = "StorageItemPreference";
 
     private static final String IMAGE_MIME_TYPE = "image/*";
@@ -170,17 +167,7 @@
         mFilePreference = (StorageItemPreferenceAlternate) screen.findPreference(FILES_KEY);
     }
 
-    @Override
-    public Loader<StorageAsyncLoader.AppsStorageResult> onCreateLoader(int id,
-            Bundle args) {
-        return new StorageAsyncLoader(mContext, UserHandle.myUserId(), mVolume.fsUuid,
-                new StorageStatsSource(mContext),
-                new PackageManagerWrapperImpl(mContext.getPackageManager()));
-    }
-
-    @Override
-    public void onLoadFinished(Loader<StorageAsyncLoader.AppsStorageResult> loader,
-            StorageAsyncLoader.AppsStorageResult data) {
+    public void onLoadFinished(StorageAsyncLoader.AppsStorageResult data) {
         mPhotoPreference.setStorageSize(
                 data.externalStats.imageBytes + data.externalStats.videoBytes);
         mAudioPreference.setStorageSize(data.musicAppsSize + data.externalStats.audioBytes);
@@ -193,10 +180,6 @@
         mFilePreference.setStorageSize(unattributedBytes);
     }
 
-    @Override
-    public void onLoaderReset(Loader<StorageAsyncLoader.AppsStorageResult> loader) {
-    }
-
     /**
      * Sets the system size for the system size preference.
      * @param systemSize the size of the system in bytes
@@ -266,7 +249,7 @@
     private static long totalValues(StorageMeasurement.MeasurementDetails details, int userId,
             String... keys) {
         long total = 0;
-        HashMap<String, Long> map = details.mediaSize.get(userId);
+        Map<String, Long> map = details.mediaSize.get(userId);
         if (map != null) {
             for (String key : keys) {
                 if (map.containsKey(key)) {
