Refactor SummaryLoader to set summary on subsetting pages.

- Make a SummaryConsumer interface. Things that needs latest summary
  should implement this interface (DashboardAdapter for homepage,
  DashboardFragment for subsettings). This also decouples SummaryLoader
  from relying on SettingsDrawerActivity.
- Make DashboardFeatureProvider more generic to load DashboardCategory
  by key.

Bug: 31781480
Test: RunSettingsRoboTests
Change-Id: I9c65456fb433a74c352498251e0ccf65da0be1f0
This commit is contained in:
Fan Zhang
2016-10-07 12:41:43 -07:00
parent ce6affc371
commit fabbfb435e
9 changed files with 97 additions and 76 deletions

View File

@@ -25,7 +25,7 @@ import com.android.settings.deviceinfo.SystemUpdatePreferenceController;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.CategoryKey;
import java.util.ArrayList;
import java.util.Arrays;
@@ -62,8 +62,8 @@ public class SystemDashboardFragment extends DashboardFragment {
}
@Override
protected DashboardCategory getDashboardTiles() {
return mDashboardFeatureProvider.getTilesForSystemCategory();
protected String getCategoryKey() {
return CategoryKey.CATEGORY_SYSTEM;
}
/**