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

Commit b2ed35b2 authored by Jason Chiu's avatar Jason Chiu Committed by Android (Google) Code Review
Browse files

Merge "Do not init dashboard categories when SetupWizard isn't finished yet" into udc-dev

parents 122ba167 2560c0df
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import com.android.settingslib.drawer.ProviderTile;
import com.android.settingslib.drawer.Tile;
import com.android.settingslib.drawer.TileUtils;

import com.google.android.setupcompat.util.WizardManagerHelper;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -79,6 +81,9 @@ public class CategoryManager {
    }

    public synchronized List<DashboardCategory> getCategories(Context context) {
        if (!WizardManagerHelper.isUserSetupComplete(context)) {
            return new ArrayList<>();
        }
        tryInitCategories(context);
        return mCategories;
    }
@@ -142,6 +147,10 @@ public class CategoryManager {
    }

    private synchronized void tryInitCategories(Context context, boolean forceClearCache) {
        if (!WizardManagerHelper.isUserSetupComplete(context)) {
            // Don't init while setup wizard is still running.
            return;
        }
        if (mCategories == null) {
            final boolean firstLoading = mCategoryByKeyMap.isEmpty();
            if (forceClearCache) {