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

Commit ec02e471 authored by Jason Monk's avatar Jason Monk
Browse files

Make sure settings tiles pick up locale changes

Bug: 27727312
Change-Id: Ic54437805bb264dd8e569ac38673c5ee36b2378a
parent ace22ae2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toolbar;
import com.android.settingslib.R;
import com.android.settingslib.applications.InterestingConfigChanges;

import java.util.ArrayList;
import java.util.HashMap;
@@ -55,6 +56,7 @@ public class SettingsDrawerActivity extends Activity {

    private static List<DashboardCategory> sDashboardCategories;
    private static HashMap<Pair<String, String>, Tile> sTileCache;
    private static InterestingConfigChanges sConfigTracker;

    private final PackageReceiver mPackageReceiver = new PackageReceiver();
    private final List<CategoryListener> mCategoryListeners = new ArrayList<>();
@@ -208,6 +210,7 @@ public class SettingsDrawerActivity extends Activity {
    public List<DashboardCategory> getDashboardCategories() {
        if (sDashboardCategories == null) {
            sTileCache = new HashMap<>();
            sConfigTracker = new InterestingConfigChanges();
            sDashboardCategories = TileUtils.getCategories(this, sTileCache);
        }
        return sDashboardCategories;
@@ -267,6 +270,9 @@ public class SettingsDrawerActivity extends Activity {
    private class CategoriesUpdater extends AsyncTask<Void, Void, List<DashboardCategory>> {
        @Override
        protected List<DashboardCategory> doInBackground(Void... params) {
            if (sConfigTracker.applyNewConfig(getResources())) {
                sTileCache.clear();
            }
            return TileUtils.getCategories(SettingsDrawerActivity.this, sTileCache);
        }