Replace use of SharedPreference commit() with apply().

Also fix a typo and replace a bunch of redundant
SharedPreference.Editor commits with one at the end.

Change-Id: I75623cb6809a363d05421f80f1560d586ae1ab80
2 files changed