Add BatteryHistoricalLogUtil class

- Impl optimize mode log mechanism to record optimize setup flow
 - Log optimize action with MANUAL, APPLY, RESET and RESTORE
 - Use proto file to serialize logs
 sample result: https://screenshot.googleplex.com/5KPrHVGb4pMvS7V.png

Bug: 241735485
Test: make SettingsRoboTests
Change-Id: I879663de4cf45d0cfb9cd7eee957eeb65addfbe1
This commit is contained in:
Wesley Wang
2022-09-28 18:12:35 +08:00
parent bd25f4a303
commit d90026d184
11 changed files with 309 additions and 21 deletions

View File

@@ -184,6 +184,7 @@ public class AdvancedPowerUsageDetailTest {
mFragment.mBatteryUtils = new BatteryUtils(RuntimeEnvironment.application);
mFragment.mBatteryOptimizeUtils = mBatteryOptimizeUtils;
mFragment.mBackupManager = mBackupManager;
mFragment.mLogStringBuilder = new StringBuilder();
mAppEntry.info = mock(ApplicationInfo.class);
mTestActivity = spy(new SettingsActivity());