Commit Graph

1110 Commits

Author SHA1 Message Date
Kuan Wang
56d1c2fa55 Extract the logic of loading battery usage data form BatteryUsageStats
in DataProcessor to make it reusable by BatteryUsageLoaderService.

Bug: 246233366
Test: make RunSettingsRoboTests + manually
Change-Id: I5c721120cc4005044def63937506cc64339a3e6b
2022-09-26 10:45:30 +00:00
Kuan Wang
1051fb16d8 Show app list in Battery Usage page when there is no battery level data.
https://drive.google.com/file/d/1mZ2Sn3dmjQcCxnhKqDPxfLJDyiTe6mEk/view?usp=sharing

Bug: 246233366
Test: make RunSettingsRoboTests + manually
Change-Id: If536c93652506c8009f5cabf3d0ae373b6825bfc
2022-09-19 07:09:37 +00:00
Zaiyue Xue
d4a26a7a80 Merge changes from topic "accessibility1" into tm-qpr-dev am: 9b24df2c38 am: 83ef9001e7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19771692

Change-Id: I8bf9b9c1a6f884850ff7c81965589b5724cdd065
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 01:39:50 +00:00
Kuan Wang
9059b26db8 Add logging for count of shown / hidden apps in Battery Usage page. am: 676bcedb85 am: 93c0d0227b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19893207

Change-Id: I8014b3155c6f731aa88133c718c986b09893723e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 01:39:00 +00:00
Zaiyue Xue
83ef9001e7 Merge changes from topic "accessibility1" into tm-qpr-dev am: 9b24df2c38
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19771692

Change-Id: I80680875b02983c58a9e3c324dc13e055ad75fb8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-14 06:09:40 +00:00
Zaiyue Xue
9479b18cf9 Support accessibility for battery chart (1) am: 9c962b03e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19764112

Change-Id: If91f5422518ff8cc76dcc5c216a83a70dd7a337d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-14 06:09:35 +00:00
Zaiyue Xue
9b24df2c38 Merge changes from topic "accessibility1" into tm-qpr-dev
* changes:
  Support accessibility for battery chart (4)
  Support accessibility for battery chart (3)
  Support accessibility for battery chart (2)
  Support accessibility for battery chart (1)
2022-09-14 05:46:17 +00:00
Kuan Wang
93c0d0227b Add logging for count of shown / hidden apps in Battery Usage page. am: 676bcedb85
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19893207

Change-Id: I52977900a9f669fa7b31c2c72cbd5ec10646a28a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-14 02:36:50 +00:00
Kuan Wang
676bcedb85 Add logging for count of shown / hidden apps in Battery Usage page.
Bug: 245455490
Test: manually
Change-Id: I7342e822f00f9a0aedcef592cae9809251518812
2022-09-14 02:09:16 +00:00
Zaiyue Xue
79311805b6 Support accessibility for battery chart (3)
Support accessibilty read out full timestamp labels instead of the short one, e.g "Sunday" instead of "Sun".

Bug: 242989585
Test: manual
Change-Id: Ica2176ef3f07849d278327b9301f8c318782c2d5
2022-09-13 14:43:20 +08:00
Zaiyue Xue
9c962b03e9 Support accessibility for battery chart (1)
Remove the logic of disabling clickable when accessability is on in battery chartview.

Bug: 242989585
Test: manual
Change-Id: I92ce0ff5aac5220d686d600dbdf1d5738fe2c385
Merged-In: I92ce0ff5aac5220d686d600dbdf1d5738fe2c385
2022-09-13 14:21:01 +08:00
TreeHugger Robot
94d1718089 Merge "Support accessibility for battery chart (1)" 2022-09-08 05:09:37 +00:00
YK Hung
b637d56d09 Merge "Update defend tips card" into tm-qpr-dev am: 8bf872331b am: 06e92f5e45
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19764101

Change-Id: I6bf829b5f72796eb136bc2e6745008e56032cfc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 16:22:41 +00:00
YK Hung
06e92f5e45 Merge "Update defend tips card" into tm-qpr-dev am: 8bf872331b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19764101

Change-Id: I6c4d4d551dc4ccd1897422cd65bf26cadeb9994c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 15:46:17 +00:00
YK Hung
8bf872331b Merge "Update defend tips card" into tm-qpr-dev 2022-09-02 15:18:50 +00:00
TreeHugger Robot
4d6e33e3e8 Merge "Update the timestamp label into uppercase and increase vertical offset" into tm-qpr-dev am: 0f1f02693e am: 23c78beab2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19784482

Change-Id: Iec164b894ac9fb7101709262e1703642d80d4515
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 07:02:03 +00:00
TreeHugger Robot
23c78beab2 Merge "Update the timestamp label into uppercase and increase vertical offset" into tm-qpr-dev am: 0f1f02693e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19784482

Change-Id: Ic5be9dd619cb394992f829dc5d2f43c6cf2bd246
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 06:42:11 +00:00
Wesley
243b450428 Update defend tips card
- Update defend tips card to unclickable
 - Update secondary button's action and content description
 screenshot: https://screenshot.googleplex.com/BYU8Mh5abJ9Tirh.png

Bug: 243769797
Bug: 243641857
Bug: 244219076
Test: make SettingsRoboTests
Change-Id: I7fdf5f7404d33f0374a992c83a7653a01b9f11bc
2022-09-01 04:09:31 +00:00
Zaiyue Xue
69148b4aae Support accessibility for battery chart (1)
Remove the logic of disabling clickable when accessability is on in battery chartview.

Bug: 242989585
Test: manual
Change-Id: I92ce0ff5aac5220d686d600dbdf1d5738fe2c385
2022-08-31 15:52:52 +08:00
ykhung
352e3a091d Update the timestamp label into uppercase and increase vertical offset
Update the timestamp label into uppercase based on the different locale
and increase the vertical offset from UX review feedback

Test: presubmit
Change-Id: Ie5e86967e36773f1f8c4f628501514b1a7fd22f5
2022-08-31 11:03:26 +08:00
Wesley Wang
320ad12543 Merge "Update extra defend layout string" into tm-qpr-dev am: a0c76c92a1 am: 20e927164b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19695293

Change-Id: I288c58df33642427aa8b39f3d1af6f4cb521c8d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 06:30:00 +00:00
YK Hung
2d3d452f93 Merge "Reduce the calling times for isExtraDefend" into tm-qpr-dev am: 821c5702cd am: 7e9c49305f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19707329

Change-Id: I6be24ea85c35e15310610f90e5a4a109550326f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 06:29:52 +00:00
Wesley Wang
20e927164b Merge "Update extra defend layout string" into tm-qpr-dev am: a0c76c92a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19695293

Change-Id: I50b0b62fd268026ac0e79a14df8640f19be5078f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 06:02:02 +00:00
YK Hung
7e9c49305f Merge "Reduce the calling times for isExtraDefend" into tm-qpr-dev am: 821c5702cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19707329

Change-Id: I2f0a4c8b200f69d37d16577ee1131efe2eaba248
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 06:01:54 +00:00
TreeHugger Robot
3588b515f2 Merge "Port battery usage bug fixing cls from master to tm-qpr-dev" into tm-qpr-dev am: adf79eae3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19711303

Change-Id: I137233586abf15929227f3795ef061699a7335e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-24 06:01:14 +00:00
Wesley Wang
a0c76c92a1 Merge "Update extra defend layout string" into tm-qpr-dev 2022-08-24 05:11:03 +00:00
YK Hung
821c5702cd Merge "Reduce the calling times for isExtraDefend" into tm-qpr-dev 2022-08-24 05:08:48 +00:00
Pajace Chen
b00140b7a3 Reduce the calling times for isExtraDefend
Only calling this HAL API when BatteryDefenderTips card need to be shown

Bug: 243465597
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Change-Id: Iae3c03d946ec29fe78a826ce62b6bebd893704ef
2022-08-23 20:15:50 +08:00
Zaiyue Xue
2a57f5de8d Port battery usage bug fixing cls from master to tm-qpr-dev
This cl is a merge of the following 5 cls:
ag/19674112	Fix b/242989581: The two battery charts have the same label
ag/19667114	Support data logging for battery usage new chart view
ag/19636171	Support data logging for battery usage new chart view
ag/19682758	Resolve insufficient contrast for system component icons
ag/19697763	Add fade in animation for battery usage chart group

Bug: 242989581
Bug: 242810430
Bug: 242989982
Test: presubmit
Change-Id: I39cd0f88ce62a280a966750082a40f8a537b9616
Merged-In: Ice30508bc20b5de631efee0db0160fe6ad710dbb
2022-08-23 19:30:49 +08:00
ykhung
4e98bc19f0 Resolve insufficient contrast for system component icons
Screenshots:
https://screenshot.googleplex.com/5UE5aPgHHBqkpHr
https://screenshot.googleplex.com/8yYqPusm9M2euSj

Bug: 242989982
Test: manually checking for icon UI
Change-Id: Ic3e51dd4d0bc042c9caba78a89f5fe6a4b995efb
2022-08-22 15:44:01 +00:00
wesleycwwang
27cbd5bccd Update extra defend layout string
Bug: 235246949
Test: make RunSettingsRoboTests
Change-Id: I3a3afe2e47d90882bdc4e4180ea5c6b079efd828
2022-08-22 18:51:45 +08:00
Wesley Wang
08345933df Merge "Update Settings charging string" into tm-qpr-dev am: 4909c7923b am: 7ffe4ed694
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19568529

Change-Id: Iaa3ff1fe5326ddce4752aa873424681ef34d284f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 03:02:24 +00:00
YK Hung
80bf09e5a7 Merge "Support data logging for battery usage new chart view" 2022-08-22 03:01:51 +00:00
Wesley Wang
7ffe4ed694 Merge "Update Settings charging string" into tm-qpr-dev am: 4909c7923b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19568529

Change-Id: I7a115aed0ce30980579c8b2afb6335182d78d3e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-22 02:44:03 +00:00
Wesley Wang
4dd92bf5a1 Update Settings charging string
- Update charging protected string

Bug: 236798712
Test: make and verify strings
Change-Id: I86e063191b42e98d8836a6dbe3b32ff3ce3bb8d0
2022-08-19 18:18:02 +08:00
YK Hung
f2bbdf5035 Merge "Implements the buttons layout for the extra defend" into tm-qpr-dev am: aa3262857c am: 939f2a9eed
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19633714

Change-Id: I582c5cc6df9b9454013b4435d261c336fc4e7a4e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 03:23:26 +00:00
Zaiyue Xue
65b635854f Support data logging for battery usage new chart view
Bug: 242810430
Fix: 242810430
Test: presubmit
Change-Id: Ice30508bc20b5de631efee0db0160fe6ad710dbb
2022-08-19 11:05:17 +08:00
YK Hung
939f2a9eed Merge "Implements the buttons layout for the extra defend" into tm-qpr-dev am: aa3262857c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19633714

Change-Id: I691685d2190e03c917e9cee6ef9dc94a94e97f83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 03:04:12 +00:00
YK Hung
aa3262857c Merge "Implements the buttons layout for the extra defend" into tm-qpr-dev 2022-08-19 02:43:57 +00:00
YK Hung
6992c28b4a Merge "Port new version battery usage chart implementation from master to tm-qpr-dev." into tm-qpr-dev am: c586e1e427
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19569019

Change-Id: I69ba753143ff1bb5fab2db8a53785540530e3c77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 01:50:45 +00:00
Pajace Chen
f3496399dd Implements the buttons layout for the extra defend
Bug: 235246949
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.fuelgauge.*
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.widget.CardPreferenceTest
Test: manual test
Change-Id: I1dc4ab31adf85c684a4c09bd6c9bcfb54b52dc3c
2022-08-18 10:16:05 +00:00
Kuan Wang
4db5c6ba57 Port new version battery usage chart implementation from master to tm-qpr-dev.
This cl is a merge of the following 36 cls:
ag/19250259	Duplicate BatteryChartPreferenceController and BatteryChartView into new files for better diff review purpose
ag/19279660	Use Mockito 4.6.1 API for BatteryChartPreferenceControllerV2Test
ag/19267975	Add class BatteryLevelData used to parcel the battery timestamps and levels. It behaves as an interface between UI and data.
ag/19289086	Refactor BatteryChartView X-axis labels. Instead of only timestamps, also support any string[] labels.
ag/19238586	Add interpolation for the history data since last full charge loaded from database.
ag/19331746	Return raw history map in function getHistoryMapSinceLastFullCharge.
ag/19308838	In BatteryChartViewV2, use levels.length-1 to replace mTrapezoidCount. So the chartview could show any number of slots as the given levels length-1.
ag/19332266	Add class BatteryDiffData used to parcel battery usage data
ag/19331467	Refactor Battery Chart View State Controll
ag/19358207	Add DataProcessor to process raw history map for UI.
ag/19332276	Add battery chart view model.
ag/19394744	Update trapezoid validation in battery chart view.
ag/19379730	Support daily and hourly battery chartview.
ag/19428426	Improve X axis labels in battery chart (1)
ag/19446215	Improve X axis labels in battery chart (2)
ag/19394745	Add the async task to compute diff usage data and load labels and icons.
ag/19447624	Support showing app usage list for two battery charts
ag/19500907	Updates battery usage messages from last 24hr to last full charge. (Part1: V2 files)
ag/19505324	Update the selected period message in battery chart
ag/19500905	Updates battery usage messages from last 24hr to last full charge. (Part2: non-V2 files)
ag/19510363	Update usage data for EBS app usage list and App usage detail from 24 hours to last full charge.
ag/19523184	Update usage data for EBS app usage list and App usage detail from 24 hours to last full charge.
ag/19534864	Add margin between battery daily and hourly charts
ag/19491093	Always do interpolation for battery level data in daily chart.
ag/19565630	Avoid NullPointerException when batteryLevelData is null.
ag/19561239	Fix b/241872474 Battery usage page will crash when selecting the last hour chart bar, going to app detail page, and going back
ag/19565633	Fix b/241885070: Unexpected texts moving when going back to battery usage page
ag/19534850	New way to draw battery chart axis labels
ag/19561240	Switch Battery Usage Chart from V1 to V2.
ag/19561338	Switch Battery Usage Chart from V1 to V2.
ag/19600174	Fix b/242254055 Battery usage initial screen improvements (long data loading time)
ag/19600284	Fix b/242252080: Add padding space on the top of the battery chart
ag/19647338	Consider usage map valid even if [all][all] is null.
ag/19634227	Use new content uri everytime to avoid cache
ag/19600177	Fix b/242009481: Refine the battery usage chart timestamp label rule
ag/19647337	Fix b/242809981 Charge battery to 100% when battery usage page opened, the chart will refresh, but the app list isn't refreshed in that case.

Test: manual
Bug: 239491373
Bug: 236101166
Bug: 236101687
Fix: 236101166
Change-Id: I7de8d9dcee14627da10752534991f1ec9f616020
Merged-In: I9142c0d4e00dea3771777ba9aedeab07b635fa1a
2022-08-18 10:53:41 +08:00
Kuan Wang
508d938bc8 Consider usage map valid even if [all][all] is null.
Bug: 242835128
Fix: 242835128
Test: manual
Change-Id: Icd8e157f08d741604b5769464d74660651eb69df
2022-08-17 19:18:16 +08:00
Zaiyue Xue
2e7957727f Fix import of anyLong in BatteryChartPreferenceControllerTest.
This is to fix the merge conflicts within tm-qpr-dev,
tm-qpr-dev-plus-aosp and master.

Bug: 236101166
Test: manual
Change-Id: I2f4531ccc7c59b279d14bc5c0bd6c1fe51dd475d
Merged-In: I52547d10f0579fddb21091b641925910db17ef38
2022-08-12 13:57:53 +08:00
Zaiyue Xue
284e049cc1 Switch Battery Usage Chart from V1 to V2.
Test: manual
Bug: 236101166
Change-Id: I9142c0d4e00dea3771777ba9aedeab07b635fa1a
2022-08-10 13:55:54 +08:00
Zaiyue Xue
8d0030d874 Fix b/241872474 Battery usage page will crash when selecting the last hour chart bar, going to app detail page, and going back
This bug is because we always use mHourlyChartIndex to construct
every view model in mHoulyViewModels. However, mHourlyChartIndex could
be got from saved instance. So mHourlyChartIndex may be out of bound in
some hourly view model which has not many hours data.

This fix removes the selectedIndex in BatteryChartViewModel constructor. Suppose the selectedIndex should be set everytime the view model is used.

Test: manual
Bug: 236101166
Bug: 241872474
Change-Id: I0bb5568ac33fcc23c406fe3af308b8d2706c5542
2022-08-09 16:39:36 +08:00
Zaiyue Xue
b9bf92f5ae Add margin between battery daily and hourly charts
screenshot: https://drive.google.com/file/d/1vXL4XO9HezZ4fTJ5wh6Fi13oXf54yc9q/view?usp=sharing&resourcekey=0--k4_Qk4e9ELyENeAySlYFw

Bug: 236101166
Test: manual
Change-Id: Ib4f5705661d2799cc74f6a957ce715ebb93b28b8
2022-08-08 17:44:39 +08:00
Zaiyue Xue
693711469d Updates battery usage messages from last 24hr to last full charge. (Part2: non-V2 files)
Test: manual
Bug: 236101166
Change-Id: Id5ad3e859a01d3288a950bf6288eafc6144a23d6
2022-08-05 10:52:38 +08:00
TreeHugger Robot
85b03538d0 Merge "Update the selected period message in battery chart" 2022-08-04 09:51:07 +00:00
Zaiyue Xue
49e67c9f33 Updates battery usage messages from last 24hr to last full charge. (Part1: V2 files)
Test: manual
Bug: 236101166
Change-Id: I0aa9a1a4c902764bb9937e422e5e7f60b6e86859
2022-08-04 14:59:58 +08:00