Commit Graph

10 Commits

Author SHA1 Message Date
Sorin Basca
a962b4b712 NEW Use Mockito 4.6.1 API
Addressing skipping merge issue

Bug: 236636175
Test: atest SettingsRoboTests
Change-Id: Ie7caae0ea9aa212f1ee06d6fe89fa0776979e4e6
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2023-01-12 01:35:44 +00:00
Karen Lu
869fd2f33e Revert "Use Mockito 4.6.1 API"
Revert submission 20749672-cherrypick-robo-mockito-4.6.1-4rg619yrrf

Reason for revert: Breaking the build on tm-qpr-dev. Bug tracked here: b/264473028

Reverted changes: /q/submissionid:20749672-cherrypick-robo-mockito-4.6.1-4rg619yrrf

Change-Id: Ie9d9d944093752f44eff67627e4a35f4df47e6de
2023-01-05 05:15:10 +00:00
Sorin Basca
93c143ed0a Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-12-19 22:24:45 +00:00
Kuan Wang
4028e6123c Reset Optimization Mode of apps when users reset app settings.
Fix the issue that Optimization Mode is not reset when users click the
"Reset apps" button in the setting.

Bug: 222037028
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge" + emulator
Change-Id: I22fb8aa19e284e11882b2920b77b544dee4cc33c
2022-05-16 05:01:20 +00:00
Wesley.CW Wang
151b88f76f Optimize battery optimize page control flow
- Post the setup logic into background and setup once only when leaving
 this page, this can improve the performance since we won't setup
 every time when switching preference

Bug: 195306545
Bug: 199892006
Test: make SettingsRoboTests
Change-Id: I1c3ee4673cf5cdba0abe39f208dfb1412082c579
2021-11-01 14:52:42 +08:00
Wesley.CW Wang
d11dec2f82 Revert "Add PowerSaveWhitelistExceptIdle as Optimizted modes condition"
- Reverts commit e7cca4cd81
 - Add try-catch to handle unexpected operate

Reason for revert: Previous fix will cause a side effect which makes app stuck at Optimize mode after switching state from Unrestricted to Optimize, add a try catch to handle previous issue first

BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy naming, not edit by this code change

Bug: 199892006
Test: make SettingsRoboTests
Change-Id: I3b1850ab66bbf4cd605f14152a244a8ed7edd578
Merged-In: I3b1850ab66bbf4cd605f14152a244a8ed7edd578
2021-10-18 09:03:06 +00:00
Wesley.CW Wang
e7cca4cd81 Add PowerSaveWhitelistExceptIdle as Optimizted modes condition
- Check PowerSaveWhitelistExceptIdle list before update each apps
 optimizaton mode to avoid duplicate remove action
 - Make those apps which under PowerSaveWhitelistExceptIdle list keep at
 optimized mode only

BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy naming, not edit by this code change


Bug: 199892006
Test: make SettingsRoboTests
Change-Id: I3cd10cf51b5132fc12a83e9554801ec4e8578cd1
Merged-In: I3cd10cf51b5132fc12a83e9554801ec4e8578cd1
2021-09-22 02:14:05 +00:00
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