Commit Graph

2090 Commits

Author SHA1 Message Date
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
266ddbf9b4 Support accessibility for battery chart (2)
Support virtual accessbility children in battery usage chart.

Please see the following screen record with sound:
VoiceAccess by name: https://drive.google.com/file/d/15pEEU0OJsyCRbqR4nkALlIgHue4KVEvL/view?usp=sharing&resourcekey=0-ed-u-IWSDlODiYyJIEmVng
VoiceAccess by number: https://drive.google.com/file/d/1mBNjbpPGsw4nYU_krG8283RVPaYGZMO3/view?usp=sharing&resourcekey=0-3aIhbcCzJuEpsbDkaPAcWg
SwitchAccess: https://drive.google.com/file/d/1rr8sHMGCbP0kglsp7rWwOVQV5kcgEZHa/view?usp=sharing&resourcekey=0-GW2525dHtzDWvzS2uhu8Yg
TalkBack: https://drive.google.com/file/d/1daxwHQE3BwySuSIptvO9wCJwnjVehsLE/view?usp=sharing&resourcekey=0-DWo0TuhAfz_9Qaf9_orIWA
MouseConnected: https://drive.google.com/file/d/1DzJq5tJsNneNsRbRIZptXfK1l_wR0Kdz/view?usp=sharing&resourcekey=0-npq7ekR1glpofEKMRcJzFQ

The following is the orignal broken behaviors:
Original VoiceAccess: https://drive.google.com/file/d/1FtQJoVVWnq2xZyUaxW5_h1o0y7jTm9zd/view?usp=sharing&resourcekey=0-BVfk0nzpC2RSx9vGKmfogQ
Original TalkBack: https://drive.google.com/file/d/1jMuDo8Lu0uGRSm3OWVBCbm7lXVJnpMn4/view?usp=sharing&resourcekey=0-ozUs4bN14fMPrbvHUtogpw

Bug: 242989585
Fix: 242989585
Test: manual
Change-Id: I18fe63f75c2438e80b244050608a7ccb2b52c37b
2022-09-13 14:21:55 +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
Kuan Wang
3759adfda6 Add fade in / out animation for battery usage hourly chart.
After:
https://drive.google.com/file/d/1-1z2EM16X76qltTz_fL_DvgI7m65TtAN/view?usp=sharing

Before:
https://drive.google.com/file/d/1pG2rQ3V4rphjx7RLhSjb1r2HgXiFCYQZ/view?usp=sharing

Bug: 245655904
Test: manually
Change-Id: I72533a28445bea83aea604a937864052bd65c898
2022-09-13 12:19:59 +08:00
TreeHugger Robot
94d1718089 Merge "Support accessibility for battery chart (1)" 2022-09-08 05:09:37 +00:00
Tiffany Nguyen
032649b4f8 Move restricted apps page to new battery optimization page.
New entry: https://screenshot.googleplex.com/BbU6RnQhBbpnBc3.png
Restricted: https://screenshot.googleplex.com/5ggid7TcSsH9CUF.png
Old entry: https://screenshot.googleplex.com/7JgZpSfKs5zZb3Z.png

Bug: 240711616
Test: manual
Change-Id: I03d17beac0fb85a3d17acd7d0d581feb35e9582b
(cherry picked from commit 3acd34fe4a)
Merged-In: I03d17beac0fb85a3d17acd7d0d581feb35e9582b
2022-09-04 15:48:46 +00:00
Tiffany Nguyen
6147e0fa5c Add Apps > Battery optimization page implementation.
Moving the old restricted page to the new optimization page will happen
in a follow-up CL.

Test: Unit, manual
Bug: 238026672
Change-Id: I5fee9ebe03284a013da6bfca9ada8b166c6af91c
(cherry picked from commit 5ecb1a1d69)
Merged-In: I5fee9ebe03284a013da6bfca9ada8b166c6af91c
2022-09-04 15:44:18 +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
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
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
TreeHugger Robot
baa3f3a3c6 Merge "Support showing battery level chart first immediately after the battery level data is ready." into tm-qpr-dev 2022-08-30 06:22:53 +00:00
Zaiyue Xue
bae18f1386 For battery chart 7-bar case, remove the center two labels according to UX designer's suggestion.
latest screenshots: https://drive.google.com/drive/folders/1V2UoBO2tOVydVxT5Yd5ASruuzizy-s7F?resourcekey=0-z2UInYUQ3mLGG80hedO78A&usp=sharing

Test: manual
Bug: 242009481
Change-Id: I3f717add0bcce1d3697c9ff6e91032e3817e6304
(cherry picked from commit 53b816c7be)
2022-08-29 05:42:33 +00:00
Zaiyue Xue
457aaffa50 Support showing battery level chart first immediately after the battery level data is ready.
When the battery level chart is shown but app usage data is not ready,
the battery chart is still clickable, but the app list won't show. Once
the app usage data is ready, the app usage list of the latest selected
period will show. Please see the following screen record of forcing
loading app usage data very slow. In the real case, the app usage
loading is not that slow.

https://drive.google.com/file/d/196rlzwSa52xrQFRfF2gdHJJPZn-uecZF/view?usp=sharing&resourcekey=0-mGggQGG7IMd5-bSAG7l_LA

Bug: 243887839
Fix: 243887839
Test: manual
Change-Id: I170eb4afb46b1d0040b7971460b1b37dde5d1362
(cherry picked from commit adc36d085b)
2022-08-29 05:42:12 +00:00
YK Hung
571b54e7fa Merge "Support showing battery level chart first immediately after the battery level data is ready." 2022-08-26 18:39:25 +00:00
TreeHugger Robot
66a56fdd37 Merge "Remove duplicate strings." 2022-08-26 17:52:54 +00:00
YK Hung
c8d69051a4 Merge "For battery chart 7-bar case, remove the center two labels according to UX designer's suggestion." 2022-08-26 17:00:47 +00:00
Zaiyue Xue
53b816c7be For battery chart 7-bar case, remove the center two labels according to UX designer's suggestion.
latest screenshots: https://drive.google.com/drive/folders/1V2UoBO2tOVydVxT5Yd5ASruuzizy-s7F?resourcekey=0-z2UInYUQ3mLGG80hedO78A&usp=sharing

Test: manual
Bug: 242009481
Change-Id: I3f717add0bcce1d3697c9ff6e91032e3817e6304
2022-08-26 15:43:06 +08:00
Zaiyue Xue
adc36d085b Support showing battery level chart first immediately after the battery level data is ready.
When the battery level chart is shown but app usage data is not ready,
the battery chart is still clickable, but the app list won't show. Once
the app usage data is ready, the app usage list of the latest selected
period will show. Please see the following screen record of forcing
loading app usage data very slow. In the real case, the app usage
loading is not that slow.

https://drive.google.com/file/d/196rlzwSa52xrQFRfF2gdHJJPZn-uecZF/view?usp=sharing&resourcekey=0-mGggQGG7IMd5-bSAG7l_LA

Bug: 243887839
Fix: 243887839
Test: manual
Change-Id: I170eb4afb46b1d0040b7971460b1b37dde5d1362
2022-08-26 14:25:24 +08:00
TreeHugger Robot
6b5dc07b95 Merge "Fix b/243746796 Crash when mouse hangs over an empty battery chart" into tm-qpr-dev 2022-08-26 05:36:37 +00:00
Zaiyue Xue
4bb92296b5 Change the master code the same as tm-qpr-dev to avoid future merge conflicts.
Bug: 243746796
Test: manual
Change-Id: I9c693a65ebbbe33c9d132131f832c26505a23a4e
2022-08-26 13:36:36 +08:00
Zaiyue Xue
fb3ebf8dc7 Fix b/243746796 Crash when mouse hangs over an empty battery chart
Bug: 243746796
Fix: 243746796
Test: manual
Change-Id: I3e595c96a55f1114b50ed5ed8e49e962cc90cbde
Merged-In: I3e595c96a55f1114b50ed5ed8e49e962cc90cbde
2022-08-26 12:32:05 +08:00
Kweku Adams
5949fccc7a Remove duplicate strings.
"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
2022-08-26 00:07:08 +00:00
TreeHugger Robot
fb2090e643 Merge "Fix b/243746796 Crash when mouse hangs over an empty battery chart" 2022-08-25 16:19:14 +00:00
TreeHugger Robot
2802ec1c44 Merge "Fix b/243485315: NullPointerException when getAppBatteryUsageData()." 2022-08-25 16:19:10 +00:00
Zaiyue Xue
87db35205a Fix b/243485315: NullPointerException when getAppBatteryUsageData().
Bug: 243485315
Fix: 243485315
Test: presubmit
Change-Id: I8bb2db7976f6c8817e9ab45fe3a40456afcd8128
2022-08-25 13:36:44 +00:00
Zaiyue Xue
8e00605228 Fix b/243485315: NullPointerException when getAppBatteryUsageData().
Bug: 243485315
Fix: 243485315
Test: presubmit
Change-Id: I8bb2db7976f6c8817e9ab45fe3a40456afcd8128
2022-08-25 14:50:32 +08:00
Zaiyue Xue
079aaf1261 Fix b/243746796 Crash when mouse hangs over an empty battery chart
Bug: 243746796
Fix: 243746796
Test: manual
Change-Id: I3e595c96a55f1114b50ed5ed8e49e962cc90cbde
2022-08-25 13:45:01 +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
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
919864918c Add fade in animation for battery usage chart group
Bug: 236101166
Test: manually checking for UI
Change-Id: I56e2f80036397efd1ce0dceec46fceff08af43d6
2022-08-23 09:31:08 +00: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
YK Hung
80bf09e5a7 Merge "Support data logging for battery usage new chart view" 2022-08-22 03:01:51 +00:00
Tiffany Nguyen
2c1decd7a0 Merge changes from topic "battery_usage_list"
* changes:
  Align strings and UX across the different pages.
  Move restricted apps page to new battery optimization page.
2022-08-19 21:04:08 +00: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
aa3262857c Merge "Implements the buttons layout for the extra defend" into tm-qpr-dev 2022-08-19 02:43:57 +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
TreeHugger Robot
aa21979d79 Merge "Fix b/242009481: Refine the battery usage chart timestamp label rule" 2022-08-17 20:27:55 +00:00
TreeHugger Robot
2bc09010d8 Merge "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." 2022-08-17 19:01:27 +00:00
Zaiyue Xue
e716055e45 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.
Bug: 242809981
Fix: 242809981
Test: manual
Change-Id: I303bbc2679f70ef16636c28f6364381f49457387
2022-08-17 12:59:50 +00: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