Commit Graph

11 Commits

Author SHA1 Message Date
Edgar Wang
fdab44f9e7 Refactor Date & Time Settings
- Rid off AbstractPreferenceController

Test: robotest
Bug: 235445309
Change-Id: I61118a0ff580231973509c06e84e7088dba897f5
2023-11-29 18:35:43 +08:00
Edgar Wang
292f407071 Fix robo test case failed
Bug: 300134365
Test: robotest
Change-Id: I144fbbc962a479c97312cee1645c5a3d70351542
2023-09-26 15:49:40 +08:00
Neil Fuller
579a19a793 Switch auto time setting to use APIs
Switch auto time setting to use TimeManager APIs instead of low-level
direct settings access.

This makes the AutoTimePreferenceController approach the same as
AutoTimeZonePreferenceController. Most of the logic about what to
display and whether toggles are enabled is moved to the service.

This change has the side effect of adding support in SettingsUI for
devices with no auto time detection mechanism configured at all, i.e.
the auto time toggle will stop being shown in SettingsUI. There are no
known devices that require this currently, but it is a theoretical
possibility if config.xml is configured in particular ways.

Bug: 172891783
Test: Manual testing with different settings for "time origin
priorities" (i.e. empty, non-empty)
Test: m ROBOTEST_FILTER=com.android.settings.datetime RunSettingsRoboTests -j40

Change-Id: I4112fb51adb0d06a1dbc39a44ea109d6df899153
2022-06-06 12:41:11 +01:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
jeffreyhuang
5e98d62c19 Move datetime package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I0b93682625e15a6306f5fbd3409d4a4003beb805
2017-11-27 17:05:06 -08:00
yuemingw
7b1da61346 Block settings when DISALLOW_CONFIG_DATE_TIME.
Test: m -j RunSettingsRoboTests
runtest -x packages/apps/Settings/tests/unit/src/com/android/settings/core/UserRestrictionTest.java

Fix: 67497909

After turn on the user restriction in TestDPC:
https://hsv.googleplex.com/5414119658225664
The date time settings page become:
https://hsv.googleplex.com/5199302573948928


Change-Id: I42590c4a505ec1b6ffa86eb460b90fa6ec8ba783
2017-11-22 19:53:18 +00:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -07:00
Fan Zhang
beddff82b0 Move date/time prefs to PreferenceController and add tests.
Bug: 32996243
Test: RunSettingsRoboTests
Change-Id: Ie537bbcc35a96a63251e46f84b57c0a861b9d013
2016-11-21 16:42:14 -08:00