summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2013-10-04 10:10:21 -0400
committerChris Wren <cwren@android.com>2013-10-04 14:46:47 +0000
commitb86f07696cd85c0b441b48895392da636ea601cb (patch)
tree3d49d74de6e86bacd407f069b4209c4433f2e0c4
parent978194c6082770ec6474a08223bad69c4a451a31 (diff)
downloadandroid_packages_apps_Trebuchet-b86f07696cd85c0b441b48895392da636ea601cb.tar.gz
android_packages_apps_Trebuchet-b86f07696cd85c0b441b48895392da636ea601cb.tar.bz2
android_packages_apps_Trebuchet-b86f07696cd85c0b441b48895392da636ea601cb.zip
use PNG as the transport encoding for images
Bug: 11077365 Change-Id: I0e57fcbcd93916eb04841d2abc9aeabbd40db575
-rw-r--r--src/com/android/launcher3/LauncherBackupAgent.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/launcher3/LauncherBackupAgent.java b/src/com/android/launcher3/LauncherBackupAgent.java
index 4d06f9cf3..f29bb1fad 100644
--- a/src/com/android/launcher3/LauncherBackupAgent.java
+++ b/src/com/android/launcher3/LauncherBackupAgent.java
@@ -61,8 +61,6 @@ import java.util.List;
import java.util.Set;
import java.util.zip.CRC32;
-import static android.graphics.Bitmap.CompressFormat.WEBP;
-
/**
* Persist the launcher home state across calamities.
*/
@@ -81,6 +79,9 @@ public class LauncherBackupAgent extends BackupAgent {
public static final int IMAGE_COMPRESSION_QUALITY = 75;
+ private static final Bitmap.CompressFormat IMAGE_FORMAT =
+ android.graphics.Bitmap.CompressFormat.PNG;
+
private static BackupManager sBackupManager;
private static final String[] FAVORITE_PROJECTION = {
@@ -776,7 +777,7 @@ public class LauncherBackupAgent extends BackupAgent {
Resource res = new Resource();
res.dpi = dpi;
ByteArrayOutputStream os = new ByteArrayOutputStream();
- if (icon.compress(WEBP, IMAGE_COMPRESSION_QUALITY, os)) {
+ if (icon.compress(IMAGE_FORMAT, IMAGE_COMPRESSION_QUALITY, os)) {
res.data = os.toByteArray();
}
return writeCheckedBytes(res);
@@ -803,7 +804,7 @@ public class LauncherBackupAgent extends BackupAgent {
Drawable fullResIcon = iconCache.getFullResIcon(provider.getPackageName(), info.icon);
Bitmap icon = Utilities.createIconBitmap(fullResIcon, this);
ByteArrayOutputStream os = new ByteArrayOutputStream();
- if (icon.compress(WEBP, IMAGE_COMPRESSION_QUALITY, os)) {
+ if (icon.compress(IMAGE_FORMAT, IMAGE_COMPRESSION_QUALITY, os)) {
widget.icon.data = os.toByteArray();
widget.icon.dpi = dpi;
}
@@ -812,7 +813,7 @@ public class LauncherBackupAgent extends BackupAgent {
widget.preview = new Resource();
Bitmap preview = previewLoader.generateWidgetPreview(info, null);
ByteArrayOutputStream os = new ByteArrayOutputStream();
- if (preview.compress(WEBP, IMAGE_COMPRESSION_QUALITY, os)) {
+ if (preview.compress(IMAGE_FORMAT, IMAGE_COMPRESSION_QUALITY, os)) {
widget.preview.data = os.toByteArray();
widget.preview.dpi = dpi;
}