diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-08-26 12:04:57 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-08-27 09:10:11 -0700 |
commit | 333b8cba996c8ebb8ca55ebfc5cc536bdd64af94 (patch) | |
tree | 1a38c262454903b6b976e4e27ce0f84160015116 /core/java/android/content/SharedPreferences.java | |
parent | cc033bd367a445d5e3f8de919cd155505b25274c (diff) | |
download | frameworks_base-333b8cba996c8ebb8ca55ebfc5cc536bdd64af94.zip frameworks_base-333b8cba996c8ebb8ca55ebfc5cc536bdd64af94.tar.gz frameworks_base-333b8cba996c8ebb8ca55ebfc5cc536bdd64af94.tar.bz2 |
SharedPreferences$Editor.startCommit()
Adds a fire-and-forget save method (startCommit) to the
SharedPreferences.Editor, which is the way most people use it anyway.
This commit adds the implementation. The previous commit added the
interface and docs:
previous change: Idf9934b445da1fb72b79f0192218b47c0a7f5a34
git commit: edf32d01316bd3432c023f17747461b08ae36375
In addition, this change:
-- adds a generic "runPendingWorkFinishers" mechanism to
ActivityThread to wait on async operations that are still
in flight and use it for this.
-- ties runPendingWorkFinishers into Activity.onPause,
BroadcastReceiver, and Service.
-- makes sSharedPreferences keyed on name, not File, to avoid
unnnecessary allocations
-- documents and guarantees what thread
OnSharedPreferenceChangeListener callbacks run on
-- makes a few things in frameworks/base use startCommit(), notably
Preference.java (which was ignoring the return value anyway)
Change-Id: I1c8db60ad45643226fe6d246d3e513eeb7bd0ebd
Diffstat (limited to 'core/java/android/content/SharedPreferences.java')
-rw-r--r-- | core/java/android/content/SharedPreferences.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/java/android/content/SharedPreferences.java b/core/java/android/content/SharedPreferences.java index f1b1490..b3db2ac 100644 --- a/core/java/android/content/SharedPreferences.java +++ b/core/java/android/content/SharedPreferences.java @@ -40,7 +40,9 @@ public interface SharedPreferences { /** * Called when a shared preference is changed, added, or removed. This * may be called even if a preference is set to its existing value. - * + * + * <p>This callback will be run on your main thread. + * * @param sharedPreferences The {@link SharedPreferences} that received * the change. * @param key The key of the preference that was changed, added, or @@ -187,9 +189,6 @@ public interface SharedPreferences { * <p>If you call this from an {@link android.app.Activity}, * the base class will wait for any async commits to finish in * its {@link android.app.Activity#onPause}.</p> - * - * @return Returns true if the new values were successfully written - * to persistent storage. */ void startCommit(); } |