[SettingsProvider] do not write under mLock

persistSyncLocked() is called when holding the SettingsProvider lock.
It writes to disk synchronously, which can sometimes take long. This
blocks future reads that also tries to acquire the lock and causes SysUI
jankiness. This CL changes the synchronous write to async, just like any
other write operations in SettingsProvider.

BUG: 284452689
Test: atest com.android.providers.settings.SettingsStateTest

Change-Id: I318c4c6f358dbaa227cb53019db93f262ed10443
3 files changed