Merge "Make sure TileAdapter always has a SuggestionParser" into nyc-dev
am: a50a14a23a
* commit 'a50a14a23a4f57203d01489ddef607f46f485518':
Make sure TileAdapter always has a SuggestionParser
Change-Id: I87ee80fa989079c554c60870b9ddc70d3b36c5e4
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index fadc023..3fb413a 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -80,9 +80,10 @@
private Condition mExpandedCondition = null;
private SuggestionParser mSuggestionParser;
- public DashboardAdapter(Context context) {
+ public DashboardAdapter(Context context, SuggestionParser parser) {
mContext = context;
mCache = new IconCache(context);
+ mSuggestionParser = parser;
setHasStableIds(true);
setShowingAll(true);
@@ -92,9 +93,8 @@
return mSuggestions;
}
- public void setSuggestions(List<Tile> suggestions, SuggestionParser parser) {
+ public void setSuggestions(List<Tile> suggestions) {
mSuggestions = suggestions;
- mSuggestionParser = parser;
recountItems();
}
diff --git a/src/com/android/settings/dashboard/DashboardSummary.java b/src/com/android/settings/dashboard/DashboardSummary.java
index de7ba9e..80b6520 100644
--- a/src/com/android/settings/dashboard/DashboardSummary.java
+++ b/src/com/android/settings/dashboard/DashboardSummary.java
@@ -178,7 +178,7 @@
mDashboard.setHasFixedSize(true);
mDashboard.setListener(this);
mDashboard.addItemDecoration(new DashboardDecorator(getContext()));
- mAdapter = new DashboardAdapter(getContext());
+ mAdapter = new DashboardAdapter(getContext(), mSuggestionParser);
mAdapter.setConditions(mConditionManager.getConditions());
mDashboard.setAdapter(mAdapter);
mSummaryLoader.setAdapter(mAdapter);
@@ -230,7 +230,7 @@
@Override
protected void onPostExecute(List<Tile> tiles) {
- mAdapter.setSuggestions(tiles, mSuggestionParser);
+ mAdapter.setSuggestions(tiles);
}
}
}