summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorHelena Josol <helenajosol@google.com>2014-10-06 16:06:46 +0100
committerHelena Josol <helenajosol@google.com>2014-10-06 17:08:10 +0100
commit4fbbb3e3e0e135bc5b304bc63637bbc8b54fb5d8 (patch)
tree4383aa322228344f9ce6318d5d4c0d462730575e /WallpaperPicker
parentebb2a66b79b2761ed29f2f8a3140217c126e448b (diff)
downloadandroid_packages_apps_Trebuchet-4fbbb3e3e0e135bc5b304bc63637bbc8b54fb5d8.tar.gz
android_packages_apps_Trebuchet-4fbbb3e3e0e135bc5b304bc63637bbc8b54fb5d8.tar.bz2
android_packages_apps_Trebuchet-4fbbb3e3e0e135bc5b304bc63637bbc8b54fb5d8.zip
Create a central list of files the Launcher writes to the app directory
Replace hardcoded Launcher filenames with the defined constants. Bug: 12753154 Change-Id: I072f202d9388a703b9e6851bde64ea7fafe4b10a
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java b/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java
index 2bdf8f1cd..9f92bc105 100644
--- a/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java
+++ b/WallpaperPicker/src/com/android/launcher3/SavedWallpaperImages.java
@@ -180,7 +180,6 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter {
static class ImageDb extends SQLiteOpenHelper {
final static int DB_VERSION = 1;
- final static String DB_NAME = "saved_wallpaper_images.db";
final static String TABLE_NAME = "saved_wallpaper_images";
final static String COLUMN_ID = "id";
final static String COLUMN_IMAGE_THUMBNAIL_FILENAME = "image_thumbnail";
@@ -189,7 +188,8 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter {
Context mContext;
public ImageDb(Context context) {
- super(context, context.getDatabasePath(DB_NAME).getPath(), null, DB_VERSION);
+ super(context, context.getDatabasePath(LauncherFiles.WALLPAPER_IMAGES_DB).getPath(),
+ null, DB_VERSION);
// Store the context for later use
mContext = context;
}
@@ -197,8 +197,9 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter {
public static void moveFromCacheDirectoryIfNecessary(Context context) {
// We used to store the saved images in the cache directory, but that meant they'd get
// deleted sometimes-- move them to the data directory
- File oldSavedImagesFile = new File(context.getCacheDir(), ImageDb.DB_NAME);
- File savedImagesFile = context.getDatabasePath(ImageDb.DB_NAME);
+ File oldSavedImagesFile = new File(context.getCacheDir(),
+ LauncherFiles.WALLPAPER_IMAGES_DB);
+ File savedImagesFile = context.getDatabasePath(LauncherFiles.WALLPAPER_IMAGES_DB);
if (oldSavedImagesFile.exists()) {
oldSavedImagesFile.renameTo(savedImagesFile);
}