ykhung
e5536bb101
Update the constant fields in the BatteryOptimizeUtils
...
Test: presubmit
Bug: 306329984
Change-Id: I64df1d6f632f913e2d3629f640c6c75437e19e13
2023-11-07 18:43:42 +08:00
Yi-Ling Chuang
9718ae0aa9
Add battery warning TipType
...
Bug: 309054332
Test: rebuild
Change-Id: Ib7f95eb14aac7ac6d6a0941ea40a9eb723fa9300
2023-11-06 15:43:57 +08:00
Jun Lan
cca804e1ed
Format battery java code
...
After this CL, we can follow Guideline:go/hc-mainline-dev#format-code to keep java format consistent.
Test: manual
Bug: 304439460
Change-Id: I5bb77f81b0bd9be618e34942eaaee8296bc42796
2023-11-06 13:55:48 +08:00
Jun Lan
da70c86bda
Merge "Replace HashMap with ArrayMap for better performance" into main
2023-11-06 05:31:07 +00:00
Jun Lan
b0f9489a09
Replace HashMap with ArrayMap for better performance
...
Reason: https://screenshot.googleplex.com/BdHiua8gU8aGUmR
Test: manual
Bug: 308913393
Fix: 308913393
Change-Id: Iea085006ffe6ca48fe547319b9f0f4d20aa78bda
2023-11-06 12:34:05 +08:00
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
YK Hung
c7c82de77e
Merge "Fix full-charge timestamp lost in battery chart graph." into main
2023-11-02 15:06:16 +00:00
mxyyiyi
feaf08a9ba
Fix full-charge timestamp lost in battery chart graph.
...
Bug: 308917113
Fix: 308917113
Test: manual
Change-Id: Ie87c72a020a3b169a25df6422ea3b456b988c14d
2023-11-02 19:17:04 +08:00
Treehugger Robot
90a563b12a
Merge "Add a skeleton for dynamic deny list class" into main
2023-11-02 09:54:28 +00:00
Wesley Wang
98f76259ff
Add a skeleton for dynamic deny list class
...
- Create a class with default sharedpreference management
Bug: 306329984
Test: make SettingsRoboTests
Change-Id: I06cf7c5ea82a44a61b05b7bbcddb6040cc917ec5
2023-11-02 17:01:32 +08:00
Jun Lan
29b243bb3e
Add cache for PackageManager.getPackageUid to improvement performance
...
Context: `PackageManager.getPackageUid` is IPC which could be slow. Add a map in BatteryDiffEntry to cache the data. The cache lifecycle would be the same as other cache in BatteryDiffEntry.
Test: manual
Bug: 304439237
Fix: 304439237
Change-Id: I98d9c8cfee24dd43e9a4037b1b61c8353bf1bcea
2023-11-01 17:09:43 +08:00
mxyyiyi
81e028931a
Refactor background optimization mode in Power Usage Detail page.
...
[Screenshot]:
before: https://screenshot.googleplex.com/6m5jYWHofY2pFov
after:
[App battery usage]
- [normal] https://screenshot.googleplex.com/7aurWk7cHKaWds7
- [always unrestried/optimized] https://screenshot.googleplex.com/3rGAh4ccUYTKBAr
[Allow Background usage]
- [Restricted]: https://screenshot.googleplex.com/MPXjQe5kPWw2nhr
- [Optimized]: https://screenshot.googleplex.com/6w4zTT6r34APnGc
- [Unrestricted]: https://screenshot.googleplex.com/97FgvHWMrwASqYH
Bug: 302063050
Bug: 306295660
Bug: 308359833
Test: manual
Change-Id: I3237d015549fe26e62d6d68c13403cc2cbdf0017
2023-11-01 11:17:30 +08:00
ykhung
6d94558451
Add a flow to keep special apps in the battery unrestricted mode
...
Fix: 306506148
Test: atest & presubmit
Change-Id: I1636f4fe38394686b40c9f52d37bd9ae6f2c46ba
2023-10-30 15:33:15 +08:00
ykhung
d3684f7d1d
Rename for: force app stay in the battery optimize mode
...
Bug: 306506148
Test: atest & presubmit
Change-Id: I69a0c6b290c21ae1fca676ffe8295543b2323a7a
2023-10-30 11:33:39 +08:00
Chaohui Wang
15ca95a31b
Migrate to TwoStatePreference
...
SwitchPreference and SwitchPreferenceCompat are both TwoStatePreference.
Using TwoStatePreference in Java will helps migration in the future.
Bug: 306771414
Test: manual - check Settings pages
Change-Id: I84e1d7b09451106797c2b23d127855c6976678ca
2023-10-23 09:28:57 +00:00
Jun Lan
28088dc64b
Fix uninstalled app original uid should not be 0
...
Context: some special packages have uid but 0. Those packages should not
be part of uninstalled apps.
Test: manual
Bug: 264339271
Fix: 264339271
Change-Id: I86874691b0a837335c2e5352d1d0c6be8df8a2e4
2023-10-19 15:34:33 +08:00
Jun Lan
0e5688a454
Merge "Fix uninstalled app issue on battery usage page" into main
2023-10-12 10:32:40 +00:00
Jun Lan
c617e3c638
Fix uninstalled app issue on battery usage page
...
Context: for uninstalled app, we cannot get the package UID, name and icon from the package manager, and the app would be shown as package name and default system icon in the page. For those unknown apps, we will put them into 'Uninstalled app' component for a quick fix.
Some lines are changed by auto format, and please ignore it. I will send out a follow up cl to format all battery files. It can improve the productivity if all team members are using the auto-format tool during the development.
Before: https://screenshot.googleplex.com/6zmFVgMxHGYMwqH
After: https://screenshot.googleplex.com/3cZwrhcE8zhDyfN
Test: manual
Bug: 264339271
Change-Id: I61a32675a31eefc8fdb1a408fbcebe9a2d6dcd68
2023-10-12 18:18:14 +08:00
YK Hung
589c129f43
Merge "Fix the issue that system component items are missing in main branch." into main
2023-10-11 16:20:15 +00:00
Zaiyue Xue
97fab476b4
Fix the issue that system component items are missing in main branch.
...
Please see the root cause in the bug description.
Bug: 304694899
Fix: 304694899
Test: manual
Change-Id: I89a146e979ed9eeca60cb03b464517359e6a3475
2023-10-11 16:51:30 +08:00
YK Hung
74927c7e11
Merge "Fix NullPointerException when full charge unplug a device with work profile" into main
2023-10-11 01:58:24 +00:00
Zaiyue Xue
7385665d8c
Merge "Use empty BatteryDiffData instead of null to avoid NullPointerException" into main
2023-10-11 01:54:39 +00:00
Zaiyue Xue
0e277429cb
Fix NullPointerException when full charge unplug a device with work profile
...
Block BatteryUsageBroadcastReceiver when context is work profile.
Bug: 304441610
Fix: 304441610
Test: manual
Change-Id: I91a41d5570e7cacf77a8d126c7700ee4bd766d40
2023-10-10 21:26:06 +08:00
Zaiyue Xue
8e6a5db9a2
Fix screen time not updated issues.
...
When slotUsageData is null, the UI should update screen time to 0
instead of skipping update.
Bug: 304432148
Bug: 299801782
Bug: 301943900
Fix: 304432148
Fix: 299801782
Fix: 301943900
Test: manual
Change-Id: I25da1abf8ea79305ebf5468977b2a57ce917609f
2023-10-10 15:55:37 +08:00
Zaiyue Xue
834e19b188
Use empty BatteryDiffData instead of null to avoid NullPointerException
...
This is one action post P0 bug b/301362376.
Bug: 304067689
Bug: 303838369
Fix: 304067689
Fix: 303838369
Test: manual
Change-Id: I8bb6bfe9c3fca78ab19dfbfd2a184b0f92f4ef09
2023-10-08 16:38:29 +08:00
Treehugger Robot
4cc92858f4
Merge "Config battery info page(1/2)" into main
2023-10-03 08:53:01 +00:00
Wesley Wang
bace563189
Config battery info page(1/2)
...
- Make battery information page configurable
Bug: 301817717
Test: make SettingsRoboTests
Change-Id: I51bf00fe3d9993ecd4e8481cd7c15d70b3c09ec4
2023-10-03 07:36:52 +00:00
mxyyiyi
1b9eb170dd
Refactor Power Usage Time Page.
...
- Show use time category
Screenshot:
[Screen time with hint] https://screenshot.googleplex.com/3cRLrwevzw4iytb
[Background time with hint] https://screenshot.googleplex.com/zEf8PcWopCVCRZR
[without hint] https://screenshot.googleplex.com/9bao9sVd8s7VRwM
[enter from app info (without category)] https://screenshot.googleplex.com/8sozxMrq8ojadiF
Bug: 302063050
Test: Manual
Change-Id: Ic967d05a173afa76c2a958e1332dedd9f83cd687
2023-10-02 02:34:35 +08:00
YK Hung
a191396363
Merge "Fix anomalyEventId metrices action." into main
2023-09-29 06:31:24 +00:00
mxyyiyi
2385e3a714
Fix anomalyEventId metrices action.
...
Bug: 302251479
Fix: 302251479
Test: manual
Change-Id: Ia1a17f8c69dfe6673a122aa4f1c662d4617dc78f
2023-09-28 15:47:41 +08:00
Zaiyue Xue
6bf04986ac
Fix NullPointerException when showEmptyChart
...
Bug: 301880705
Fix: 301880705
Test: presubmit
Change-Id: I22a1df6b791396b398038c6bdb8e6b3ca37dc9e1
2023-09-26 11:40:57 +08:00
Treehugger Robot
bfc0458220
Merge "Fix JAVA_CRASH NullPointerException in BatteryUsageDataLoader." into udc-qpr-dev am: 7cac3f9f7d am: 5dd5c4874f
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24820838
Change-Id: I2bd72f98041f50e050f1b418e6a63a79910df0fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com >
2023-09-22 06:29:11 +00:00
Zaiyue Xue
764337bd80
Fix JAVA_CRASH NullPointerException in BatteryUsageDataLoader.
...
Bug: 301362376
Fix: 301362376
Test: manual
Change-Id: I75060fc3d1989522f58cae593b1c1f4063dbd6e5
2023-09-21 19:34:09 +08:00
Zaiyue Xue
c3cf254c7d
Call detect anomaly in period job only when there is new battery usage data.
...
- Reduce the memory usage of call anomaly detection
- Remove redundant condition for low battery banner
Bug: 300446490
Bug: 284893240
Fix: 300446490
Test: presubmit
Change-Id: I11c1b41a45e129bcec57b9d18c4affe0de7f1d38
2023-09-20 17:04:31 +08:00
Zaiyue Xue
8371d08595
Call detect anomaly in period job only when there is new battery usage data.
...
- Reduce the memory usage of call anomaly detection
- Remove redundant condition for low battery banner
Bug: 300446490
Bug: 284893240
Fix: 300446490
Test: presubmit
Change-Id: I11c1b41a45e129bcec57b9d18c4affe0de7f1d38
Merged-In: I11c1b41a45e129bcec57b9d18c4affe0de7f1d38
2023-09-20 17:04:01 +08:00
mxyyiyi
56ba1c09d9
App anomaly tips on PowerUsage App list
...
Screenshots:
[in bg - banner] https://screenshot.googleplex.com/MzLC6LfX93TkkYf
[in bg - hints] https://screenshot.googleplex.com/9JLXNsRiVG8arAU
[in fg - banner] https://screenshot.googleplex.com/9oYbwUkeeLbQX2t
[in fg - hints] https://screenshot.googleplex.com/53DTTUCUnf8rsoE
[apps anomaly highlight hint + settings anomaly banner]
https://screenshot.googleplex.com/8NdS2VMrSzwv2DM
Bug: 291689643
Bug: 291689623
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bfd0f5859b6e5ffef4727ee562009f2050de7a58 )
Change-Id: Ic02db49cb3794ef134759d9dcec5f5ef32454a95
2023-09-18 10:41:27 +00:00
mxyyiyi
e9378d27f7
App anomaly tips on PowerUsage App list
...
Screenshots:
[in bg - banner] https://screenshot.googleplex.com/MzLC6LfX93TkkYf
[in bg - hints] https://screenshot.googleplex.com/9JLXNsRiVG8arAU
[in fg - banner] https://screenshot.googleplex.com/9oYbwUkeeLbQX2t
[in fg - hints] https://screenshot.googleplex.com/53DTTUCUnf8rsoE
[apps anomaly highlight hint + settings anomaly banner]
https://screenshot.googleplex.com/8NdS2VMrSzwv2DM
Bug: 291689643
Bug: 291689623
Bug: 284893240
Test: manual
Change-Id: Ic02db49cb3794ef134759d9dcec5f5ef32454a95
Merged-In: Ic02db49cb3794ef134759d9dcec5f5ef32454a95
Merged-In: I7015cdf5a96d518febb160934d780ae84fe14427
2023-09-18 18:28:20 +08:00
Zaiyue Xue
e3232dac25
Call detect anomaly in battery usage period job
...
Bug: 291689643
Bug: 284893240
Test: manual
Change-Id: I7015cdf5a96d518febb160934d780ae84fe14427
2023-09-13 17:49:14 +08:00
mxyyiyi
6b8daefd54
Impl highlight effect on BatteryChartView slots. am: 6750634259 am: 9e4fed1b62
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24498956
Change-Id: I9a38284ab828c149ca06a51fbad7f3fcb2ac33de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com >
2023-09-13 08:54:29 +00:00
YK Hung
abc3ed4c88
Merge "Recheck the scedule job when the device is full charged and add more logs" into udc-qpr-dev am: 378ad24aac am: 348b3b91d8
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24673967
Change-Id: I6d29fc6eec107000986ad154bb8bc3bf81722b1c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com >
2023-09-13 05:33:15 +00:00
Treehugger Robot
3de1603336
Merge "Save foreground_service and cached consumed power in battery usage slot datebase." into udc-qpr-dev am: 7e92664f52 am: aab57c0179
...
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24689853
Change-Id: I2d7fd99406b999f5a027eefed61be22da293475e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com >
2023-09-13 05:30:51 +00:00
mxyyiyi
6750634259
Impl highlight effect on BatteryChartView slots.
...
Screenshot: https://screenshot.googleplex.com/F5VrGjj5kdNHMV6
Bug: 284893240
Bug: 291689623
Test: manual
Change-Id: I846d95d31e8bb839481b86a94d5191ff205f8328
2023-09-13 13:29:32 +08:00
YK Hung
9a293a7101
Merge "Refactor battery usage page contollers interaction logic" into udc-qpr-dev
2023-09-13 04:35:26 +00:00
YK Hung
02b5491447
Merge "Refactor flags of Power Anomaly Tips in Settings Intelligence.(1/2)" into udc-qpr-dev
2023-09-13 04:35:16 +00:00
YK Hung
378ad24aac
Merge "Recheck the scedule job when the device is full charged and add more logs" into udc-qpr-dev
2023-09-13 04:24:04 +00:00
Zaiyue Xue
ea0f5b3d45
Refactor battery usage page contollers interaction logic
...
(1) Move controllers interaction logic from BatteryChartPreferenceController to main page PowerUsageAdvanced.
(2) Move query power anomaly logic to DataProcessManager async job.
Bug: 284893240
Test: manual
Change-Id: Ib23b338fe3946e68ff73a372342ec5d86494c566
Merged-In: Ib23b338fe3946e68ff73a372342ec5d86494c566
2023-09-13 03:56:28 +00:00
mxyyiyi
19046965da
Refactor flags of Power Anomaly Tips in Settings Intelligence.(1/2)
...
- Remove unused flag is_battery_tips_feedback_enabled
- Update logic about is_battery_tips_enabled
Bug: 284893240
Bug: 291689623
Test: Manual
Change-Id: I826f517aa61e0c970048164706c4512ac3e0472d
Merged-In: I826f517aa61e0c970048164706c4512ac3e0472d
2023-09-12 11:28:10 +00:00
Zaiyue Xue
13695adf07
Recheck the scedule job when the device is full charged and add more logs
...
Bug: 298539147
Fix: 298539147
Test: manual
Change-Id: Id9fdba17b24cbc6558bc29576f8cd93782854ee4
2023-09-12 13:44:19 +08:00
Trina
bb21c0e1b7
Centralise time to full in SettingsLib
...
Test: atest SystemUIGoogleTests
Bug: 275679195
Change-Id: Ie4ca699e73e4ec48f2b0b8d95e61d0bd103f5e37
2023-09-11 11:16:58 +00:00
Zaiyue Xue
a93fd54d09
Save foreground_service and cached consumed power in battery usage slot datebase.
...
Bug: 284893240
Test: manual
Change-Id: Ic09efabb0d93fb4bc7400b9410f32ec2f438dc73
2023-09-08 20:20:36 +08:00