Clean up code.

1. Create a method for duplicate code.
2. Address style/lint issues.
3. Properly parse settings constant string. The original iteration
   wouldn't reset values to their default if the constant string didn't
   have a value set.

Bug: 158300259
Test: manual
Change-Id: I994b872ba16f12c8e06ce85aedc526b84e5fa31b
1 file changed