diff options
author | Michael Jurka <mikejurka@google.com> | 2013-09-26 16:59:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-26 16:59:58 +0000 |
commit | 1b495f5298d4648adab0b24dca7a3bc5267bf710 (patch) | |
tree | edd584557c5c2066c1164e90f5471b7e1be07d2d /src/com/android/launcher3/SavedWallpaperImages.java | |
parent | a2f665f4f7dc60aa0ea97e20027a79e796241356 (diff) | |
parent | db84e82a0a098c821b7a4f419293770277a24a34 (diff) | |
download | android_packages_apps_Trebuchet-1b495f5298d4648adab0b24dca7a3bc5267bf710.tar.gz android_packages_apps_Trebuchet-1b495f5298d4648adab0b24dca7a3bc5267bf710.tar.bz2 android_packages_apps_Trebuchet-1b495f5298d4648adab0b24dca7a3bc5267bf710.zip |
Merge "Add default wallpaper to picker" into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com/android/launcher3/SavedWallpaperImages.java')
-rw-r--r-- | src/com/android/launcher3/SavedWallpaperImages.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/launcher3/SavedWallpaperImages.java b/src/com/android/launcher3/SavedWallpaperImages.java index 7cd82f075..531672a04 100644 --- a/src/com/android/launcher3/SavedWallpaperImages.java +++ b/src/com/android/launcher3/SavedWallpaperImages.java @@ -36,7 +36,6 @@ import android.widget.ListAdapter; import com.android.photos.BitmapRegionTileSource; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -104,6 +103,7 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter { while (result.moveToNext()) { String filename = result.getString(1); File file = new File(mContext.getFilesDir(), filename); + Bitmap thumb = BitmapFactory.decodeFile(file.getAbsolutePath()); if (thumb != null) { mImages.add(new SavedWallpaperTile(result.getInt(0), new BitmapDrawable(thumb))); @@ -185,12 +185,11 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter { imageFileStream.write(imageBytes); imageFileStream.close(); - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - thumbnail.compress(Bitmap.CompressFormat.JPEG, 95, stream); File thumbFile = File.createTempFile("wallpaperthumb", "", mContext.getFilesDir()); FileOutputStream thumbFileStream = mContext.openFileOutput(thumbFile.getName(), Context.MODE_PRIVATE); - thumbFileStream.write(stream.toByteArray()); + thumbnail.compress(Bitmap.CompressFormat.JPEG, 95, thumbFileStream); + thumbFileStream.close(); SQLiteDatabase db = mDb.getWritableDatabase(); ContentValues values = new ContentValues(); |