summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-06-10 17:07:15 -0700
committerJoe Onorato <joeo@android.com>2009-06-11 11:29:57 -0700
commit23ecae3bbb60c5af940f3a22170d75eb6ac05b69 (patch)
tree1138102ba856743cffd931121409a71c2bae37c3 /core/java/android/content
parent0b77453076a22569f24318d194b378b68f11a63e (diff)
downloadframeworks_base-23ecae3bbb60c5af940f3a22170d75eb6ac05b69.zip
frameworks_base-23ecae3bbb60c5af940f3a22170d75eb6ac05b69.tar.gz
frameworks_base-23ecae3bbb60c5af940f3a22170d75eb6ac05b69.tar.bz2
Fix SharedPrefsBackupHelper so it doesn't hard code the paths to the files.
This took quite a bit of refactoring.
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/Context.java10
-rw-r--r--core/java/android/content/ContextWrapper.java5
2 files changed, 14 insertions, 1 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index ec847a4..925249e 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -254,12 +254,20 @@ public abstract class Context {
* <p>Note: this is not generally useful for applications, since they should
* not be directly accessing the file system.
*
- *
* @return String Path to the code and assets.
*/
public abstract String getPackageCodePath();
/**
+ * {@hide}
+ * Return the full path to the shared prefs file for the given prefs group name.
+ *
+ * <p>Note: this is not generally useful for applications, since they should
+ * not be directly accessing the file system.
+ */
+ public abstract File getSharedPrefsFile(String name);
+
+ /**
* Retrieve and hold the contents of the preferences file 'name', returning
* a SharedPreferences through which you can retrieve and modify its
* values. Only one instance of the SharedPreferences object is returned
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index 36e1c34..262204e 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -130,6 +130,11 @@ public class ContextWrapper extends Context {
}
@Override
+ public File getSharedPrefsFile(String name) {
+ return mBase.getSharedPrefsFile(name);
+ }
+
+ @Override
public SharedPreferences getSharedPreferences(String name, int mode) {
return mBase.getSharedPreferences(name, mode);
}