From a8f7b6a9f33fcedd6f1e429606e1241d7ed7e54b 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/Launcher.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher3/Launcher.java') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d9f1985fe..d3be726e6 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -198,7 +198,6 @@ public class Launcher extends Activity static final int SCREEN_COUNT = 5; static final int DEFAULT_SCREEN = 2; - private static final String PREFERENCES = "launcher.preferences"; // To turn on these properties, type // adb shell setprop log.tag.PROPERTY_NAME [VERBOSE | SUPPRESS] static final String FORCE_ENABLE_ROTATION_PROPERTY = "launcher_force_rotate"; @@ -790,7 +789,7 @@ public class Launcher extends Activity private static void readConfiguration(Context context, LocaleConfiguration configuration) { DataInputStream in = null; try { - in = new DataInputStream(context.openFileInput(PREFERENCES)); + in = new DataInputStream(context.openFileInput(LauncherFiles.LAUNCHER_PREFS)); configuration.locale = in.readUTF(); configuration.mcc = in.readInt(); configuration.mnc = in.readInt(); @@ -812,7 +811,8 @@ public class Launcher extends Activity private static void writeConfiguration(Context context, LocaleConfiguration configuration) { DataOutputStream out = null; try { - out = new DataOutputStream(context.openFileOutput(PREFERENCES, MODE_PRIVATE)); + out = new DataOutputStream(context.openFileOutput( + LauncherFiles.LAUNCHER_PREFS, MODE_PRIVATE)); out.writeUTF(configuration.locale); out.writeInt(configuration.mcc); out.writeInt(configuration.mnc); @@ -821,7 +821,7 @@ public class Launcher extends Activity // Ignore } catch (IOException e) { //noinspection ResultOfMethodCallIgnored - context.getFileStreamPath(PREFERENCES).delete(); + context.getFileStreamPath(LauncherFiles.LAUNCHER_PREFS).delete(); } finally { if (out != null) { try { -- cgit v1.2.3