Merge "Do not init dashboard categories when SetupWizard isn't finished yet" into udc-dev am: b2ed35b2ae
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23486247 Change-Id: I8a7966fd9f3ee88683c35fd4f2bd7b60b475cbcc Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -34,6 +34,8 @@ import com.android.settingslib.drawer.ProviderTile;
|
|||||||
import com.android.settingslib.drawer.Tile;
|
import com.android.settingslib.drawer.Tile;
|
||||||
import com.android.settingslib.drawer.TileUtils;
|
import com.android.settingslib.drawer.TileUtils;
|
||||||
|
|
||||||
|
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -79,6 +81,9 @@ public class CategoryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized List<DashboardCategory> getCategories(Context context) {
|
public synchronized List<DashboardCategory> getCategories(Context context) {
|
||||||
|
if (!WizardManagerHelper.isUserSetupComplete(context)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
tryInitCategories(context);
|
tryInitCategories(context);
|
||||||
return mCategories;
|
return mCategories;
|
||||||
}
|
}
|
||||||
@@ -142,6 +147,10 @@ public class CategoryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void tryInitCategories(Context context, boolean forceClearCache) {
|
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) {
|
if (mCategories == null) {
|
||||||
final boolean firstLoading = mCategoryByKeyMap.isEmpty();
|
final boolean firstLoading = mCategoryByKeyMap.isEmpty();
|
||||||
if (forceClearCache) {
|
if (forceClearCache) {
|
||||||
|
Reference in New Issue
Block a user