Embedding the icon pixel size in the cache DB version.

This causes the cache to get reset when the icon size changes,
for eg, in case of display scale changes

Bug: 27701193
Change-Id: Ib11144757a93cb50fb233d855902c0b2c15afbed
This commit is contained in:
Sunny Goyal
2016-03-22 14:32:44 -07:00
parent 20adc79a90
commit 16affbdf30

View File

@@ -118,7 +118,7 @@ public class IconCache {
mUserManager = UserManagerCompat.getInstance(mContext);
mLauncherApps = LauncherAppsCompat.getInstance(mContext);
mIconDpi = inv.fillResIconDpi;
mIconDb = new IconDB(context);
mIconDb = new IconDB(context, inv.iconBitmapSize);
mWorkerHandler = new Handler(LauncherModel.getWorkerLooper());
@@ -809,8 +809,10 @@ public class IconCache {
private final static String COLUMN_LABEL = "label";
private final static String COLUMN_SYSTEM_STATE = "system_state";
public IconDB(Context context) {
super(context, LauncherFiles.APP_ICONS_DB, RELEASE_VERSION, TABLE_NAME);
public IconDB(Context context, int iconPixelSize) {
super(context, LauncherFiles.APP_ICONS_DB,
(RELEASE_VERSION << 16) + iconPixelSize,
TABLE_NAME);
}
@Override