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

Commit d2d3e2cc authored by Fan Zhang's avatar Fan Zhang
Browse files

Move category refresh call into a separeate method.

By default we no longer refresh category with each setTileEnabled.
Instead app will call update after all setTileEnabled are called.

This saves a lot of async task execution when Settings app starts

Bug: 34103984
Test: RunSettingsRoboTest (no regresssion)
Change-Id: I71ddcdb3e1fc0df6cacb53583a4f7e8ae8d675f1
parent 424bce6e
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -377,13 +377,19 @@ public class SettingsDrawerActivity extends Activity {
                    ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                    : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                    PackageManager.DONT_KILL_APP);
        }
    }

    /**
     * Updates dashboard categories. Only necessary to call this after setTileEnabled
     */
    public void updateCategories() {
        if (isDashboardFeatureEnabled()) {
            new CategoriesUpdateTask().execute();
        } else {
            new CategoriesUpdater().execute();
        }
    }
    }

    public String getSettingPkg() {
        return TileUtils.SETTING_PKG;