diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-07-20 14:32:48 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-07-20 14:34:30 -0700 |
commit | df6ccf81960ab73d46570d56443e94c4df48e0c8 (patch) | |
tree | 37644b4c185ecbfa41ab2429ee8087efba87c0da /src/com/android/launcher3/IconCache.java | |
parent | e3fe3f89ee956e8d7995c569948cb70765ec19b8 (diff) | |
download | android_packages_apps_Trebuchet-df6ccf81960ab73d46570d56443e94c4df48e0c8.tar.gz android_packages_apps_Trebuchet-df6ccf81960ab73d46570d56443e94c4df48e0c8.tar.bz2 android_packages_apps_Trebuchet-df6ccf81960ab73d46570d56443e94c4df48e0c8.zip |
Resizing the bitmap before caching it in the DB
> The icon size in the backup can be different that what is
required by the device. We should resize the icon, before
caching it.
Bug: 22413328
Change-Id: Id77c53edf8ea5e95a2d32dbe22be553120279ebd
Diffstat (limited to 'src/com/android/launcher3/IconCache.java')
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 916418f18..b4ca515d8 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -649,7 +649,7 @@ public class IconCache { * @param dpi the native density of the icon */ public void preloadIcon(ComponentName componentName, Bitmap icon, int dpi, String label, - long userSerial) { + long userSerial, InvariantDeviceProfile idp) { // TODO rescale to the correct native DPI try { PackageManager packageManager = mContext.getPackageManager(); @@ -660,7 +660,9 @@ public class IconCache { // pass } - ContentValues values = newContentValues(icon, label, Color.TRANSPARENT); + ContentValues values = newContentValues( + Bitmap.createScaledBitmap(icon, idp.iconBitmapSize, idp.iconBitmapSize, true), + label, Color.TRANSPARENT); values.put(IconDB.COLUMN_COMPONENT, componentName.flattenToString()); values.put(IconDB.COLUMN_USER, userSerial); mIconDb.getWritableDatabase().insertWithOnConflict(IconDB.TABLE_NAME, null, values, |