Commit Graph

15969 Commits

Author SHA1 Message Date
Chaohui Wang
71e03076cd Merge "Fix flicker for Mobile data & Wi-Fi page" into tm-dev 2022-04-29 08:26:24 +00:00
Calvin Pan
8ad2642b5f Merge "Add unit test for AppLocalePickerActivity" into tm-dev 2022-04-29 03:56:56 +00:00
Prabal Singh
9a8f44227e Merge "Remove extra argument WorkPolicyUtil constructor" into tm-dev 2022-04-28 17:12:28 +00:00
Chaohui Wang
ddedb31f6e Fix flicker for Mobile data & Wi-Fi page
Both "Mobile data usage" & "Non-carrier data usage".

By,
1. Add header in onCreate() instead of onViewCreated()
2. Keep the space for Spinner, and preload initial cycles
3. Keep the space for 3 usage summaries

Bug: 191730864
Test: manual
Change-Id: I8c309c5f51ce6290383a2d10f75e41d0f207d61a
2022-04-28 23:00:57 +08:00
Prabal Singh
3e2d7f4581 Remove extra argument WorkPolicyUtil constructor
Only constructor is required for WorkPolicyInfo constructor. The other
dependencies can be derives

Test: make ROBOTEST_FILTER=EnterprisePrivacyFeatureProviderImplTest RunSettingsRoboTests -j40
Change-Id: I7f35e5ed344d452190b333aad7fa823a010d17b3
2022-04-28 15:21:18 +01:00
Calvin Pan
049aa73cb1 Add unit test for AppLocalePickerActivity
Bug: 223503670
Test: atest
Change-Id: I0e92be43d661dd3bff19c3274d1572ef1f4e9c46
2022-04-28 08:15:34 +00:00
PETER LIANG
27aa5f9d94 Merge "Logging for the feature "Text and reading options" in Android T." into tm-dev 2022-04-28 06:45:11 +00:00
Xinyi Zhou
3438e20da1 Delete Fast Pair Settings
Fast Pair will not be launched in T.

Test: -m
Fix: 228614515
Fix: 229356812
Change-Id: I173453e84f0d1b525ea4796ed875f53f30c20d96
2022-04-27 12:29:59 -07:00
Bonian Chen
43cf210f90 Merge "[Settings] Fix flaky presubmit failure" into tm-dev 2022-04-27 16:23:09 +00:00
Yuri Lin
29c62e7873 Merge "Fix ZenModeScheduleRuleSettingsTest to test onAttach" into tm-dev 2022-04-27 16:08:55 +00:00
Bonian Chen
68981a3004 [Settings] Fix flaky presubmit failure
Bug: 229689535
Test: unit test
Change-Id: Iabea21aa5d7dd9e489b7b5839c8fcc32c9ba979c
2022-04-27 15:58:06 +00:00
Bonian Chen
b92156c03e Merge "Revert "[Settings] Code refactor for BroadcastReceiver under Lifecycle"" into tm-dev 2022-04-27 15:57:30 +00:00
Lais Andrade
9c8d1e94fb Merge "Create separate On/Off string resources for Vibration & haptics" into tm-dev 2022-04-27 13:54:13 +00:00
Weng Su
b6629ab55b Merge "Check Wi-Fi permissions for QrCode scanner" into tm-dev 2022-04-27 09:33:26 +00:00
Peter_Liang
fcce62aa77 Logging for the feature "Text and reading options" in Android T.
Logging for the status of five features “Font size”, “Display size”, “Bold Text”, “High contrast text”, and “Reset” in the “Display size and text” page.

Bug: 222661478
Test: manual test
Change-Id: I33060fca860e02ddac7716275e8682e70fbaff1f
2022-04-27 15:25:30 +08:00
TreeHugger Robot
c28169adb9 Merge "Revert "[Settings] Code refactor for combining TelephonyCallback with Lifecycle"" into tm-dev 2022-04-27 05:56:10 +00:00
Bonian Chen
8789731cde Revert "[Settings] Code refactor for BroadcastReceiver under Lifecycle"
This reverts commit 81d230b250.

Reason for revert: merge failure in other branches

Change-Id: If8661f5f321f22df96aab54eb8ba967c232348ac
2022-04-27 05:13:30 +00:00
Bonian Chen
3bddc056d8 Revert "[Settings] Code refactor for combining TelephonyCallback with Lifecycle"
This reverts commit aeac0619df.

Reason for revert: merge failure in other branches

Change-Id: I601e674be41fc5d4c97bd8db54ab1982377455f1
2022-04-27 00:03:20 +00:00
Yuri Lin
e540c8165d Fix ZenModeScheduleRuleSettingsTest to test onAttach
this follows the model of the change to ZenModeEventRuleSettingsTest in ag/17607148

Fixes: 215062934
Test: settings robotests
Change-Id: I44abec9316f78be318b51ba541d20b863eb86c8d
2022-04-26 14:23:06 -04:00
Bonian Chen
73c8e2f45a Merge "[Settings] Code refactor for BroadcastReceiver under Lifecycle" into tm-dev 2022-04-26 10:25:31 +00:00
Bonian Chen
3fc05a917e Merge "[Settings] Code refactor for combining TelephonyCallback with Lifecycle" into tm-dev 2022-04-26 10:25:02 +00:00
Weng Su
71b9cc0e32 Check Wi-Fi permissions for QrCode scanner
- Launched package require ACCESS_WIFI_STATE and ACCESS_FINE_LOCATION permissions to get results

Bug: 187176859
Test: manual test
make RunSettingsRoboTests \
    ROBOTEST_FILTER=WifiDppQrCodeScannerFragmentTest

Change-Id: Ie80c4e5b3a5863749de518e4736873390478816e
2022-04-26 07:10:57 +00:00
Chaohui Wang
1a39660de0 Merge "Update Personal / work selection UI." into tm-dev 2022-04-26 06:34:37 +00:00
Lais Andrade
cc8790f7b3 Create separate On/Off string resources for Vibration & haptics
Some translators need to be able to adapt the text for On/Off preference
state to match the preference title "Vibration & haptics", which
requires a different inflection and plural form on some languages.

This change separates this resource string from the more generic one
that was used before to allow this flexible translation.

Fix: 228342641
Fix: 229060423
Test: VibrationPreferenceControllerTest
Change-Id: Ib46b3e0d0a980ff57e91f55c73348c440327bad7
2022-04-25 17:15:39 +01:00
Chaohui Wang
f250493787 Update Personal / work selection UI.
Implement the new-look by using AlertDialog's
custom title and custom view.
Using the RecyclerView so we can display profile
horizontally.

Bug: 174626616
Test: manual & robolectric
Change-Id: I9f5a7685d9217fc62e01799ad73f9b9a3ddbf19a
2022-04-25 19:12:38 +08:00
SongFerng Wang
564c88485a Merge "Gray out the network mode UI before the carrier config is ready" into tm-dev 2022-04-25 07:40:43 +00:00
Prabal Singh
67007e5933 Use settingslib util methods for work policy info
Bug: b/229889270
Test: make ROBOTEST_FILTER=EnterprisePrivacyFeatureProviderImplTest RunSettingsRoboTests -j40
Change-Id: I0d968732a4dd601955e18b2ebb2af365638b450f
2022-04-23 20:35:41 +01:00
SongFerngWang
b76feffe4f Gray out the network mode UI before the carrier config is ready
Bug: 202167671
Test: atest EnabledNetworkModePreferenceControllerTest
Change-Id: Ib502ac19ea2c19dae95025302dd82aa2b1c7ff88
2022-04-22 19:28:13 +08:00
Bonian Chen
aeac0619df [Settings] Code refactor for combining TelephonyCallback with Lifecycle
This is a helper class which may support monitoring the
TelephonyCallback under the condition of Lifecycle state STARTED or
RESUMED.

Bug: 229689535
Test: unit test
Change-Id: I6d26bee604d9559e207e107b2f26583f700f8e0a
(cherry picked from commit 7c5259efad)
2022-04-22 10:39:04 +00:00
TreeHugger Robot
49cc66afd3 Merge "[Settings] Code refactor for async Lifecycle listening" into tm-dev 2022-04-22 05:50:05 +00:00
Bonian Chen
81d230b250 [Settings] Code refactor for BroadcastReceiver under Lifecycle
This is an implementation of BroadcastReceiver which supported by
LifecycleCallbackConverter.
Registration of BroadcastReceiver only take place when Lifecycle in
RESUME status.

Bug: 229689535
Test: unit test
Change-Id: Ia2af82d5cbb391034627e5259a9e0c8683a0c5a1
(cherry picked from commit c2030898ef)
2022-04-20 16:54:41 +00:00
Bonian Chen
3856ac4be9 [Settings] Code refactor for async Lifecycle listening
This is an extension of LifecycleCallbackAdapter.
A postResult(T) and a Consumer<T> is designed for supporting pass result
back to UI thread, and is invoked only when required.

Bug: 229689535
Test: unit test
Change-Id: I0ef5afc31cd23aa865a2dd1d05f9b212242c2e41
(cherry picked from commit 5d2a76cbb4)
2022-04-20 12:47:39 +00:00
Bonian Chen
37a326bd3e [Settings] Code refactor for Lifecycle listening
This is an abstract class for building a set of callback behavior
based on Lifecycle status change.

Through extending this class, the implemented methods are invoked
only when required.

Bug: 229689535
Test: unit test
Change-Id: I7534393546f821738a63ebde121a5a88ee03b23b
(cherry picked from commit 9a4c66d23b)
2022-04-20 12:46:26 +00:00
Peter_Liang
b833fe1bad Should popup the confirmation toast after clicking the reset button.
Goal: Users may not notice what the change after resetting all settings configs in the Text and reading options. So we will use the toast to give nice feedback for them.

Fix: 220126995
Test: make RunSettingsRoboTests  ROBOTEST_FILTER=TextReadingPreferenceFragmentTest
Change-Id: Ife42b0c9d8a0241d7b8c3e5dbe7f9f1e2a6d759a
2022-04-20 15:39:11 +08:00
Arc Wang
96491e1ea9 Merge "Fix ManageStoragePreferenceController always consume click event" into tm-dev 2022-04-20 00:54:15 +00:00
TreeHugger Robot
07950adad9 Merge "Update auto-rotate strings/toggles for better accessibility" into tm-dev 2022-04-19 23:44:38 +00:00
Abel Tesfaye
238b2cc721 Update auto-rotate strings/toggles for better accessibility
This change will update some strings for smart-auto-rotate and replace
the activity based switchbar with SettingsMainSwitchPreference. The
switchbar had to be replaced to allow the new text to appear above the main toggle.

Test: locally with flame and with resolver service enabled & disabled

Bug: 220182618
Change-Id: I4b60bf006bdde9e47b33a52c7719ec770caf5746
Merged-In: I4b60bf006bdde9e47b33a52c7719ec770caf5746
2022-04-19 21:21:34 +00:00
Arc Wang
ea4260c0e7 Fix ManageStoragePreferenceController always consume click event
ManageStoragePreferenceController should only consume click
event when its preference key matches the key of the clicked
preference.

Bug: 228970667
Test: atest ManageStoragePreferenceControllerTest
Change-Id: Ia6c62cf457fc4cadc27dc160dbd9b04ec3392d68
2022-04-19 17:35:05 +08:00
Tsung-Mao Fang
ccb8855b98 Merge "Do not expose wifi slice when no permission" into tm-dev 2022-04-19 08:12:37 +00:00
Tsung-Mao Fang
821608c5be Do not expose wifi slice when no permission
Prior to this cl, slice provider always exposes wifi slice
to calling package without confirming any wifi permissions.

For current solution, we will check calling package's permission state
and decide whether slice provider should expose wifi slice or not.

Because settings search is a part of settings app,
this permission checker won't be applied to settings intelligence.

Test: manual, robotest, cts
Also run manul
Bug: 178014725

Change-Id: I2770b5b43366a5aa65c7519efc4243d350a21b26
2022-04-19 08:07:35 +00:00
TreeHugger Robot
fbaa9f3faa Merge "Fix transparency seekbar is enabled while fade feature is disabled." into tm-dev 2022-04-19 07:52:35 +00:00
TreeHugger Robot
b1bdc42d52 Merge "Read CarrierConfig to get operator name" into tm-dev 2022-04-19 02:08:35 +00:00
menghanli
7ae0b641dd Fix transparency seekbar is enabled while fade feature is disabled.
Root cause: Show default status until setting key changed. It does not
show latest status when created.
Solution: Update the status when created.

Bug: 229566130
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FloatingMenuTransparencyPreferenceControllerTest
Change-Id: Ia25fe5cec0444c1771e8ce31aae2a4cb3b0405a1
2022-04-19 08:15:28 +08:00
Niklas Lindgren
8bc83ef615 Read CarrierConfig to get operator name
Config if operator name should be in status bar is now read
from carrier config. For dual sim devices we use data sim.

Bug: 116847905
Test: Add item for carrier in vendor.xml and swap sim cards
between ones that have the item enabled and disabled. We have
also tested to swap data sim cards on dual sim device.
Test: m RunSettingsRoboTests ROBOTEST_FILTER="ShowOperatorNamePreferenceControllerTest"

Change-Id: I03311b96ee660aed80ec867b05aa0a34cfc15f54
2022-04-18 21:34:57 +00:00
Hugh Chen
aadc44ae26 Fix default usb settings will set wrong function when onPause()
Bug: 229200265
Test: make -j64 RunSettingsRoboTests
Change-Id: Ibee2d39af8b341d03117d96029446ddcd45921fe
2022-04-18 12:16:57 +00:00
ykhung
b593e00af0 Format BatteryEntry and BatteryDiffEntry class
Bug: N/A
Test: make RunSettingsRoboTests
Change-Id: I14e2ef4c455209e58edc5ccdbe064f469815cccd
2022-04-17 06:23:47 +00:00
Chaohui Wang
fbafdbdd8f Merge "Fix title clipped for "Custom settings for schedule"" into tm-dev 2022-04-14 23:22:19 +00:00
Quang Luong
93ae7acbf4 Merge "Use WifiEntry.getStandardString() for Wi-Fi Type summary" into tm-dev 2022-04-14 16:14:21 +00:00
Diego Vela
668aea9b55 Use androidx.window from prebuilt.
Use androidx.window prebuilt for consistency.

Bug: 223114509
Test: m -j

Change-Id: Ifeba7d0073ba7aeb6308c186738161c4857a97a3
2022-04-14 09:55:36 +00:00
TreeHugger Robot
55aba46fe9 Merge "Unchecked battery saver switch once it's 1st launch" into tm-dev 2022-04-13 11:15:46 +00:00