Commit Graph

17176 Commits

Author SHA1 Message Date
Jason Chiu
c89755525f Update all preferences when the account preference updates UI
When an account is added or removed, the account preference controller
just updates the account list, whereas there's no trigger point for the
account data sync preferences to refresh.

Add an API to update all preferences in DashboardFragment, so we can
refresh the account sync preferences whenever the account list is
updated.

Bug: 185479221
Test: robotest, manual
Change-Id: Ide3d972abae09ce0175e3bafbb1f4a5e307d20c8
2022-07-19 10:32:23 +00:00
Sorin Basca
e2b0873f9c Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
(cherry picked from commit c1c3a84fdc)
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
(cherry picked from commit 61e0bcd194)
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-19 09:07:28 +00:00
Zaiyue Xue
837a8f0063 In BatteryChartViewV2, use levels.length-1 to replace mTrapezoidCount. So the chartview could show any number of slots as the given levels length-1.
Test: manual
Bug: 236101166, 239491373
Change-Id: I9625ed80e8eba6632cc864ada0ba3e9cf11de82a
2022-07-19 16:54:59 +08:00
Wesley Wang
7e8d79b3c2 Update battery optimize page states condition
- Keep apps optimize state as what it set even it's a system or default
   app
 - Previously we force system/defualt apps present as Unrestricted mode
   only and disable other options but that can not shows that apps
   actual optimize states, it's possible to be other states even it's a
   system or default apps, so we change the UI logic back to: present
   it's actual states and disable other options when it's a system or
   default apps.

Bug: 234419032
Test: make SettingsRoboTests
Change-Id: Ib5b6cb0aacb570cb8d15b1bb9ac2d480356eda49
2022-07-19 16:27:14 +08:00
TreeHugger Robot
91aec69fdc [conflict] [conflict] Merge "Use Mockito 4.6.1 API" into tm-dev-plus-aosp am: ac6af411ed am: 326c0ea30c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19305127

Change-Id: I52547d10f0579fddb21091b641925910db17ef38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-18 22:39:07 +00:00
Simon Wingrove
ef498ef53d Distinguish multiple PendingIntents via requestCode am: 25686219d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19289844

Change-Id: Id8509feac060578cf8d7ffb4d7a7b9def221f029
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 19:19:15 +00:00
Menghan Li
7fa6e7df05 Merge "Refactor AccessibilityControlTimeoutPreferenceFragment to improve maintainability" 2022-07-18 13:52:29 +00:00
Simon Wingrove
25686219d3 Distinguish multiple PendingIntents via requestCode
Settings uses a system of intent extras to open subsettings pages. When
PendingIntents are created from these Intents, the system does not think
they are unique as extras are not included in this equality check. So
only one of them is likely to work.

A unique request code can be used to distinguish between them.

Bug: 238605613
Test: atest LockScreenSafetySourceTest
Merged-In: Ia59197eeb86e988d9ffbb86caff4bbda7b30f059
Change-Id: Ia59197eeb86e988d9ffbb86caff4bbda7b30f059
(cherry picked from commit f2b0cedcd0)
2022-07-18 11:18:28 +00:00
Simon Wingrove
3db36eb530 Merge "Distinguish multiple PendingIntents via requestCode" 2022-07-18 11:13:42 +00:00
menghanli
236a376211 Refactor AccessibilityControlTimeoutPreferenceFragment to improve maintainability
Root cause: There is a bunch of different logic of preferences in AccessibilityControlTimeoutPreferenceFragment. It’s hard to implement new features and hard to maintain and hard to be testable.
Solution: Move out logic of AccessibilityControlTimeoutPreferenceFragment into controllers to reduce the complexity of the relationship between preference and fragment.

Bug: 197695932
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility
Change-Id: I22e6e3b9e2f199ac1721fc069690321ad5f7a0d4
2022-07-18 15:50:52 +08:00
Zaiyue Xue
24bc269ec1 Refactor BatteryChartView X-axis labels. Instead of
only timestamps, also support any string[] labels.

Bug: 236101166
Test: manual
Change-Id: I84763ccce0ee63da0b5b26e1416bf5bd5b58963d
2022-07-18 14:25:24 +08:00
TreeHugger Robot
326c0ea30c [conflict] Merge "Use Mockito 4.6.1 API" into tm-dev-plus-aosp am: ac6af411ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19291449

Change-Id: Ifce8e49a098d2e745f15348eb2d318d347366e31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-16 09:09:57 +00:00
Sorin Basca
b9503775c0 Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
(cherry picked from commit 61e0bcd194)
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-16 07:57:52 +01:00
Sorin Basca
61e0bcd194 Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
(cherry picked from commit c1c3a84fdc)
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-15 20:05:37 +00:00
Menghan Li
95c771c02f Merge changes Ia52cd272,Ie8acdcb8
* changes:
  Refactor CaptionAppearanceFragment to improve maintainability (2/n)
  Refactor CaptionAppearanceFragment to improve maintainability (1/n)
2022-07-15 11:47:37 +00:00
TreeHugger Robot
9adbde0a8f Merge "Check portal on fingerprint intro page" into tm-qpr-dev am: 9fcf073bab am: f14704504b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19267972

Change-Id: I48a8397229e527254c7b96c7cd60ae9be46c6837
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 00:54:23 +00:00
TreeHugger Robot
f14704504b Merge "Check portal on fingerprint intro page" into tm-qpr-dev am: 9fcf073bab
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19267972

Change-Id: I738b4d76e633f359cdaedc4fee43f0975c60e7e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 00:33:48 +00:00
TreeHugger Robot
9fcf073bab Merge "Check portal on fingerprint intro page" into tm-qpr-dev 2022-07-15 00:08:59 +00:00
menghanli
3a591f9a34 Refactor CaptionAppearanceFragment to improve maintainability (2/n)
Root cause: There is a bunch of different logic of preferences in CaptionAppearanceFragment. It’s hard to implement new features and hard to maintain and hard to be testable.
Solution: Move out font size and type face preference logic of CaptionAppearanceFragment into controllers to reduce the complexity of the relationship between preference and fragment.

Bug: 197695932
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility
Change-Id: Ia52cd272495d49a772c981f51e190ff7d29ee14f
2022-07-15 06:55:54 +08:00
menghanli
591e44bb99 Refactor CaptionAppearanceFragment to improve maintainability (1/n)
Root cause: There is a bunch of different logic of preferences in CaptionAppearanceFragment. It’s hard to implement new features and hard to maintain and hard to be testable.
Solution: Move out preview preference logic of CaptionAppearanceFragment into controllers to reduce the complexity of the relationship between preference and fragment.

Bug: 197695932
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility
Change-Id: Ie8acdcb8659606ce3faf6d5532cc73ee19024725
2022-07-14 16:55:08 +08:00
Milton Wu
bd966754ce Check portal on fingerprint intro page
Check SUW portal flag on Fingerprint introduction page. Do not use
suw_max_fingerprints_enrollable as fingerprint count if portal flag is
enable.

Bug: 235655422
Test: m RunSettingsRoboTests \
      ROBOTEST_FILTER=FingerprintEnrollIntroductionTest
Test: Manually test "Add another finger" on Deferred and Portal
      suggested actions page
Change-Id: I2789d95fb214b5da6d8d03ef77583d064652e69e
2022-07-14 05:28:46 +00:00
Kuan Wang
66e146706d Use Mockito 4.6.1 API for BatteryChartPreferenceControllerV2Test
Fix the build breakage.

Bug: 238962112
Test: make RunSettingsRoboTests
Change-Id: Ib85c8dc8e68b1f622dbd37dca5e79484f7cac47f
2022-07-14 04:15:03 +00:00
Kuan Wang
3d2e5a2447 Duplicate BatteryChartPreferenceController and BatteryChartView into new
files for better diff review purpose

Bug: 236101687
Test: make RunSettingsRoboTests
Change-Id: I2d29bbfe14bcc5df7c09bceec2cbb0673685f522
2022-07-14 02:35:55 +00:00
Sorin Basca
61fdd86ec2 Merge "Use Mockito 4.6.1 API" 2022-07-13 14:33:28 +00:00
Jason Hsu
1059b2d3c4 Merge "Fix test case fail in HearingAidUtilsTest" 2022-07-13 07:40:18 +00:00
Sorin Basca
c1c3a84fdc Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
2022-07-13 06:39:26 +01:00
Jason Hsu
20f06012f6 Merge changes Ib9cb9b6d,I85209170
* changes:
  Change updatePreferenceOrder() to onCreateView()
  Migrate to DashboardFragment in ToggleFeaturePreferenceFragment
2022-07-13 04:32:22 +00:00
jasonwshsu
86c95fc7ab Fix test case fail in HearingAidUtilsTest
Root Cause: Only happen when running `make RunSettingsRoboTests` not
happen when running `make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtilsTest`. It is dependency test case fail when other tests also have AlertDialog pop up alerady.

Solution: Move ShadowAlertDialog reset before running each test, not after running each test.

Bug: 238829557
Test: make RunSettingsRoboTests
Change-Id: I32da4ee87580b4f475556905f7574b211a69b29b
2022-07-13 12:30:01 +08:00
Chaohui Wang
80a11a251e Remove the redundant constructor of SuggestionFeatureProviderImpl
Fix: 175167313
Test: robotest
Change-Id: I7ebbaf92398a8300971d592e2ee7a6e0d82c1d2f
2022-07-13 03:44:26 +00:00
Menghan Li
ae9d768549 Merge "Add SearchIndexable to improve search coverage" 2022-07-12 22:52:12 +00:00
TreeHugger Robot
0931e3895c Merge "Support multi-user privacy for battery usage chart" into tm-qpr-dev am: fedab69c9a am: a51b1baeaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19235726

Change-Id: Ib9c678e1bcb7dcc562301a1f039f20eb7d3caccd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 17:22:43 +00:00
TreeHugger Robot
a51b1baeaa Merge "Support multi-user privacy for battery usage chart" into tm-qpr-dev am: fedab69c9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19235726

Change-Id: I2d241c16e537f0131a95f70528dd47c75791f0ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 16:54:06 +00:00
jasonwshsu
8145631ab8 Migrate to DashboardFragment in ToggleFeaturePreferenceFragment
Root Cause: ToggleFeaturePrefreferenceFragment becomes heavy when more and more features come in.

Solution: Mirgrate to DashboardFragment, a plugin-style preference controllers, can help us separate the preference and its logic into its own controller.

* This is the first step for the whole migration. Change to extend DashboardFragment and fill up the missing override functions.
* Reorder fields and functions to the recommended general approach.

Bug: 171272809
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.accessibility

Change-Id: I852091700a4b3b3c7bbdbc82f0b5dc47c087d61c
2022-07-13 00:40:55 +08:00
TreeHugger Robot
fedab69c9a Merge "Support multi-user privacy for battery usage chart" into tm-qpr-dev 2022-07-12 16:40:32 +00:00
Menghan Li
c825a0bdc9 Merge "Remove obsoleted code: DividerAllowedBelowPreference" 2022-07-12 13:01:50 +00:00
Simon Wingrove
f2b0cedcd0 Distinguish multiple PendingIntents via requestCode
Settings uses a system of intent extras to open subsettings pages. When
PendingIntents are created from these Intents, the system does not think
they are unique as extras are not included in this equality check. So
only one of them is likely to work.

A unique request code can be used to distinguish between them.

Bug: 238605613
Test: atest LockScreenSafetySourceTest
Change-Id: Ia59197eeb86e988d9ffbb86caff4bbda7b30f059
2022-07-12 09:55:59 +00:00
Menghan Li
32a24032e8 Merge "Remove obsoleted code: DividerSwitchPreference" 2022-07-12 06:18:28 +00:00
Amy Hsu
a067fba01f Merge "[RRS] Activate investigation of screen_resolution in settingsstats" into tm-d1-dev am: 1f7fab03c8 am: f51951c9d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19124855

Change-Id: If81fa8f115b89eb458b02736276940d8148458e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 04:47:15 +00:00
Amy Hsu
ef540c685d Merge "[RRS] Activate investigation of screen_resolution in settingsstats" into tm-d1-dev am: 1f7fab03c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19124855

Change-Id: I7f6bf6ad05de82ad77ced5bd776c3602f4057290
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 04:15:31 +00:00
Amy Hsu
f51951c9d3 Merge "[RRS] Activate investigation of screen_resolution in settingsstats" into tm-d1-dev am: 1f7fab03c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19124855

Change-Id: Ie9b806a127e7eced1b9d790beb874e712e452de5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 04:15:21 +00:00
Amy Hsu
1f7fab03c8 Merge "[RRS] Activate investigation of screen_resolution in settingsstats" into tm-d1-dev 2022-07-12 03:54:27 +00:00
menghanli
5209a10e9f Remove obsoleted code: DividerAllowedBelowPreference
Settings don't show divider in material design. The DividerAllowedBelowPreference is not used now.

Bug: 197695932
Test: make RunSettingsRoboTest
Change-Id: Id2b28f76c4ed8c429594bf786690499fb3f2503a
2022-07-12 11:28:11 +08:00
menghanli
ab6cbea3fd Remove obsoleted code: DividerSwitchPreference
Settings don't show divider in material design. The DividerSwitchPreference is not used now.

Bug: 197695932
Test: make RunSettingsRoboTest
Change-Id: I3fef9401b5c4a3e7d4ca6fc966f3e60c57558cdd
2022-07-12 11:23:55 +08:00
menghanli
6c85a215de Add SearchIndexable to improve search coverage
- Add searachIndex test
- Increase accessibility framework feature fragment coverage

Bug: 197695932
Test: make RunSettingsRoboTests
Change-Id: Icb7e2cf70bb0443304af7866efd48bed1d9af5bf
2022-07-12 10:51:59 +08:00
Amy Hsu
c9bf3e88e7 Merge "[RRS] Activate investigation of screen_resolution in settingsstats" 2022-07-12 01:51:06 +00:00
Hugh Chen
e88be4859c RESTRICT AUTOMERGE Make VPN by Google One always appear in VPN settings am: f5166f46e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18753589

Change-Id: Ida6c1387588887b78f33de9f655b5397d04c4258
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-12 00:00:14 +00:00
Robert Luo
bc66c0aba9 Merge "RESTRICT AUTOMERGE Make VPN by Google One always appear in VPN settings" into tm-qpr-dev 2022-07-11 23:36:02 +00:00
Hugh Chen
95d2add6a2 RESTRICT AUTOMERGE Implement advanced vpn ui in vpn settings am: 858e6ff3d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18753588

Change-Id: I6ba14905e50fb1fad3036cd91a8d2c9ceac2621e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-11 23:09:47 +00:00
TreeHugger Robot
f38e8e6194 Merge "RESTRICT AUTOMERGE Implement advanced vpn ui in vpn settings" into tm-qpr-dev 2022-07-11 22:50:58 +00:00
ykhung
764d513d00 Support multi-user privacy for battery usage chart
When there are multiple accounts in the devices, the battery usage list
is shared in the current design. We will aggregate other users usage
data into a single item to support multi-user privacy requirements

Screenshot: https://screenshot.googleplex.com/AkFTUtNvnoxcuGR

Bug: 202119550
Test: make RunSettingsRoboTests
Change-Id: I6cb55f0d50a4caca83212a0a54410530a032c089
2022-07-12 00:17:43 +08:00