Reduce lock contention on setting write.
Context: go/pm-settings-persistence
0. The main issue is a background thread holding to 2 major and 1
less-major locks for a long time.
1. Refactor Settings.writeStateForUser* not to take PMS lock in advance.
2. Add an option to move PMS-locked processing into PMS handler thread,
executing on a big core with DEFAULT priority.
3. Make XML serialization use its own lock.
4. Move XML serialization + IO to background thread.
5. (separate CL) slightly optimize XML serialization. It's still an AI
to move it to Fast/Binary serializers.
Bug: 220083428
Test: presubmit
Change-Id: I428d46d90c3ceef55a83358f5f3b2cddbce60efd
3 files changed