Loading src/com/android/launcher3/IconCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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, Loading src/com/android/launcher3/LauncherBackupHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -601,10 +601,11 @@ public class LauncherBackupHelper implements BackupHelper { Bitmap icon = BitmapFactory.decodeByteArray(res.data, 0, res.data.length); if (icon == null) { Log.w(TAG, "failed to unpack icon for " + key.name); } } else { if (VERBOSE) Log.v(TAG, "saving restored icon as: " + key.name); mIconCache.preloadIcon(ComponentName.unflattenFromString(key.name), icon, res.dpi, "" /* label */, mUserSerial); "" /* label */, mUserSerial, mIdp); } } /** Loading Loading @@ -685,7 +686,7 @@ public class LauncherBackupHelper implements BackupHelper { Log.w(TAG, "failed to unpack widget icon for " + key.name); } else { mIconCache.preloadIcon(ComponentName.unflattenFromString(widget.provider), icon, widget.icon.dpi, widget.label, mUserSerial); icon, widget.icon.dpi, widget.label, mUserSerial, mIdp); } } Loading Loading
src/com/android/launcher3/IconCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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, Loading
src/com/android/launcher3/LauncherBackupHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -601,10 +601,11 @@ public class LauncherBackupHelper implements BackupHelper { Bitmap icon = BitmapFactory.decodeByteArray(res.data, 0, res.data.length); if (icon == null) { Log.w(TAG, "failed to unpack icon for " + key.name); } } else { if (VERBOSE) Log.v(TAG, "saving restored icon as: " + key.name); mIconCache.preloadIcon(ComponentName.unflattenFromString(key.name), icon, res.dpi, "" /* label */, mUserSerial); "" /* label */, mUserSerial, mIdp); } } /** Loading Loading @@ -685,7 +686,7 @@ public class LauncherBackupHelper implements BackupHelper { Log.w(TAG, "failed to unpack widget icon for " + key.name); } else { mIconCache.preloadIcon(ComponentName.unflattenFromString(widget.provider), icon, widget.icon.dpi, widget.label, mUserSerial); icon, widget.icon.dpi, widget.label, mUserSerial, mIdp); } } Loading