Commit Graph

35 Commits

Author SHA1 Message Date
Yi-Ling Chuang
2516848b30 Make some device info related slices public.
Only PreferenceControllers with isPublicSlice() set to true are exposed
to other apps. Others will be Settings only.

Bug: 141088937
Test: robotests
Change-Id: Id38fd0203a4efc812e30990491786b4d8aff8902
2019-11-28 14:38:30 +08:00
Tsung-Mao Fang
dee1548f61 Fix a few test cases
Test: robo test
Change-Id: Iba797f51169fffb377ccd3d5d5691c392b772537
Fix: 144664559
Fix: 144663625
Bug: 144664534
2019-11-18 16:37:50 +08:00
Fan Zhang
6dade8e430 Move "Build Number" slice to a different controller.
There are 2 build number tiles in settings: Android version -> Build
number and About phone -> build number.

The way we index breadcrumb for each slice is making some client
confused. So this change moves the slice capability from Androi
version>BuildNumber to About phone.

Fixes: 130652710
Test: reindex, robotest
Change-Id: I9054d0db124b706e7984cd3d19774bb604bd7fd3
2019-04-18 09:37:15 -07:00
Fan Zhang
e2eefcd163 Suppress search from one of the build number prefs.
And make the search-enabled one copyable.

Fixes: 127962713
Test: search
Change-Id: I0867ea8a376e3aac5e94cd70245833b516bb154d
2019-03-12 15:54:52 -07:00
Stanley Wang
118a712486 Implement the Copyable interface to BuildNumberPreferenceController
Fixes: 121233543
Test: manual and robotests
Change-Id: I4f424be6dfeb2c9fc9ac0bc11b38139f7d52b2b7
2018-12-21 10:57:45 +08:00
Jason Chiu
7aa7ece7a2 Fix build failed of Settings test cases while importing AndroidX
- API change in AndroidX Preference causes a build breakage
- Apply explicit casting for the new API interface

Test: robotest
Fixes: 121109361
Change-Id: If3e7be9e53c7860252523700d6721ae4956db68a
2018-12-17 16:46:42 +08: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
a6c7db1888 Update logging: switch a bunch of action() logging calls.
Use generic action(int, int, int, String, int) instead of
action(Context, int, string, Pair...) when possible.

Bug: 117860032
Test: robotests
Change-Id: I5213b52b2b10d80a3c488c37718df81b3b0a428f
2018-11-13 21:50:34 -08:00
Fan Zhang
cdf284b732 Make Settings robotest work with tot Robolectric
Bug: 116278591
Test: make -j RunSettingsRoboTests
Change-Id: I32cb2fcf6094675f79d2fc24702ef6298a9691e4
2018-10-31 17:59:17 -07: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
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
7431c91de6 Remove search indexing pipeline from Settings
Index is already handled by SettingsIntelligenec. No longer needed in
Settings.

Change-Id: Id43fb3100dc2759185744441cff8cb9cd2d2da20
Fixes: 69808376
Test: robotests
2018-06-21 09:38:36 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Christine Franks
4c3c7fbfa6 Allow developer options in retail mode
Also, add new tests and fix existing tests.

Bug: 70985064
Test: make -j100 && make RunSettingsRoboTests -j100
Change-Id: Ied84cf0de02e18c10949eed4f3642782c1246e7b
2018-03-20 16:32:50 -07: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
Fan Zhang
155d6829e9 Move restriction check for dev settings into controller
Change-Id: I99dae6e82aca40b92e1965ba7db2c54f3c59d33f
Fixes: 72815875
Test: robotests
2018-02-07 22:33:10 -08:00
Fan Zhang
4e08869e1a Make a strong reference to LifecycleOwner in tests
Change-Id: Id3b26ded6c903b67b9880dbfe1a0656a564c8947
Fixes: 71867776
Test: rerun tests
2018-01-11 14:30:16 -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
Fan Zhang
dff6dd687e Move away from deprecated FakeFeatureFactory.setupForTest()
Test: rerun
Change-Id: I896ba414315ddb1664c0499264f4992f0554ef98
2017-12-05 10:12:10 -08:00
jeffreyhuang
ae2af2e895 Move deviceinfo test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I8546a4503f84b169642f723e87f4a91cf4c99dd0
2017-11-28 13:06:39 -08:00
Tony Mantler
94a7c7d21c Convert SettingsLib Lifecycle to Flatfoot
Bug: 69257739
Test: m -j RunSettingsRoboTests
Change-Id: I27e7850c39afb9c09297007e8cc352f410665653
2017-11-14 11:04:40 -08:00
Tony Mantler
3d84d56336 Remove development settings prefs file
Move DevelopmentSettingsEnabler to SettingsLib

Bug: 64159590
Test: DevelopmentSettingsEnablerTest
Change-Id: Id609266019e05a3e06b4ee3bc10de9c019628a42
2017-07-31 14:01:09 -07:00
Fan Zhang
bac6458a22 Ignore clicks on developer switch UI during monkey test
Change-Id: I10c4771386bb38e117848da385090dec78e4a2f8
Fix: 63852950
Test: robotests
2017-07-20 16:44:28 +00:00
Fan Zhang
e6b7bc6f15 Fix alignment for build number preference in RTL.
- Fixed by adding BidiFormatter.unicodeWrap around the whole string.

Change-Id: I3ca1292d912062db8c2fead524cd84a19eb80cff
Fix: 63135900
Test: make RunSettingsRoboTests
2017-07-05 14:20:08 -07: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
Matthew Fritze
2078bc2358 Remove search2 package and put everything into search
Change-Id: Ie8651c79ef023f154cd7120a88a20f3481abce2b
Fixes: 38502743
Test: make RunSettingsRoboTests
2017-05-23 13:57:28 -07:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -07:00
Fan Zhang
11d2d68e23 Move developer options related class to development package
Bug: 34203528
Test: none, purely moving classes around
Change-Id: I3cd1d257f948729fda5c04632e7ce9114c40bd0c
2017-03-17 16:51:21 -07:00
Matthew Fritze
5c83cfa278 Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests
Bug: 35763944, 36192909
Change-Id:  If216e1eeb4c29e7372720c6228fa4e99ea2a9904
2017-03-17 14:26:05 -07:00
Fan Zhang
c1c708f979 Ensure DashboardFragment shares pref controlls with search
Test: make RunSettingsRoboTests
Change-Id: I48be270d9706539925d00874bae29d46406ac491
Fix: 35812240
2017-03-01 13:29:11 -08:00
Fan Zhang
b00811da64 Let fragment and indexProvider share prefControllers
Bug: 35812240
Test: make RunSettingsRoboTests
Change-Id: Ifd96f935836a52e0a56f170f3cdf9b9ddf7c499a
2017-03-01 12:56:58 -08:00
Fan Zhang
f42377a18e Log when build number preference is clicked.
Optionally also log whether user is in development mode.

Change-Id: I1f5dc2891b2c4fc74f940e3118fb09ee18cc9688
Fix: 34774945
Test: make RunSettingsRoboTests
2017-02-24 15:39:02 -08:00
Fan Zhang
3d2efae43b Refactor time format preference to be more modular/testable
Change-Id: Ib6c06de9f942c3bb06384947f6b1923b33e511bc
Fixes: 32972964
Test: make RunSettingsRoboTests
2016-11-17 13:22:53 -08:00
Fan Zhang
3aa68c8b80 Refactor Build number preference control into a controller.
- Use PreferenceController structure to make things more modular and
  testable
- Add tests
- Confirm password before enabling dev settings.

Bug: 24107771
Test: RunSettingsRoboTests
Change-Id: I791d9452fd461f570e70e7428f00a7258663de4b
2016-10-25 14:45:50 -07:00