Change SharedPreferences.Editor.commit() to apply()

Calling SharedPreferences.Editor.commit() from
the main thread results in a synchronous write
to the file system, giving a risk for ANR.

Replace it with asyncronous apply(), which is
safe since the result of commit() was never checked
in the first place.

Bug: 28689077
Test: run with StrictMode on
Change-Id: I63342775f78ba552db8a6a03d8172b43f82be2a9
1 file changed