Merge "Fix ConcurrentModificationException in SummaryLoader."
This commit is contained in:
committed by
Android (Google) Code Review
commit
dbc354113a
@@ -477,7 +477,7 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
final int tintColor = a.getColor(0, mContext.getColor(R.color.fallback_tintColor));
|
||||
a.recycle();
|
||||
if (category != null) {
|
||||
for (Tile tile : category.tiles) {
|
||||
for (Tile tile : category.getTiles()) {
|
||||
if (tile.isIconTintable) {
|
||||
// If this drawable is tintable, tint it to match the color.
|
||||
tile.icon.setTint(tintColor);
|
||||
|
@@ -268,8 +268,9 @@ public class DashboardData {
|
||||
&& hiddenSuggestion == 0);
|
||||
|
||||
if (mCategory != null) {
|
||||
for (int j = 0; j < mCategory.tiles.size(); j++) {
|
||||
final Tile tile = mCategory.tiles.get(j);
|
||||
final List<Tile> tiles = mCategory.getTiles();
|
||||
for (int j = 0; j < tiles.size(); j++) {
|
||||
final Tile tile = tiles.get(j);
|
||||
addToItemList(tile, R.layout.dashboard_tile, Objects.hash(tile.title),
|
||||
true /* add */);
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
|
||||
Log.d(TAG, "NO dashboard tiles for " + TAG);
|
||||
return null;
|
||||
}
|
||||
final List<Tile> tiles = category.tiles;
|
||||
final List<Tile> tiles = category.getTiles();
|
||||
if (tiles == null || tiles.isEmpty()) {
|
||||
Log.d(TAG, "tile list is empty, skipping category " + category.title);
|
||||
return null;
|
||||
|
@@ -307,7 +307,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
Log.d(TAG, "NO dashboard tiles for " + TAG);
|
||||
return;
|
||||
}
|
||||
List<Tile> tiles = category.tiles;
|
||||
final List<Tile> tiles = category.getTiles();
|
||||
if (tiles == null) {
|
||||
Log.d(TAG, "tile list is empty, skipping category " + category.title);
|
||||
return;
|
||||
|
@@ -154,7 +154,7 @@ public class SiteMapManager {
|
||||
continue;
|
||||
}
|
||||
// Build parent-child mPairs for all children listed under this key.
|
||||
for (Tile tile : category.tiles) {
|
||||
for (Tile tile : category.getTiles()) {
|
||||
final String childTitle = tile.title.toString();
|
||||
String childClass = null;
|
||||
if (tile.metaData != null) {
|
||||
|
@@ -216,7 +216,7 @@ public class SummaryLoader {
|
||||
if (category == null) {
|
||||
return;
|
||||
}
|
||||
for (Tile tile : category.tiles) {
|
||||
for (Tile tile : category.getTiles()) {
|
||||
final String key = mDashboardFeatureProvider.getDashboardKeyForTile(tile);
|
||||
if (mSummaryTextMap.containsKey(key)) {
|
||||
tile.summary = mSummaryTextMap.get(key);
|
||||
@@ -250,12 +250,13 @@ public class SummaryLoader {
|
||||
}
|
||||
|
||||
private Tile getTileFromCategory(DashboardCategory category, ComponentName component) {
|
||||
if (category == null || category.tiles == null) {
|
||||
if (category == null || category.getTilesCount() == 0) {
|
||||
return null;
|
||||
}
|
||||
final int tileCount = category.tiles.size();
|
||||
final List<Tile> tiles = category.getTiles();
|
||||
final int tileCount = tiles.size();
|
||||
for (int j = 0; j < tileCount; j++) {
|
||||
final Tile tile = category.tiles.get(j);
|
||||
final Tile tile = tiles.get(j);
|
||||
if (component.equals(tile.intent.getComponent())) {
|
||||
return tile;
|
||||
}
|
||||
@@ -291,10 +292,10 @@ public class SummaryLoader {
|
||||
case MSG_GET_CATEGORY_TILES_AND_SET_LISTENING:
|
||||
final DashboardCategory category =
|
||||
mDashboardFeatureProvider.getTilesForCategory(mCategoryKey);
|
||||
if (category == null || category.tiles == null) {
|
||||
if (category == null || category.getTilesCount() == 0) {
|
||||
return;
|
||||
}
|
||||
final List<Tile> tiles = category.tiles;
|
||||
final List<Tile> tiles = category.getTiles();
|
||||
for (Tile tile : tiles) {
|
||||
makeProviderW(tile);
|
||||
}
|
||||
|
@@ -156,7 +156,7 @@ public class SettingsSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||
continue;
|
||||
}
|
||||
// Build parent-child class pairs for all children listed under this key.
|
||||
for (Tile tile : category.tiles) {
|
||||
for (Tile tile : category.getTiles()) {
|
||||
String childClass = null;
|
||||
if (tile.metaData != null) {
|
||||
childClass = tile.metaData.getString(
|
||||
|
Reference in New Issue
Block a user