diff options
author | Helena Josol <helenajosol@google.com> | 2014-10-09 17:04:09 +0100 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2015-09-27 15:51:14 -0700 |
commit | 19379be35a571865201691eb9878d79a34eae860 (patch) | |
tree | 3f5b219ac5d1540dd7ddcc7a073411323639a9c7 /src | |
parent | 3637cce5b38f166b6b144bf90cb69b354ab06706 (diff) | |
download | android_packages_apps_Trebuchet-19379be35a571865201691eb9878d79a34eae860.tar.gz android_packages_apps_Trebuchet-19379be35a571865201691eb9878d79a34eae860.tar.bz2 android_packages_apps_Trebuchet-19379be35a571865201691eb9878d79a34eae860.zip |
Add more Launcher files to delete on Clear Launcher Data
Bug: 12753154
Change-Id: I00679bdc6eff70a1398122aaa955c08eabd556b1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherAppState.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherFiles.java | 21 | ||||
-rw-r--r-- | src/com/android/launcher3/Stats.java | 14 |
4 files changed, 28 insertions, 16 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 2af40c44d..4627ddc44 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -787,7 +787,7 @@ public class Launcher extends Activity private static void readConfiguration(Context context, LocaleConfiguration configuration) { DataInputStream in = null; try { - in = new DataInputStream(context.openFileInput(LauncherFiles.LAUNCHER_PREFS)); + in = new DataInputStream(context.openFileInput(LauncherFiles.LAUNCHER_PREFERENCES)); configuration.locale = in.readUTF(); configuration.mcc = in.readInt(); configuration.mnc = in.readInt(); @@ -810,7 +810,7 @@ public class Launcher extends Activity DataOutputStream out = null; try { out = new DataOutputStream(context.openFileOutput( - LauncherFiles.LAUNCHER_PREFS, MODE_PRIVATE)); + LauncherFiles.LAUNCHER_PREFERENCES, MODE_PRIVATE)); out.writeUTF(configuration.locale); out.writeInt(configuration.mcc); out.writeInt(configuration.mnc); @@ -819,7 +819,7 @@ public class Launcher extends Activity // Ignore } catch (IOException e) { //noinspection ResultOfMethodCallIgnored - context.getFileStreamPath(LauncherFiles.LAUNCHER_PREFS).delete(); + context.getFileStreamPath(LauncherFiles.LAUNCHER_PREFERENCES).delete(); } finally { if (out != null) { try { diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index 82e64e183..6e3f80769 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -37,7 +37,6 @@ import java.util.ArrayList; public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks { private static final String TAG = "LauncherAppState"; - private static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs"; private static final boolean DEBUG = false; @@ -187,7 +186,7 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks { } public static String getSharedPreferencesKey() { - return SHARED_PREFERENCES_KEY; + return LauncherFiles.SHARED_PREFERENCES_KEY; } DeviceProfile initDynamicGrid(Context context, int minWidth, int minHeight, diff --git a/src/com/android/launcher3/LauncherFiles.java b/src/com/android/launcher3/LauncherFiles.java index 89600c2df..fa053650f 100644 --- a/src/com/android/launcher3/LauncherFiles.java +++ b/src/com/android/launcher3/LauncherFiles.java @@ -12,16 +12,29 @@ import java.util.List; */ public class LauncherFiles { - public static final String SHARED_PREFS = "com.android.launcher3.prefs.xml"; + private static final String XML = ".xml"; + + public static final String DEFAULT_WALLPAPER_THUMBNAIL = "default_thumb2.jpg"; + public static final String DEFAULT_WALLPAPER_THUMBNAIL_OLD = "default_thumb.jpg"; public static final String LAUNCHER_DB = "launcher.db"; - public static final String LAUNCHER_PREFS = "launcher.preferences"; + public static final String LAUNCHER_PREFERENCES = "launcher.preferences"; + public static final String LAUNCHES_LOG = "launches.log"; + public static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs"; + public static final String STATS_LOG = "stats.log"; + public static final String WALLPAPER_CROP_PREFERENCES_KEY = + WallpaperCropActivity.class.getName(); public static final String WALLPAPER_IMAGES_DB = "saved_wallpaper_images.db"; public static final String WIDGET_PREVIEWS_DB = "widgetpreviews.db"; public static final List<String> ALL_FILES = Collections.unmodifiableList(Arrays.asList( - SHARED_PREFS, + DEFAULT_WALLPAPER_THUMBNAIL, + DEFAULT_WALLPAPER_THUMBNAIL_OLD, LAUNCHER_DB, - LAUNCHER_PREFS, + LAUNCHER_PREFERENCES, + LAUNCHES_LOG, + SHARED_PREFERENCES_KEY + XML, + STATS_LOG, + WALLPAPER_CROP_PREFERENCES_KEY + XML, WALLPAPER_IMAGES_DB, WIDGET_PREVIEWS_DB)); } diff --git a/src/com/android/launcher3/Stats.java b/src/com/android/launcher3/Stats.java index 6ba1c19b9..cffa3055c 100644 --- a/src/com/android/launcher3/Stats.java +++ b/src/com/android/launcher3/Stats.java @@ -39,12 +39,10 @@ public class Stats { public static final String EXTRA_CELLX = "cellX"; public static final String EXTRA_CELLY = "cellY"; - private static final String LOG_FILE_NAME = "launches.log"; private static final int LOG_VERSION = 1; private static final int LOG_TAG_VERSION = 0x1; private static final int LOG_TAG_LAUNCH = 0x1000; - private static final String STATS_FILE_NAME = "stats.log"; private static final int STATS_VERSION = 1; private static final int INITIAL_STATS_SIZE = 100; @@ -65,7 +63,8 @@ public class Stats { if (LOCAL_LAUNCH_LOG) { try { - mLog = new DataOutputStream(mLauncher.openFileOutput(LOG_FILE_NAME, Context.MODE_APPEND)); + mLog = new DataOutputStream(mLauncher.openFileOutput( + LauncherFiles.LAUNCHES_LOG, Context.MODE_APPEND)); mLog.writeInt(LOG_TAG_VERSION); mLog.writeInt(LOG_VERSION); } catch (FileNotFoundException e) { @@ -170,7 +169,8 @@ public class Stats { private void saveStats() { DataOutputStream stats = null; try { - stats = new DataOutputStream(mLauncher.openFileOutput(STATS_FILE_NAME + ".tmp", Context.MODE_PRIVATE)); + stats = new DataOutputStream(mLauncher.openFileOutput( + LauncherFiles.STATS_LOG + ".tmp", Context.MODE_PRIVATE)); stats.writeInt(STATS_VERSION); final int N = mHistogram.size(); stats.writeInt(N); @@ -180,8 +180,8 @@ public class Stats { } stats.close(); stats = null; - mLauncher.getFileStreamPath(STATS_FILE_NAME + ".tmp") - .renameTo(mLauncher.getFileStreamPath(STATS_FILE_NAME)); + mLauncher.getFileStreamPath(LauncherFiles.STATS_LOG + ".tmp") + .renameTo(mLauncher.getFileStreamPath(LauncherFiles.STATS_LOG)); } catch (FileNotFoundException e) { Log.e(TAG, "unable to create stats data: " + e); } catch (IOException e) { @@ -200,7 +200,7 @@ public class Stats { mHistogram = new ArrayList<Integer>(INITIAL_STATS_SIZE); DataInputStream stats = null; try { - stats = new DataInputStream(mLauncher.openFileInput(STATS_FILE_NAME)); + stats = new DataInputStream(mLauncher.openFileInput(LauncherFiles.STATS_LOG)); final int version = stats.readInt(); if (version == STATS_VERSION) { final int N = stats.readInt(); |