Commit Graph

6 Commits

Author SHA1 Message Date
mxyyiyi
ad23b53942 Update battery usage data clear mechanism while time change.
- Accept time updated in the last job schedule range:
  [ max (last-full-charge / last-even-hours) , next-even-hours ]

Bug: 308714066
Fix: 308714066
Test: manual
Change-Id: Id92fffddb7666d63fce66fee696a27d957c8b537
2023-11-03 15:25:17 +08:00
ykhung
ef66549e64 Add a mechanism to log battery usage periodic job events
Example history log:
      	Jul 07, 2023, 15:28:51 SCHEDULE_JOB triggerTime=Jul 07, 2023, 16:00:00
      	Jul 07, 2023, 15:32:16 FETCH_USAGE_DATA
      	Jul 07, 2023, 15:32:17 INSERT_USAGE_DATA size=37
      	Jul 07, 2023, 15:43:45 FETCH_USAGE_DATA
      	Jul 07, 2023, 15:43:48 INSERT_USAGE_DATA size=47
      	Jul 07, 2023, 15:43:49 SCHEDULE_JOB triggerTime=Jul 07, 2023, 16:00:00

Bug: 284893240
Test: make test RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge
Change-Id: I45a1ce0ce9b70f095702727e53d7b7ce8824abdb
2023-07-07 17:47:19 +08:00
ykhung
0cd24adec5 Add allowlist mechanism for battery optimization mode
Add a mechanism to add package name into the allowlist to avoid users
change the battery optimization modes for specific apps in the list

https://screenshot.googleplex.com/8hrHCcTh5bNYXqp

Bug: 281566984
Test: make test RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Change-Id: I8efa6a55646d761f5bee3667a59b38ab68c74bc1
2023-05-15 14:28:49 +08:00
ykhung
8f56114489 Record app optimization mode backup into BatteryHistoricalLog
App optimization mode format:
https://screenshot.googleplex.com/di9DDzBfYf7ihfV

App optimization mode backup format:
https://screenshot.googleplex.com/GkVW5HrgGvmv5yh

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I60a9a76a8ffc89d625ee3f77c138a19181c81c38
2023-05-11 10:48:47 +08:00
Wesley Wang
1f78ebd8aa Refine optimize page log pattern
- Add timestamp and prefix string
 - Chagne Action.MANUAL to LEAVE for better readability
 screenshot: https://screenshot.googleplex.com/ALTvMaPWVEq8y7c.png

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I69d1beceb98444d823f6ffc3a015cf61a7d7a66d
2023-05-10 10:11:28 +00:00
Wesley Wang
d90026d184 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
2022-11-04 18:09:11 +08:00