// Path: src/com/android/launcher3/wallpaperpicker/tileinfo/FileWallpaperInfo.java
// public class FileWallpaperInfo extends DrawableThumbWallpaperInfo {
//     private static final String TAG = "FileWallpaperInfo";
// 
//     private final File mFile;
// 
//     public FileWallpaperInfo(File target, Drawable thumb) {
//         super(thumb);
//         mFile = target;
//     }
// 
//     @Override
//     public void onClick(final WallpaperPickerActivity a) {
//         a.setWallpaperButtonEnabled(false);
//         final BitmapRegionTileSource.FilePathBitmapSource bitmapSource =
//                 new BitmapRegionTileSource.FilePathBitmapSource(mFile, a);
//         a.setCropViewTileSource(bitmapSource, false, true, null, new Runnable() {
// 
//             @Override
//             public void run() {
//                 if (bitmapSource.getLoadingState() == BitmapRegionTileSource.BitmapSource.State.LOADED) {
//                     a.setWallpaperButtonEnabled(true);
//                 }
//             }
//         });
//     }
// 
//     @Override
//     public void onSave(final WallpaperPickerActivity a) {
//         final InputStreamProvider isp = InputStreamProvider.fromUri(a, Uri.fromFile(mFile));
//         AsyncTask<Integer, Void, Point> cropTask = new AsyncTask<Integer, Void, Point>() {
// 
//             @Override
//             protected Point doInBackground(Integer... params) {
//                 InputStream is = null;
//                 try {
//                     Point bounds = isp.getImageBounds();
//                     if (bounds == null) {
//                         Log.w(TAG, "Error loading image bounds");
//                         return null;
//                     }
//                     is = isp.newStreamNotNull();
//                     WallpaperManagerCompat.getInstance(a).setStream(is, null, true, params[0]);
//                     return bounds;
//                 } catch (IOException e) {
//                     Log.w(TAG, "cannot write stream to wallpaper", e);
//                 } finally {
//                     Utils.closeSilently(is);
//                 }
//                 return null;
//             }
// 
//             @Override
//             protected void onPostExecute(Point bounds) {
//                 if (bounds != null) {
//                     a.setBoundsAndFinish(a.getWallpaperParallaxOffset() == 0f);
//                 } else {
//                     Toast.makeText(a, R.string.wallpaper_set_fail, Toast.LENGTH_SHORT).show();
//                 }
//             }
//         };
// 
//         DialogUtils.executeCropTaskAfterPrompt(a, cropTask, a.getOnDialogCancelListener());
//     }
// 
//     @Override
//     public boolean isSelectable() {
//         return true;
//     }
// 
//     @Override
//     public boolean isNamelessWallpaper() {
//         return true;
//     }
// }


import java.util.ArrayList;
import java.util.List;
import com.android.launcher3.wallpaperpicker.tileinfo.FileWallpaperInfo;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/*
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.launcher3.wallpaperpicker;




public class SavedWallpaperImages {

    private static String TAG = "SavedWallpaperImages";

// Path: src/com/android/launcher3/wallpaperpicker/tileinfo/FileWallpaperInfo.java
// public class FileWallpaperInfo extends DrawableThumbWallpaperInfo {
//     private static final String TAG = "FileWallpaperInfo";
// 
//     private final File mFile;
// 
//     public FileWallpaperInfo(File target, Drawable thumb) {
//         super(thumb);
//         mFile = target;
//     }
// 
//     @Override
//     public void onClick(final WallpaperPickerActivity a) {
//         a.setWallpaperButtonEnabled(false);
//         final BitmapRegionTileSource.FilePathBitmapSource bitmapSource =
//                 new BitmapRegionTileSource.FilePathBitmapSource(mFile, a);
//         a.setCropViewTileSource(bitmapSource, false, true, null, new Runnable() {
// 
//             @Override
//             public void run() {
//                 if (bitmapSource.getLoadingState() == BitmapRegionTileSource.BitmapSource.State.LOADED) {
//                     a.setWallpaperButtonEnabled(true);
//                 }
//             }
//         });
//     }
// 
//     @Override
//     public void onSave(final WallpaperPickerActivity a) {
//         final InputStreamProvider isp = InputStreamProvider.fromUri(a, Uri.fromFile(mFile));
//         AsyncTask<Integer, Void, Point> cropTask = new AsyncTask<Integer, Void, Point>() {
// 
//             @Override
//             protected Point doInBackground(Integer... params) {
//                 InputStream is = null;
//                 try {
//                     Point bounds = isp.getImageBounds();
//                     if (bounds == null) {
//                         Log.w(TAG, "Error loading image bounds");
//                         return null;
//                     }
//                     is = isp.newStreamNotNull();
//                     WallpaperManagerCompat.getInstance(a).setStream(is, null, true, params[0]);
//                     return bounds;
//                 } catch (IOException e) {
//                     Log.w(TAG, "cannot write stream to wallpaper", e);
//                 } finally {
//                     Utils.closeSilently(is);
//                 }
//                 return null;
//             }
// 
//             @Override
//             protected void onPostExecute(Point bounds) {
//                 if (bounds != null) {
//                     a.setBoundsAndFinish(a.getWallpaperParallaxOffset() == 0f);
//                 } else {
//                     Toast.makeText(a, R.string.wallpaper_set_fail, Toast.LENGTH_SHORT).show();
//                 }
//             }
//         };
// 
//         DialogUtils.executeCropTaskAfterPrompt(a, cropTask, a.getOnDialogCancelListener());
//     }
// 
//     @Override
//     public boolean isSelectable() {
//         return true;
//     }
// 
//     @Override
//     public boolean isNamelessWallpaper() {
//         return true;
//     }
// }


// Path: src/com/android/launcher3/wallpaperpicker/SavedWallpaperImages.java
import java.util.ArrayList;
import java.util.List;
import com.android.launcher3.wallpaperpicker.tileinfo.FileWallpaperInfo;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/*
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.launcher3.wallpaperpicker;




public class SavedWallpaperImages {

    private static String TAG = "SavedWallpaperImages";

    public static class SavedWallpaperInfo extends FileWallpaperInfo {