Use Tile.getIcon() to avoid caching issue

Bug: 77600770
Test: robotests
Change-Id: Icb21f5da9b542abc239b04b71813290ad3104ffb
This commit is contained in:
Fan Zhang
2018-07-24 12:49:30 -07:00
parent f24b749ec0
commit 701b65eccc
12 changed files with 167 additions and 142 deletions

View File

@@ -256,7 +256,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
@VisibleForTesting
boolean tintTileIcon(Tile tile) {
if (tile.icon == null) {
if (tile.getIcon() == null) {
return false;
}
// First check if the tile has set the icon tintable metadata.
@@ -330,7 +330,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
/**
* Refresh preference items backed by DashboardCategory.
*/
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
@VisibleForTesting
void refreshDashboardTiles(final String TAG) {
final PreferenceScreen screen = getPreferenceScreen();
@@ -370,7 +370,7 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
continue;
}
if (tintTileIcon(tile)) {
tile.icon.setTint(tintColor);
tile.getIcon().setTint(tintColor);
}
if (mDashboardTilePrefKeys.contains(key)) {
// Have the key already, will rebind.