Commit Graph

44351 Commits

Author SHA1 Message Date
TreeHugger Robot
ef289f99b5 Merge "Refactor Battery Chart View State Controll" 2022-07-20 13:34:35 +00:00
Zaiyue Xue
d4f9588a3d Refactor Battery Chart View State Controll
When users click the battery chart, the orignal behavior is that the view changes the state by itself.
This cl refactors the bahavior to that the view callbacks to the controller, and
the controller changes the view's state.
In this way, the controller is the only source of truth of the state.
This meets the controller-view model.

Test: manual
Bug: 239491373, 236101166
Change-Id: I754ded2dba20319f1571374dfdbef27f2420ed78
2022-07-20 09:38:23 +00:00
TreeHugger Robot
1489a54577 Merge "Update all preferences when the account preference updates UI" into tm-qpr-dev am: 6e14ff02e8 am: b47e7b4248
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19192851

Change-Id: I7772126785874bfa190e70003221c5a8a9e39ec5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-20 03:07:12 +00:00
TreeHugger Robot
b47e7b4248 Merge "Update all preferences when the account preference updates UI" into tm-qpr-dev am: 6e14ff02e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19192851

Change-Id: I832dcbc2fa78a81f9d64169d80cdc5a9aed5df4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-20 02:48:33 +00:00
TreeHugger Robot
6e14ff02e8 Merge "Update all preferences when the account preference updates UI" into tm-qpr-dev 2022-07-20 02:22:44 +00:00
TreeHugger Robot
42c02ad936 Merge "Prevent leaking Wi-Fi dialog on lock screen" into tm-qpr-dev am: bd41fe5a5b am: 3d6b632232
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19207636

Change-Id: I66292ce19a0616253ec8f23a185d34aa7a03a977
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 20:24:42 +00:00
Treehugger Robot
de39a970c5 Merge "Fix incorrect storage calculation when SD card is inserted" am: e705fcd7c3 am: 2a0a88af4d am: dad4720a31 am: cb4de95600 am: 3ce3686836
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2147780

Change-Id: Id8a56f0aceb2710d4ce2c0445b233f3f808185b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 20:09:02 +00:00
TreeHugger Robot
f7f800793c Merge "Add class BatteryDiffData used to parcel battery usage data" 2022-07-19 18:01:45 +00:00
TreeHugger Robot
3d6b632232 Merge "Prevent leaking Wi-Fi dialog on lock screen" into tm-qpr-dev am: bd41fe5a5b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19207636

Change-Id: I8ea19a4c48286a2185450116f06a3314087c5be8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 17:21:39 +00:00
TreeHugger Robot
bd41fe5a5b Merge "Prevent leaking Wi-Fi dialog on lock screen" into tm-qpr-dev 2022-07-19 17:02:10 +00:00
Kuan Wang
5c98e155c2 Add class BatteryDiffData used to parcel battery usage data
Add class BatteryDiffData used to parcel battery usage diff data per
apps. It behaves as an interface between UI and data.

Bug: 236101687
Test: make RunSettingsRoboTests
Change-Id: I59daa9e8c5de2105ebf24c7a585c02e554735e78
2022-07-19 15:47:51 +00:00
TreeHugger Robot
e18e92699e Merge "In BatteryChartViewV2, use levels.length-1 to replace mTrapezoidCount. So the chartview could show any number of slots as the given levels length-1." 2022-07-19 10:57:05 +00:00
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
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
Treehugger Robot
3ce3686836 Merge "Fix incorrect storage calculation when SD card is inserted" am: e705fcd7c3 am: 2a0a88af4d am: dad4720a31 am: cb4de95600
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2147780

Change-Id: I1bf71a120f7db3f388a5e279a7e13ece80eef571
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-19 01:06:43 +00:00
Treehugger Robot
cb4de95600 Merge "Fix incorrect storage calculation when SD card is inserted" am: e705fcd7c3 am: 2a0a88af4d am: dad4720a31
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2147780

Change-Id: Ia8f4762a938a8b4dc2b8ac503b42792cc3cd882a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 20:43:47 +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
dad4720a31 Merge "Fix incorrect storage calculation when SD card is inserted" am: e705fcd7c3 am: 2a0a88af4d
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2147780

Change-Id: Iaa69c78ca9535382935688f7d9b41724c3f179ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-16 03:21:01 +00:00
Treehugger Robot
2a0a88af4d Merge "Fix incorrect storage calculation when SD card is inserted" am: e705fcd7c3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2147780

Change-Id: I6ba5b7c40e87df6c231e0c774913b1320c9c3996
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-16 02:51:11 +00:00
Treehugger Robot
e705fcd7c3 Merge "Fix incorrect storage calculation when SD card is inserted" 2022-07-16 02:35:19 +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
8f36fb7fda Merge "[Le Audio] Use the ThemeResolver instead of setTheme() to avoid the theme res may be updated in the future and we need to update it manually." 2022-07-15 10:31:08 +00:00
Zoey Chen
5e9a00f72f [Le Audio] Use the ThemeResolver instead of setTheme() to avoid the theme res may be updated in the future and we need to update it manually.
Bug: 238841204
Test: manual
Change-Id: I3801f23244f6f54b6147390edccf026da1f0f9c6
2022-07-15 06:56:36 +00:00
TreeHugger Robot
0936f72020 Merge "Save isCanceled state and restore when rotation" into tm-qpr-dev am: 3028e52501 am: 3928fcabab
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19267966

Change-Id: Ic6dc3e346111fa03331e1ad3509b106a6672a9d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 05:54:47 +00:00
TreeHugger Robot
3928fcabab Merge "Save isCanceled state and restore when rotation" into tm-qpr-dev am: 3028e52501
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19267966

Change-Id: I6072236085c1feec6588d8b06931517086f32d48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 05:21:45 +00:00
TreeHugger Robot
3028e52501 Merge "Save isCanceled state and restore when rotation" into tm-qpr-dev 2022-07-15 05:03:40 +00:00
Wesley Wang
1c3cbc9c24 Merge "Add dock charging state into stay awake feature (1/2)" 2022-07-15 02:55:30 +00:00
TreeHugger Robot
dc6fc8711c Merge "Run lock before fingerprint enroll" into tm-qpr-dev am: e49a84480b am: 14f791bf73
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19260206

Change-Id: I30a019887d77c29f88e97c83cb25327910558aba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 00:55:20 +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
14f791bf73 Merge "Run lock before fingerprint enroll" into tm-qpr-dev am: e49a84480b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19260206

Change-Id: I72fbe236492e87c7b6d23c0de36c8dd307f035e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 00:43:02 +00:00
TreeHugger Robot
e49a84480b Merge "Run lock before fingerprint enroll" into tm-qpr-dev 2022-07-15 00:37:04 +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
lbill
d7f53d4180 Save isCanceled state and restore when rotation
- Create mIsCanceled field in FingerprintEnrollEnrolling
- Override onSaveInstanceState and save mIsCanceled state
- onCreate restore mIsCanceled
- shouldStartAutomatically() return mRestoring && !mIsCanceled
- Integrate FingerprintErrorDialog with "try again"-> Clear mIsCanceled

Bug: 237103873
Test: manual enroll UDFPS, and wait for timeout, seeing timeout error
dialog showing above fingerprint enrollment pad.

Change-Id: I3a3010ca12aa0b23fd122a8afc9b82adf5656fb8
2022-07-15 08:14:53 +08: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
Nate Myren
22e23bf4e5 Remove location toggle from privacy controls screen am: d18f11a84f am: b055df3b8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19281813

Change-Id: I501b834e2fff7655a94eb32e0d1d552ed8709774
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 21:11:05 +00:00
Nate Myren
b055df3b8c Remove location toggle from privacy controls screen am: d18f11a84f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19281813

Change-Id: I7b2286f4cfbb022ea6cdfffa9ef1b42da6a05062
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-14 20:52:30 +00:00
Zoey Chen
a3ba183165 [Settings] Add NPE protection for the bundle
Bug: 238980691
Change-Id: I0f5e79ab83701552bc92b07ebdc0ee90b700721f
Test: atest EnabledNetworkModePreferenceControllerTest
2022-07-14 11:10:51 +00:00
TreeHugger Robot
501cc9837a Merge "Add class BatteryLevelData used to parcel the battery timestamps and levels. It behaves as an interface between UI and data." 2022-07-14 10:30:00 +00: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
504a659ba5 Run lock before fingerprint enroll
Run setOrConfirmCredentialsNow() before enrolling fingerprint for
fingerprint-only device.

Bug: 237433373
Test: atest BiometricEnrollActivityTest
Test: Manually test SUW flows for fingerprint-only device
      1. check confirm pin case
      2. check choose pin case
      3. enable always_finish_activities, check confirm pin case
      4. enable always_finish_activities, check choose pin case
Change-Id: I68da429145835fc79f83f3292749088dc25fdeee
2022-07-14 08:40:45 +00:00
Kuan Wang
d2fcbf4120 Add class BatteryLevelData used to parcel the battery timestamps and
levels. It behaves as an interface between UI and data.

Bug: 236101687
Test: make RunSettingsRoboTests
Change-Id: I4f79165125254ce1372abf1a207411a183aabb23
2022-07-14 16:34:42 +08:00
Zoey Chen
44bc703bf2 [Settings] Add NPE protection for the bundle
Bug: 238980691
Test: atest MobileNetworkIntentConverterTest
Change-Id: I39d0f86725f6b0ef477425fb901bb274f31c6d78
2022-07-14 08:32:02 +00: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
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