diff options
author | Christopher Tate <ctate@google.com> | 2015-05-08 18:14:01 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2015-05-11 19:39:26 -0700 |
commit | d5748b8facbc94d9c3b43f79bd49a1bbe8a0b6a0 (patch) | |
tree | c58619e76af3ac9a14d27db2a1135ddb60288675 /core/java/android/content | |
parent | ea4eb326cfc4a8221be5fdab9639d468c632aee2 (diff) | |
download | frameworks_base-d5748b8facbc94d9c3b43f79bd49a1bbe8a0b6a0.zip frameworks_base-d5748b8facbc94d9c3b43f79bd49a1bbe8a0b6a0.tar.gz frameworks_base-d5748b8facbc94d9c3b43f79bd49a1bbe8a0b6a0.tar.bz2 |
Deprecate Context.MODE_MULTI_PROCESS
It has never worked the way people expect.
Change-Id: I0633aacc5ed171495d9c3b51201b7ba86b666dc5
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/Context.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 8687c6b..17f946b 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -134,7 +134,15 @@ public abstract class Context { * explicitly set if desired. * * @see #getSharedPreferences + * + * @deprecated MODE_MULTI_PROCESS does not work reliably in + * some versions of Android, and furthermore does not provide any + * mechanism for reconciling concurrent modifications across + * processes. Applications should not attempt to use it. Instead, + * they should use an explicit cross-process data management + * approach such as {@link android.content.ContentProvider ContentProvider}. */ + @Deprecated public static final int MODE_MULTI_PROCESS = 0x0004; /** @@ -604,11 +612,7 @@ public abstract class Context { * editor (SharedPreferences.edit()) and then commit changes (Editor.commit()). * @param mode Operating mode. Use 0 or {@link #MODE_PRIVATE} for the * default operation, {@link #MODE_WORLD_READABLE} - * and {@link #MODE_WORLD_WRITEABLE} to control permissions. The bit - * {@link #MODE_MULTI_PROCESS} can also be used if multiple processes - * are mutating the same SharedPreferences file. {@link #MODE_MULTI_PROCESS} - * is always on in apps targeting Gingerbread (Android 2.3) and below, and - * off by default in later versions. + * and {@link #MODE_WORLD_WRITEABLE} to control permissions. * * @return The single {@link SharedPreferences} instance that can be used * to retrieve and modify the preference values. @@ -616,7 +620,6 @@ public abstract class Context { * @see #MODE_PRIVATE * @see #MODE_WORLD_READABLE * @see #MODE_WORLD_WRITEABLE - * @see #MODE_MULTI_PROCESS */ public abstract SharedPreferences getSharedPreferences(String name, int mode); |