| Commit message (Collapse) | Author | Age | Files | Lines |
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Use @EnabledSince instead of @EnabledAfter for CALLBACK_ON_CLEAR_CHANGE.
Test: m
Bug: 172238506
Change-Id: I74d558cbf5c572fad11329269266fab017afde8e
|
| |/
|
|
|
|
|
|
|
|
|
| |
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
|
| |
|
|
|
|
|
|
|
| |
We now have javadoc based docs generated from these comments now. Ensure
the links can be resolved.
Bug: 144927670
Test: See follow-up CLs
Change-Id: I7c3121e062ec82b64a81f3ec00cddb1bf932ffd9
|
| |
|
|
|
|
|
|
| |
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The onSharedPreferenceChanged listener will now also be called on
Editor#clear with a null key.
This change is gated behind a flag using the new app compat framework.
Removed the OnSharedPreferencesClear listener interface.
Bug: 119147584
Bug: 138293946
Test: atest android.content.cts.SharedPreferencesTest
Change-Id: Ieea168eb40afb8f1b5830f1541be20d93d6f94b5
|
| |
|
|
|
|
|
|
|
| |
A new interface has been added that provides a way to receive callbacks
when shared preferences are cleared.
Bug: 119147584
Test: android.content.cts.SharedPreferencesTest
Change-Id: Ie74a6db49711bc5228cf75689872ae188af7979c
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For packages:
android.app.usage
android.app.trust
android.app.timezonedetector
android.app.timezone
android.app.timedetector
android.app.job
android.app.backup
android.app.assist
android.app.admin
android.app
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The code loading shared preferences from disk may throw in other
ways then a missing file, for example during an out-of-memory
situation. Ensure that waiters will be woken up, and propagate
the exception to the getters.
Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I56e47342111f1cb53c5817c0429af4a6787475a9
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 70b600d45683b574104d10198da9bce49aa6be23.
In preparation for a different fix. There are too many loopholes
with updates vs commits.
Bug: 67986472
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I872a81ae1a26e1f77aad2a52daf88e093a686ec6
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit c8d5fc857208b08b984a802277807e9195b2f9a7.
In preparation for different fix.
Bug: 67986472
Bug: 70122540
Bug: 71533447
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I0b9e72d271725e15c20b68de981303c96ac1bd2a
|
| |\
| |
| |
| |
| |
| | |
am: 7e717e09cd
Change-Id: I75da071918e7fc2e547df4e4d75121806c730ca2
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Apps seem to rely on this undocumented behavior so that the
threaded sync adapter doesn't crash an app. That's really
bad on the app side, but we will have to live with it.
Bug: 67986472
Bug: 70122540
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I1ee4dfba4ad29c4f66fa60d3c8f8a99900b3447a
|
| |\|
| |
| |
| |
| |
| | |
am: aa3e9d351e
Change-Id: I2a47400d1e584aef1a16e05840ab964ca5735110
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The asynchronous loading code is not safe wrt/ exceptions. Instead
of adding a tri-state for loading, move the code to use a Future
for the map. This encapsulates the required wait & synchronization,
as well as propagating any exceptions.
Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I6616e8a05e64eb1cfe024cc3239a05847dfe1fab
|
| |\|
| |
| |
| |
| |
| | |
am: 572f46a3ef
Change-Id: I7b922f795283cefabf661e999e5a9897889fa287
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Clean up in preparation for an implementation change. Add missing
annotations. Rename inner lock to be uniquely named. Use the local
map instead of mMap in the commit logic.
Test: m
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: Id3a798732c83a4aa6487225e2375ade4985852e2
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When two processes modify shared preferences we use the timestamp to
figure out if the file was changes underneath. Do this with the highest
precision available (instead of sec) as before.
It would be possible to make the check more reliable by writing a unique
id to the shared pref file, but this would make this check much more
expensive in the common case that nothing changed. Considering that this
has not been a problem and we don't officially give any guarantee for
this sounds like a good middle-ground.
(cherry picked from commit ffe74357aec5330098795000e131e8d581b8b274)
Merged-In: I04c96b6a946618d5599c26410c88d7cd654d31fb
Change-Id: I04c96b6a946618d5599c26410c88d7cd654d31fb
Test: SharedPreferencesTest
Fixes: 62949739
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When two processes modify shared preferences we use the timestamp to
figure out if the file was changes underneath. Do this with the highest
precision available (instead of sec) as before.
It would be possible to make the check more reliable by writing a unique
id to the shared pref file, but this would make this check much more
expensive in the common case that nothing changed. Considering that this
has not been a problem and we don't officially give any guarantee for
this sounds like a good middle-ground.
Change-Id: I04c96b6a946618d5599c26410c88d7cd654d31fb
Test: SharedPreferencesTest
Fixes: 62949739
|
| |/
|
|
|
| |
Test: make
Change-Id: I5ae03b5561b38e23af50764e17ac5ccfccc1b476
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We already only issue a warning if the xml cannot be parsed. So if the
xml could be parsed by the result could not be cast to a map, we should
also only issue a warning.
Also log the corrupted file as this is called on an async thread and it
is not clear what file is affected.
Bug: 29006064
Test: Just logging changes.
Change-Id: I503fd4ee9b905f72668136b4d98c819cd7f9021b
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
Example log:
Time required to fsync
/data/user/0/com.google.android.gms/shared_prefs/gms_sync_prefs_sync:ContactMetadata.xml:
[<1: 0, <2: 0, <4: 0, <8: 0, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0,
<512: 0, <1024: 1, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
Fixes: 30662828
Test: Looked at log
Change-Id: I6d585b107ae14e05ff1c77b0a0017de684226cba
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- The queued work processing thread might be sleeping while the main
thread is waiting for it to do work. Hence process the work in the main
thread.
- Carefully add logging so that slowness can be tracked.
- Fix usage of the wrong lock (sWork instead of sLock).
- Increase the time of the delay between apply and write to make
possible side-effects more visible
Test: SharedPrefencesTest, looked at logging
Bug: 30662828
Change-Id: Ie8a5d531e180dacec29c947ba0b59b170facf782
|
| |
|
|
|
| |
Test: Clean revert
Change-Id: I61d339bb85936e1d50742be1e4c6dab781f3a4e7
|
| |\
| |
| |
| |
| |
| |
| |
| | |
nyc-mr2-dev-plus-aosp
am: b02f8eb241
Change-Id: I1307ea308423c0fd34564d788ab64c023a5be2c5
|
| | |
| |
| |
| |
| |
| |
| | |
This reverts commit 2fc44947dd4f45a23c56985d4c12f01332027a9f.
Bug: 30662828
Change-Id: Ia22343c19e155555dff3b0cb58f7b58df0ce6301
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... so that multiple applies can be combined into a single write.
Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.
Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
skipped writes
Bug: 33385963
Bug: 30662828
Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
(cherry picked from commit 3349644872d9b769f4e2d0ec1b91d368a552ff8d)
|
| | |
| |
| |
| |
| |
| | |
Bug: 33385963
Test: SharedPreferences CTS tests
Change-Id: I39955f8fbcdaa54faa539a3c503e12cb00808136
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If multiple async shared preferences writes are queued, all but the
last one can be ignored as they will be overwritten by the last one
anyway.
For commit() we need to make sure that we have at least persisted the
state of the commit.
Generation counts are 64 bit, hence they never overflow.
Test: Produced a lot of SharedPreferences.Editor.apply and did not see
excessive writes anymore, ran SharedPreferences CTS tests
Bug: 33385963
Change-Id: I3968ed4b71befee6eeb90bea1666a0bb646544f6
|
| | |
| |
| |
| |
| |
| | |
Fixes: 33430093
Test: SharedPreferences CTS tests
Change-Id: Ia2ac48a0273608d5be6a227dc6669cea9d44bc1d
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... so that multiple applies can be combined into a single write.
Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.
Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
skipped writes
Bug: 33385963
Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
|
| | |
| |
| |
| |
| |
| | |
Bug: 33385963
Test: SharedPreferences CTS tests
Change-Id: I39955f8fbcdaa54faa539a3c503e12cb00808136
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If multiple async shared preferences writes are queued, all but the
last one can be ignored as they will be overwritten by the last one
anyway.
For commit() we need to make sure that we have at least persisted the
state of the commit.
Generation counts are 64 bit, hence they never overflow.
Test: Produced a lot of SharedPreferences.Editor.apply and did not see
excessive writes anymore, ran SharedPreferences CTS tests
Bug: 33385963
Change-Id: I3968ed4b71befee6eeb90bea1666a0bb646544f6
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Shared prefrences loads thir content from disk on a separate
thread to improve performance, however it holds the lock
the whole time while reading from disk which as a result blocks
operations that don't rely on reading data from being performed
intil load completes, e.g. reguistering a prefernces change
listener does not depend on having the data loaded.
bug:5254577
Change-Id: I5ad67b285631c34d5aadac7138ba8bfaa728cf94
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Databases and SharedPreferences often involve multiple files under
the hood, so developers wanting to migrate them between different
storage contexts should ask us to make sure all relevant files are
migrated correctly.
This makes a best-effort attempt to recover from battery pulls
during migration, while still trying to alert developers to
conflicting files.
Bug: 26668510, 25860525
Change-Id: I9ffa3e8cb6191dfd4237b9466a081d6d77df3ba0
|
| |
|
|
| |
Change-Id: I26e7a02a18d802902fca6892bed77b4f98ccf3ee
|
| |\
| |
| |
| | |
Change-Id: Id5c5997ad8f801b32e1dbd97413ea42e38c27210
|
| | |
| |
| |
| |
| |
| |
| | |
(This is partial, but should cover everything in AOSP master except
for the zygote.)
Change-Id: I1042c99245765746a744c44e714095cb2c6cb75d
|
| |\|
| |
| |
| |
| |
| |
| | |
preference puts with "null" values."
* commit '909427d093c30d2d4f4ffe5da19f1db6c3e9a3b3':
Fix preference puts with "null" values.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Null values were being written out as <null /> elements in the
XML prefs file (as expected). This allowed the getFoo() functions
to work correctly because they treated null values as missing mappings
but containsKey would fail.
bug: https://code.google.com/p/android/issues/detail?id=64563
Change-Id: I1f466d01db96bf26e208d4fed3a6f257228bea5d
|
| |/
|
|
| |
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, make it quite clear that the set returned by
getStringSet() must not be modfied by the app, period; and
add a similar caution about the map returned via getAll().
Also, fix a bug that could lead to unexpected data being committed
if the set instance passed to putStringSet() was mutated by the
app after that call (including mutations after commit() was
invoked).
Bug 7312641
Change-Id: If9a1be1b0669ac879ff7a7dc67a8805548ea10cc
|
| |
|
|
|
|
|
|
| |
Remove the last user of FileUtils#getFileStatus and move it to
Libcore.os.stat instead. Then we can remove the JNI code that does the
equivalent of a stat.
Change-Id: Ieb566a2a8a17c2dd0150724b4eb3ac1cc41c823d
|
| |
|
|
|
|
| |
...via BufferedInputStream
Change-Id: Ic14eff1e53b6f4a0de5f59bd97cd390eb908e3c6
|
| |
|
|
|
| |
Bug: 3177046
Change-Id: Ibc36a1e196afd39c4f9da513a2bf4ba9e2c72177
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously reads were only cached once a write occurred because
loading didn't set the stat metadata, thus the
sp.hasFileChangedUnexpectedly() check always fired on reading.
Now the initial read populates the stat info, so getSharedPreference()
repeatedly bypasses reading from disk, even wtihout writes.
This was probably a regression from apply() being added in
Gingerbread.
Bug: 3211034
Change-Id: Ifa0bbb27c53a4099544950a4f822fab1fc23a47d
|
|
|
Change-Id: I3a58ec4c9501e906c133e841b5c5ec6bced04a02
|