From 4fbbb3e3e0e135bc5b304bc63637bbc8b54fb5d8 Mon Sep 17 00:00:00 2001 From: Helena Josol Date: Mon, 6 Oct 2014 16:06:46 +0100 Subject: 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 --- .../src/com/android/launcher3/SavedWallpaperImages.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'WallpaperPicker') 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); } -- cgit v1.2.3