am e5467dcc: Flushing icons of the wrong size. (Bug 11203738)

* commit 'e5467dccdd26ff912afb43d626346e4506c9c062':
  Flushing icons of the wrong size. (Bug 11203738)
This commit is contained in:
Winson Chung
2013-10-14 17:23:01 -07:00
committed by Android Git Automerger
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -146,6 +146,20 @@ public class IconCache {
}
}
/**
* Empty out the cache that aren't of the correct grid size
*/
public void flushInvalidIcons(DeviceProfile grid) {
synchronized (mCache) {
for (ComponentName cn : mCache.keySet()) {
final CacheEntry e = mCache.get(cn);
if (e.icon.getWidth() != grid.iconSizePx || e.icon.getHeight() != grid.iconSizePx) {
mCache.remove(cn);
}
}
}
}
/**
* Fill in "application" with the icon and label for "info."
*/
+1
View File
@@ -402,6 +402,7 @@ public class Launcher extends Activity
Context.MODE_PRIVATE);
mModel = app.setLauncher(this);
mIconCache = app.getIconCache();
mIconCache.flushInvalidIcons(grid);
mDragController = new DragController(this);
mInflater = getLayoutInflater();