Fix race condition and optimize categoryUpdater refresh
- In SettingsActivity, do not call updateCategories() if nothing changed. - In SummaryLoader, create a mapping between tile key and summary. This is necessary to handle a race condition where category is refreshed after summary load. - In DashboardSummary, refresh Tile's summary to latest cache value everytime category is refreshed. Change-Id: I61389b8ba614ba7e34939325bada6e1bd6fa6709 Fix: 63149109 Test: robotests
This commit is contained in:
@@ -294,10 +294,12 @@ public class DashboardSummary extends InstrumentedFragment
|
||||
|
||||
final DashboardCategory category = mDashboardFeatureProvider.getTilesForCategory(
|
||||
CategoryKey.CATEGORY_HOMEPAGE);
|
||||
mSummaryLoader.updateSummaryToCache(category);
|
||||
if (suggestions != null) {
|
||||
mAdapter.setCategoriesAndSuggestions(category, suggestions);
|
||||
} else {
|
||||
mAdapter.setCategory(category);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user