Add a checking condition to avoid setting the same optimization mode again to improve the performance, since setting the optimization mode is a heavy operation when binding with system service.
Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I4065e3c56201c1c9285d9cebedf670bc0c42c614
Based on the Android API Council guideline, we should avoid using the
Enum structure to define the constant definition.
go/android-api-guidelines#avoid-enum
Bug: 197595292
Test: make SettingsRoboTests
Change-Id: I4b22f0abde7f4ce2c3a0b076db786e619783d93e
Merged-In: I4b22f0abde7f4ce2c3a0b076db786e619783d93e