Commit Graph

2090 Commits

Author SHA1 Message Date
TreeHugger Robot
8c38c77e1b Merge "Post UI update later a while to avoid screen sluggish as possible" into sc-v2-dev am: 64dbb05a69 am: f15fa03d21
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15982192

Change-Id: Idf66dbf4f0f83d5bed598387ba9537bd8015a723
2021-10-06 02:10:20 +00:00
ykhung
33612098b3 Post UI update later a while to avoid screen sluggish as possible
When users turned on/off the saver mode, the system is busy in update
configurations and the dark/light theme, we should avoid updating the UI
in the same time to makes users feel the animation is not smooth

Bug: 201752975
Test: make -j64 RunSettingsRoboTests
Change-Id: I4c28af267616f796438a505e84ce376321c74981
2021-10-06 08:43:57 +08:00
Michael Wachenschwanz
dc150492e1 Update to new method of getting display power profile constants
Bug: 200226329
Test: builds and flashes
Change-Id: I4abcb609a383224bba1550cfd3e50bb68f58ba72
2021-10-05 11:32:13 -07:00
Wesley.CW Wang
4137253658 Update adaptive preference summary
Bug: 195627250
Test: make RunSettingsRoboTests
Change-Id: I50ed736bbba7ac8d3d6fcf026e9e17e2116f86a7
2021-10-05 17:52:43 +08:00
TreeHugger Robot
06d312f0af Merge "Punt battery status action when entering Settings main page" into sc-v2-dev am: 99554d3c34 am: d9195b80af
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15938356

Change-Id: I3b030dd9ac65b93500814b62cae4ef48ceb3bc1b
2021-10-01 08:58:55 +00:00
TreeHugger Robot
99554d3c34 Merge "Punt battery status action when entering Settings main page" into sc-v2-dev 2021-10-01 08:34:35 +00:00
Wesley.CW Wang
0cd29a70a4 Punt battery status action when entering Settings main page
- Checking battery sharing states at the beging may have some performance issue, post battery status update to background thread to avoid ANR

Bug: 193600924
Test: make SettingsRoboTests
Change-Id: I3b73e6bd4f952bc832783b9b3b5d45db560d088c
2021-10-01 15:15:25 +08:00
ykhung
454698d97e Invoke close() method for BatteryUsageStats to close cursor window
invoke close() method for BatteryUsageStats to close cursor window,
since BatteryUsageStats will implement "Closeable" interface in T.
(from Dimitri's request)

Bug: 201229421
Test: make SettingsRoboTests
Change-Id: Ibfca404d00cce51405cffddb636f685869ac130b
2021-09-29 00:44:11 +08:00
ykhung
96a8e63ebd [Robustness] protect get battery stats from DeadSystemException am: e893a890ca am: f63b2e08da
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15926630

Change-Id: I3730258d026f39fe0e31e080128d812231ca3e00
2021-09-28 11:48:53 +00:00
ykhung
e893a890ca [Robustness] protect get battery stats from DeadSystemException
Refine the original workaround patch in the ag/15527095 from NPE to
return default BatteryUsageStats instance as we merged in the
ag/15919139 (align the same solution).

Bug: 195306545
Test: make SettingsRoboTests
Change-Id: Ic03e8296d16ecb8629155f75727e9cde48c303eb
2021-09-28 10:00:50 +00:00
YUKAI HUNG
a006e4c8fc Merge "[Security] resolve overlay attack on RequestIgnoreBatteryOptimizations" into sc-v2-dev am: d24f289548 am: e401e37369
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15898228

Change-Id: I750731ab9eb4bc063b33b2ca4c80999f5544b64f
2021-09-24 02:56:15 +00:00
YUKAI HUNG
e191079948 Merge "[Security] resolve CRLF attack on RequestIgnoreBatteryOptimizations" into sc-v2-dev am: 93f6df76be am: 3691ddaea2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15898227

Change-Id: I67cc5a21ef4797cd823b000b1c34be6d89bb7a05
2021-09-24 02:38:47 +00:00
YUKAI HUNG
d24f289548 Merge "[Security] resolve overlay attack on RequestIgnoreBatteryOptimizations" into sc-v2-dev 2021-09-24 02:28:41 +00:00
ykhung
a8a2075fd0 [Security] resolve overlay attack on RequestIgnoreBatteryOptimizations
we should put the addSystemFlags() after onCreate() method rather than the original onStart() method (refer the proposed solution in b/199167909)

Bug: 199167909
Test: make SettingsRoboTests
Change-Id: Ic7361443bfa2e1a6d8d962708c794fa0122a691c
2021-09-24 02:27:40 +00:00
ykhung
aa9091916d [Security] resolve CRLF attack on RequestIgnoreBatteryOptimizations
1. refer the proposed solution in the b/198783395
2. similar concept is applied in the https://source.corp.google.com/sc-dev/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/permission/model/legacy/PermissionGroups.java;l=118

Bug: 198783395
Test: make SettingsRoboTests
Change-Id: I838825e31b98e62d2683995e59dbf4388f5684fc
2021-09-23 15:54:53 +00:00
YUKAI HUNG
ac19d0e300 Merge "[B&R] avoid to backup & restore app which is in the PowerSaveWhitelistExceptIdle" into sc-v2-dev am: b62c1e8142 am: f488cf5416
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15892826

Change-Id: I69fa32b26f7674366be9fa4b0807d9b0fe2c54a4
2021-09-23 11:47:14 +00:00
ykhung
9de5fe158d [B&R] avoid to backup & restore app which is in the PowerSaveWhitelistExceptIdle
BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy method name

Test command for backup manager:
adb shell bmgr backupnow com.android.settings
adb shell dumpsys backup | grep Current
adb shell bmgr restore 3e9867a7660315b8 com.android.settings

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I78f34870af3146698e6d1b9fbc5ec4385a8d5384
2021-09-23 17:29:22 +08: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
Wesley.CW Wang
3f7839cad0 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
2021-09-17 18:38:01 +00:00
ykhung
dfd2bf044f Fix failed tests since presubmit is ignored in ag/15802168 am: 27efa546cf am: a168e2e0fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15809054

Change-Id: I8396a058b78d2c37ebf223e26884860061a08b84
2021-09-11 18:25:11 +00:00
ykhung
27efa546cf Fix failed tests since presubmit is ignored in ag/15802168
Bug: 198553245
Test: make SettingsRoboTests
Change-Id: I91e715a6bfb64419b457812423996365a9464a93
2021-09-12 00:36:43 +08:00
ykhung
27d9bdfb82 Fix the icon flash issue cause from the shared drawable icon am: a3b89868f4 am: e44128f021
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15802168

Change-Id: If1a9387932316ff3b4addea1075d8d69853d38dc
2021-09-11 00:24:09 +00:00
ykhung
a3b89868f4 Fix the icon flash issue cause from the shared drawable icon
different time slot may have the same application entry, we should not make them share the same drawable instance to impact the states, we will use newDrawable() method to create a new one for each application entry

Bug: 198553245
Test: make SettingsRoboTests
Change-Id: I4a321133ba171817fca1ab7ad47b9af8f7450675
2021-09-10 16:50:43 +00:00
ykhung
f27d0c2935 Move allowed list definition in the battery usage to feature provider am: b62cdecc67 am: bb535f4bce
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15785737

Change-Id: I4a19dcc41b14af235c3e1d94675d14fc8f05e3a0
2021-09-10 05:14:37 +00:00
ykhung
b62cdecc67 Move allowed list definition in the battery usage to feature provider
Bug: 199367609
Test: make SettingsRoboTests
Change-Id: I321426e6ff1b9586ee493792f1d39aed35ecc34d
Signed-off-by: ykhung <ykhung@google.com>
2021-09-10 01:29:32 +08:00
TreeHugger Robot
88cd5025e1 Merge "Enhance battery settings limit charge tip" into sc-qpr1-dev am: daaf1728b4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15747143

Change-Id: If2c47f007a67865ad9aaf8040eddc638f46f7964
2021-09-09 15:40:14 +00:00
Wesley.CW Wang
083ace54d5 Enhance battery settings limit charge tip
- Add dialog for limit charge tips
 - Add action button to make limit charge tips can bypass charge limited
 - Fix layout typo
 Screenshot: https://screenshot.googleplex.com/5ngtD2sJAKSQZD3.png

Bug: 196315151
Bug: 197769934
Test: make SettingsRoboTests
Change-Id: I0901c56ae93691c984376852da78cde9078caaf0
Merged-In: I0901c56ae93691c984376852da78cde9078caaf0
2021-09-09 22:13:33 +08:00
Wesley.CW Wang
0849672890 Enhance battery settings limit charge tip
- Add dialog for limit charge tips
 - Add action button to make limit charge tips can bypass charge limited
 - Fix layout typo
 Screenshot: https://screenshot.googleplex.com/5ngtD2sJAKSQZD3.png

Bug: 196315151
Bug: 197769934
Test: make SettingsRoboTests
Change-Id: I0901c56ae93691c984376852da78cde9078caaf0
2021-09-08 04:31:59 +00:00
YUKAI HUNG
0a11568b82 Merge "Hide Camera background running time in the battery usage screen" into sc-dev am: 3f1d329878
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15723822

Change-Id: Ie57e3be9bda2316a8ee6a59fba76043ed6e61c54
2021-09-03 02:50:11 +00:00
TreeHugger Robot
f8b6a8297c Merge "Move legacy hide applications in usage screen list to SettingsGoogle" into sc-v2-dev am: 11d6ba6f57 am: 0d4e7a27e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15737567

Change-Id: I0a749bf60f06c8c9aa06ad8bc2a3ae222229d4e3
2021-09-02 09:26:12 +00:00
ykhung
0a03758738 Move legacy hide applications in usage screen list to SettingsGoogle
Bug: 195306545
Test: make SettingsRoboTests
Change-Id: Iccb3530c40bc32c20d74d65aa3f26eb2d6719106
2021-09-02 11:57:54 +08:00
Dmitri Plotnikov
99ec71728f Merge "Remove uses of deprecated class BatterySipper also, remove the obsolete class FakeUid" 2021-08-31 22:36:55 +00:00
ykhung
4e3f692164 Hide Camera background running time in the battery usage screen
hide camera background running time in the battery usage screen to avoid
users confuse about it, since it will standby in the backgound to sspeed
up launching time, not always running in the background

Bug: 196744910
Test: make SettingsRoboTests
Change-Id: Ia391d661bca44435fc5a68b1c86e5ca32dd0fcfe
Merged-In: Ia391d661bca44435fc5a68b1c86e5ca32dd0fcfe
2021-08-31 13:58:13 +00:00
ykhung
8667ba61b4 Hide Camera background running time in the battery usage screen am: 2401ec4235 am: 24e8c1f902
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15715976

Change-Id: I2e38aa777eb57b48991cc76f4b689e723710cc50
2021-08-31 07:28:35 +00:00
ykhung
2401ec4235 Hide Camera background running time in the battery usage screen
hide camera background running time in the battery usage screen to avoid
users confuse about it, since it will standby in the backgound to sspeed
up launching time, not always running in the background

Bug: 196744910
Test: make SettingsRoboTests
Change-Id: Ia391d661bca44435fc5a68b1c86e5ca32dd0fcfe
2021-08-31 07:01:01 +00:00
TreeHugger Robot
0166f321c2 Merge "[Performance] avoid setting the same optimization mode again" into sc-v2-dev am: f3155c03f0 am: f5fe795a34
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15712669

Change-Id: I982c82723e8ec3d79b149f09a6d8ddc0f7d21447
2021-08-30 11:13:00 +00:00
ykhung
35bcab603b [B&R] restore the backup data for app optimization mode back am: adec23a106 am: ea57d6863e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15681503

Change-Id: If1af4c2d1671d1ae9976245a739878bbdf887211
2021-08-30 10:11:00 +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
adec23a106 [B&R] restore the backup data for app optimization mode back
BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy method name

Test command for backup manager:
adb shell bmgr backupnow com.android.settings
adb shell dumpsys backup | grep Current
adb shell bmgr restore 3e9867a7660315b8 com.android.settings

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: Ia35f8caa8fe2408be28c3494785a174a1aeb11da
2021-08-30 06:45:26 +00:00
Dmitri Plotnikov
ad0bb5b7fe Remove uses of deprecated class BatterySipper
also, remove the obsolete class FakeUid

Test: make RunSettingsRoboTests
Test: make RunSettingsGoogleRoboTests
Change-Id: I2f235a18dcca3b5b3a2839408b76553bbc4f655a
2021-08-27 18:19:36 -07:00
Android Build Prod User
33af17ff31 Merge "[QPR1] Add time unit into battery usage chart and refine some UI" into sc-qpr1-dev 2021-08-26 21:42:36 +00:00
ykhung
8ffdf372c1 [B&R] ignore backup system app or default app optimization modes am: a90496e92e am: c724633bf3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15671541

Change-Id: Ieb631d27cc6ca53f8926be3a4998baf38f4893dc
2021-08-26 08:49:15 +00:00
ykhung
a90496e92e [B&R] ignore backup system app or default app optimization modes
Avoid backup system app or default app optimization modes, since all of
them are using the MODE_UNRESTRICTED in default, and the system or
default apps may be different in the different devices.

BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy method name

Test command for backup manager:
adb shell bmgr backupnow com.android.settings
adb shell dumpsys backup | grep Current

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I0862ee31fcfa3bece15c2d4fdef5b0ea70235967
2021-08-25 15:01:52 +00:00
ykhung
87898aec66 [B&R] notify BackupManager when app optimization mode is changed am: 935a9321b5 am: 5f3bc01915
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15667992

Change-Id: I8e422e893bb80e202ed50550c05ea5484b1b2756
2021-08-25 03:55:48 +00:00
ykhung
935a9321b5 [B&R] notify BackupManager when app optimization mode is changed
Invoke BackupManager.dataChanged() when app optimization mode is changed
to notify BackupManager to execute Settings agent to backup data in the
next backup session, when performing the partial backup event.

Bug: 192523697
Bug: 197608038
Bug: 194633034
Test: make SettingsRoboTests
Change-Id: I456acc2594d22503763e4ce286435148ae0644a4
2021-08-25 02:21:16 +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
ykhung
b2f80a7105 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
2021-08-24 10:20:43 +00:00
TreeHugger Robot
b20b462cca Merge "[B&R] backup the battery optimization mode for installed apps" into sc-v2-dev am: c63c0d4370 am: 0249ae9582
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15635264

Change-Id: I81cc433712fcb62a72a85dc227be14e65d979e5b
2021-08-23 05:55:43 +00:00
ykhung
37ddf4bc3e [B&R] backup the battery optimization mode for installed apps
BYPASS_INCLUSIVE_LANGUAGE_REASON=legacy method name

Test command for backup manager:
adb shell bmgr backupnow com.android.settings
adb shell dumpsys backup | grep Current

Bug: 192523697
Test: make SettingsRoboTests
Change-Id: I4671e48a9d3b315362b451384db637d5cae36a4d
2021-08-23 12:32:07 +08:00
YUKAI HUNG
8a51d3a749 Merge "[B&R] backup the getFullPowerWhitelist() for battery setting" into sc-v2-dev am: 5d59c685d7 am: 902ae0a655
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15611718

Change-Id: I409320cd7a991095c102ea5fab3a035c9c3e86a1
2021-08-20 02:02:15 +00:00