128 Commits

Author SHA1 Message Date
jackqdyulei
089b6ac75a Change animation based on visibility of the drawable
Bug: 27633363
Test: make RunSettingsLibRoboTests
Change-Id: I589056eb95ee0af046e39d2a646b51c754886b4d
2016-12-13 10:04:17 -08:00
Andrew Scull
4e201486b5 Extract checking profiles for restrictions into a shared method.
Test: m RunSettingsLibRoboTests
Change-Id: Ie8fd3121771a7a2213ee441aef5a0746ad09a6c9
2016-12-13 10:45:37 +00:00
Shahriyar Amini
6b32ae3746 Allow injected Settings tiles to specify a key.
Bug: 31002801
Test: make RunSettingsLibRoboTests

Adds an optional metadata field to specify the key used for an injected
preference.

Change-Id: I3426713783b58020849bc384334ad173061847e9
2016-11-28 07:27:18 -08:00
Fan Zhang
cdbe1d645b Add test for TileUtils.
- Verify it skips non-system apps.
- Verify it parses category correctly.

Bug: 32460089
Test: make RunSettingsLibRoboTests
Change-Id: I743309206e1969dee4b1e62146be64eb4d143614
2016-11-22 15:47:05 -08:00
Maurice Lam
66549382f0 Merge "Fix TTS for GMT offset" 2016-11-18 03:36:52 +00:00
TreeHugger Robot
2ba9de340b Merge "Add a category key for development options." 2016-11-17 02:34:35 +00:00
Fan Zhang
e9bb36caa6 Add a category key for development options.
Bug: 32623105
Test: RunSettingsLibRoboTests
Change-Id: I892385d3acf11c3d02df30a5cc9d73e3ecf8612c
2016-11-16 15:26:06 -08:00
Fan Zhang
5fa4af08c6 Remove tiles pointing to same intent within same category.
Bug: 32874082
Test: RunSettingsLibRoboTests
Change-Id: I155495882663ed60cbf21c9a5651709ac3cbd137
2016-11-16 12:40:35 -08:00
Fan Zhang
fc76ab3cbf Group injected tiles together based on package name.
During grouping, tiles are sorted based on package name, and their own
priority value. However if the package is Settings itself, the ordering
is not changed.

Before sort: [pkg1, 100], [pgk2, 120], [pkg1, 130]
After sort: [pkg1, 1], [pkg1, 2], [pkg2,3]

This is necessary to make sure settings app have the overall control of
ordering of all dynamic tiles. When each app define their priority, they
don't have access to the global vision of what other settings are on
screen so it's possible different app define conflicting orderings.
Settings app is the only reasonable place to rank them properly.

Bug: 32827787
Test: RunSettingsLibRoboTests
Change-Id: I38de55530e61da9de7532ef6a7ee97ef89aca9d9
2016-11-14 15:37:49 -08:00
Fan Zhang
9c9e364ae8 Add new category for input setting and language setting
Bug: 32637613
Bug: 32643833
Test: RunSettingsLibRoboTests

Change-Id: I3551f3743982372e314dac1c778d0faddbfbea69
2016-11-07 15:07:50 -08:00
Maurice Lam
ebc050f12e Fix TTS for GMT offset
Add TtsSpans to the GMT offset string so that TalkBack knows to
read it out in a more natural way.

Retain the old keys with string types for compatibility with TV and
wear.

Test: m SettingsLibTests && \
      adb install -r $OUT/data/app/SettingsLibTests/SettingsLibTests.apk && \
      adb shell am instrument -w com.android.settingslib/android.support.test.runner.AndroidJUnitRunner
Bug: 30042703
Change-Id: I5629a0113404b32b606c1f03060f32868b59c6d2
2016-11-04 19:01:38 -07:00
Fan Zhang
ca60facfdc Filter external setting intents using IA_SETTING keyword.
Also add test for CategoryKey

Bug: 32382487
Bug: 32460089
Test: make RunSettingsLibRoboTests
Change-Id: I0ed6278344a545b5fc952f5811322857382e4b60
2016-11-04 09:39:26 -07:00
Fan Zhang
914afbfbd0 Create test for CategoryManager.
- Move SettingsLibTests to tests/integ
- Create a new robotests directory for SettingsLib.
- Add test cases for CategoryManager#backwardCompatCleanupForCategory

Bug: 32382487
Test: make RunSettingsLibRoboTests
Change-Id: I7ef5921ce8c47a3e1e7209be1abc97ea549a2378
2016-11-02 10:32:26 -07:00
Fan Zhang
11b6507220 Move checking tile user logic into ProfileSelectDialog.
Bug: 32470791
Test: make & run SettingsLibTests
Change-Id: I46342b96f030469502e890301d322cccd7f8032d
2016-10-31 16:45:00 -07:00
Ajay Nadathur
7d176bcc48 [SettingsLib] Add missing AccessPoint listener
- AccessPointListener was not set on AccessPoint in one of the code
  paths and as a result, the UI wasn't notified of changes to the
  AccessPoint.

Test: Manually tested and verified that notification changes were
delivered to the UI. Also added unit test.
bug:31945554

Change-Id: I89affada5dead4edc4218f424eec6b7f4a4e26a7
2016-10-25 14:08:11 -07:00
jackqdyulei
c6a3274fbe Make Timezone selection and selected value has same logic
Change two public functions in ZoneGetter to have the same logic,
now in both functions the display name is based on the locale.

Bug: 19764807
Test: make SettingsLibTests
Change-Id: Id818d4bdb8b1a24c039dd5a3ea57d8fc09970352
2016-10-06 15:41:49 -07:00
Lei Yu
2066a6e8a8 Merge "Add testcases for NetworkPolicyEditor" 2016-09-26 20:33:39 +00:00
jackqdyulei
99177c3512 Add testcases for NetworkPolicyEditor
The testcases are mainly to test warningBytes and limitBytes
could follow the constraint that "warningBytes <= limitBytes"

Bug: 30560513
Test: make SettingsLibTests && \
adb install -r ${OUT}/data/app/SettingsLibTests/SettingsLibTests.apk && \
adb shell am instrument -w \
'com.android.settingslib/android.support.test.runner.AndroidJUnitRunner'

Change-Id: I5722b0fc41e366e2b77a4a20242a5c9a523636fb
2016-09-23 17:16:41 -07:00
Ajay Nadathur
d7b689aefc [SetupWizard] Fix wifi multithreading issues
- Jank on setupwizard's wifi screens caused by concurrent modification
  of AccessPoint on Worker thread while the wifi list is being updated
  in the Main/UI thread.
- Fix this problem by maintaining two separate lists, one that is
  modified in the worker thread and not published to outside components,
  while another list that gets published on the main thread. The
  AccessPoint changes are computed on the worker thread and once thats
  done, the changes are then copied over to the published APs on the
  main thread.

Test: Connected to multiple APs through both suw & settings. Did not
notice the jank. Also added unit tests

bug:30704173
Change-Id: I78666608d39d3680b91980c1a7907d239dc82799
2016-09-22 15:51:29 -07:00
Fan Zhang
eb83a0d501 Use a different TtsSpan type to read wifi name properly.
Fix: 31272186
Test: SettingsLibTests
Change-Id: I94b2e4c995d865cc0cf88fecd0ee954ae962100a
2016-09-21 11:55:15 -07:00
Fan Zhang
6abd129749 Add testing for showing hamburger menu in top level setting
This is test for ag/1456163

Fix: 27584874
Test: run SettingsLibTests and manual inspection

Change-Id: Ide0f2609088e10cea3c70a4bcdd356992de54050
2016-09-19 09:25:26 -07:00
jackqdyulei
8accac9e9e Add userhandle testcases in SettingsDrawerActivity.
Bug: 31398277
Test: make SettingsLibTests

Change-Id: I66d28562dd881eaeb7741b945b7e7f3df710822c
2016-09-16 11:42:34 -07:00
Sudheer Shanka
2f27d95157 Remove wifi related unit tests in SettingsLib
As they are not maintained by anyone.

Change-Id: Ia75336013d5f8f4ba9cda5a7320022f676168856
2016-08-23 12:19:53 -07:00
Sudheer Shanka
fe4716db99 Add unit tests for AppRestrictionsHelper.
Bug: 29077949
Change-Id: I3179a27550816587ec94a8a144dbdb79812a5f74
2016-08-12 17:27:32 -07:00
Jason Monk
bf3d1af3d8 SettingsLib: Fix wifi crash during settings index
and test it

Bug: 21365029
Change-Id: I9a914773577dcbe591b41c9114ba4d078b5e7369
2015-05-22 11:26:34 -04:00
Jason Monk
2b51cc30d5 Fix crash from WPS
Also fix the tests to handle the new threadedness while here.

Bug: 20067687
Change-Id: I116bf14c71886b251c2e8bcaeb2c9b0e5f9ec817
2015-05-13 11:08:53 -04:00
Jason Monk
6572eae9d2 Fix crash in Wifi QS Panel
When open QS wifi panel while wifi was off was causing a crash from
wifi enabling while the WifiTracker was not in a scanning state.
Fix plus a test enclosed.

Bug: 19322090
Change-Id: Id863cdcbf4aa8d50822de3a200355dbaee74b488
2015-02-10 13:58:40 +00:00
Jason Monk
d52356aa5e Move Settings wifi tracking to SettingsLib
Make SettingsLib capable of tracking which wifi networks are
available/saved and their state.

Also modify Quick Settings to use this code rather than having
its own logic.

Bug: 19180466
Change-Id: Iff9f9aed240d79323dba41496496e8076b9fa6f2
2015-02-04 15:08:55 -05:00