Commit Graph

3 Commits

Author SHA1 Message Date
ykhung
9ac072dafe [Performance] avoid setting the same optimization mode again
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
2021-08-30 09:25:51 +00:00
ykhung
0ab0a3af56 Refactor BatteryOptimizeUtils from enum to @IntDef
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
2021-08-24 12:04:31 +00:00
Wesley.CW Wang
f2321ad5e1 Add utils class for app usage operation
- An util class to control usage state

Bug: 178197718
Test: make SettingsRoboTests
Change-Id: I9c1d37610a2e52d484228ef8e5c7af49e12f82aa
2021-04-19 16:13:00 +08:00