Skip to content

Commit

Permalink
Flushing icons of the wrong size. (Bug 11203738)
Browse files Browse the repository at this point in the history
Change-Id: I9468d2e798fcf9890970270041d341e7653432f1
  • Loading branch information
Winson Chung committed Oct 15, 2013
1 parent 2456b97 commit e5467dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/com/android/launcher3/IconCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ public void flush() {
}
}

/**
* 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."
*/
Expand Down
1 change: 1 addition & 0 deletions src/com/android/launcher3/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ protected void onCreate(Bundle savedInstanceState) {
Context.MODE_PRIVATE);
mModel = app.setLauncher(this);
mIconCache = app.getIconCache();
mIconCache.flushInvalidIcons(grid);
mDragController = new DragController(this);
mInflater = getLayoutInflater();

Expand Down

0 comments on commit e5467dc

Please sign in to comment.