Commit Graph

393 Commits

Author SHA1 Message Date
Peter Visontay
11bfef660c Add a unit test for the AppOps permission for displaying UI overlays.
The test logic is the same as ExetrnalSourcesSettingsTest but I moved/renamed some methods so both AppOps tests can use them.

Test: make -j32 SettingsUnitTests && adb install -r out/target/product/marlin/data/app/SettingsUnitTests/SettingsUnitTests.apk && adb shell am instrument -w -e class com.android.settings.applications.ExternalSourcesSettingsTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Test: same as above, but for DrawOverlaySettingsTest
Change-Id: Ifc0f0985a4cb4a82a00839aeb4cd4216c777250e
2017-12-13 18:54:53 +00:00
Doris Ling
a0006d93bd Move AppInfoDashboardFragment into appinfo package.
- update all references to AppInfoDashboardFragment
- removed PackageUtil inner class and change the corresponding function
to be a simple method.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: Ief067e25a303ef16db20b2ca1d8840cb06eff5f9
2017-12-12 16:58:17 -08:00
Adam Lesinski
11ab7f7b82 Merge "Update the way OMS records details about overlays" into oc-mr1-dev
am: 15b42b89b8

Change-Id: I15809e100fc46691f0f60ed2729c18a07d904313
2017-12-12 23:16:37 +00:00
Doris Ling
e29587e334 Fix crashes related to ExternalSourcesDetails.
- ExternalSourcesSettingsTest crashes due to the package moved of
ExternalSourcesDetails. Corresponding xml has been updated in previous
CLs. So, reverting the suppress tag for the test class.
- ExternalSourcesDetails can be launched directly with
MANAGE_UNKNOWN_APP_SOURCES intent, and client can pass in invalid
package while launching ExternalSourcesDetails. Need to check whether
the app info is invalid before we try to launch the fragment.
- also fix test failure for not founding the app list as list object
type and id had been changed.

Change-Id: Id7787ca889f770e10d7a8e9fbf8dc79c9d6e884d
Fixes: 70383636
Test: make RunSettingsRoboTests, make SettingsUnitTests
2017-12-12 22:21:20 +00:00
Philip P. Moltmann
d27fe3275f Switch to modern ArgumentMatchers
Test: adb shell am instrument -w -e class com.android.settings.vpn2.PreferenceListTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

Change-Id: Id2e4684f6d3048cfb60fee1f747d0796c157a3da
2017-12-12 13:07:21 -08:00
TreeHugger Robot
2f7240ceb5 Merge "Update package name for PictureAndPictureSettings" 2017-12-12 01:05:33 +00:00
Doris Ling
a8472007a7 Update package name for PictureAndPictureSettings
- also need to update the reference in the special app access xml page.

Change-Id: I1199f70adf18d3f0e21a946848239526d9c8b3c8
Fixes: 70491786
Test: make SettingsUnitTests
2017-12-11 14:54:37 -08:00
TreeHugger Robot
854e3e8266 Merge "Update the way OMS records details about overlays" 2017-12-11 21:51:35 +00:00
Aurimas Liutikas
6df7a52011 Disable crashing ExternalSourcesSettingsTest#testManageExternalSourcesForApp
Bug: 70383636
Change-Id: If542ef48d54959b3cc6c9fb07ddf07977fe40a8b
2017-12-09 19:03:43 +00:00
Paul Duffin
2baf72190c Stop statically including legacy-android-test
Statically including legacy-android-test leads to duplicate classes
which causes build time problems (with Proguard) and runtime problems on
older SDK versions. This change:
* Stops statically including legacy-android-test.
* Adds compile time dependencies on andoid.test.base, android.test.mock
  and android.test.runner where necessary.
* Adds <uses-library android:name="android.test.runner"/> to any
  affected package to ensure that the classes that were included by
  legacy-android-test are still available at runtime. That also adds a
  dependency on android.test.base and android.test.mock.

The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.

* tests/unit/Android.mk
    Added 'android.test.base' and 'android.test.mock' to
    LOCAL_JAVA_LIBRARIES because SettingsUnitTests's source depends on
    their classes and because of these changes they are no longer
    present on the compilation path.

    Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
    because statically including the classes in SettingsUnitTests
    results in duplicate classes which leads to build time and compile
    time issues.

Bug: 30188076
Test: make checkbuild
Change-Id: I191a72e50017213df6ad04f32aa660e8028720e2
2017-12-08 23:43:33 +00:00
Adam Lesinski
9e19121a00 Update the way OMS records details about overlays
Use flags, since we keep introducing boolean traits which would
be wasteful to encode as booleans.

Bug: 69383160
Test: builds
Change-Id: Ic09ae1086c7afa039b5df11e4c8c968125784586
Merged-In: Ic09ae1086c7afa039b5df11e4c8c968125784586
2017-12-07 19:40:19 +00:00
Adam Lesinski
d79cc0de92 Update the way OMS records details about overlays
Use newly added getter methods instead of relying on internal state.

Bug: 69383160
Test: builds and unit test passes
Change-Id: Ic09ae1086c7afa039b5df11e4c8c968125784586
2017-12-07 11:37:26 -08:00
jackqdyulei
4076bae930 Disable ConnectedDeviceConnectedActivity
Only one connected device activity could be enabled at one time. This
cl disbale the new version but keep old version enabled in
AndroidMainfest.xml.

In this case tile could find correct activity at any time.

Bug: 69810208
Test: Build
Change-Id: I0175b968cc26e38d0549fe2302b762fe0bc65c20
2017-12-04 13:35:12 -08:00
Matthew Fritze
09ec9ae852 Fix unit test for PreferenceController
As we migrate to using BasePreferenceController,
we need to change the checks for PreferenceControllerMixin.

Change-Id: I68cc065b9ac5a39eec21b7979cdb527b13c9778a
Fixes: 69917609
Test: atest
2017-11-29 11:05:46 -08:00
TreeHugger Robot
6a68f306d7 Merge "Implement querySiteMapPairs for indexableProvider." 2017-11-28 19:38:32 +00:00
Fan Zhang
518e648acf Implement querySiteMapPairs for indexableProvider.
Query sitemap will return a list of pairs [parent class name, child
class name]. It's up to consumer to figure out the display name later
so the provider doesn't have dependency on localizing any display names.

- Removed SiteMapManagerTest. We will perform the test in
  SettingsIntelligence instead.
- Added test for the new provider in instrumentation test (robolectric
  doesn't recognize the new constants in framework yet)

Bug: 67359411
Bug: 64938328
Test: atest
Change-Id: Ia973115320e6b7c8cf84d4756db1763ae7010aed
2017-11-27 15:50:19 -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
jackqdyulei
e6f052e928 Merge "Add owners to setting packages."
am: f82cd59476

Change-Id: Ic7c94f6ba65149cdc799332a0cc5976ff285f16f
2017-11-21 16:41:50 +00:00
jackqdyulei
d6a00cfa3f Add owners to setting packages.
Bug: 65294119
Fixes: 69384604
Test: Build

Change-Id: Ib4fddc1f04087671d8445fd967d4262287e5c4f3
Merged-In: I927052a73f639d0894600611cd5c79293f43ff5e
Merged-In: Ia1eb8155f2d4359d56b0babd474083295ba38a0b
Merged-In: I24ec103ff5013ad416e3dfb1c548acd387b4ba64
Merged-In: If9fddc8b4e2e6d4d7db185ab16063e824323b9a7
Merged-In: I49159950521a013422b1087ea2c3e6cd5151457c
Merged-In: I69af58183c5b89af96c1a8808665fa506a620012
Merged-In: Ie9492f497824cd2b2727dde9d3a48452c72f1084
Merged-In: I2fd0249fd8b555e5ca93c3aec13857e6c74e157c
Merged-In: Id1c2d9233643a18c1e104255a9e2b8b1aaefc44e
Merged-In: Icdcfaaf6cc7a1e1cf77e89a79d0425cab4405ffc
Merged-In: I697528ff260a0f8e54aa1188e35143e668800e7d
Merged-In: I1486782f476acaf1e2e4b66df57869409239986f
Merged-In: I804b50a38c877da80b5ef3251e16029259014152
Merged-In: I39eec9ebc1db2dc14669f27b17624394e25eb47f
Merged-In: I054a6df08046cda1c2f202390ed24839a6b10349
Merged-In: I9da5bd71ed6aa3922a7f2e2ac4729e3247a204ce
Merged-In: I63778c68f1ab9edc36a9e12aa1729f8fd6a5e073
2017-11-20 16:39:59 -08:00
Julia Reynolds
8603c7ea62 Add owners files to notification test dirs
Test: make
Change-Id: I63778c68f1ab9edc36a9e12aa1729f8fd6a5e073
2017-11-20 16:40:47 +00:00
Fan Zhang
7d5c9ace64 Add test and fix null keys in search providers.
- Add keys to some screens.
- Remove dynamic saved network/turst agent from search provider.
- Remove dynamic print services from printsettings.

Bug: 69384409
Test: atest
Change-Id: I62dce27d52585badb2a8953a05084e35dbae2f7d
2017-11-16 12:57:45 -08:00
Fan Zhang
6c0c789460 Revert "Get rid of SearchIndexableResources entirely."
Fixes: 69266642

This reverts commit ba0077977f.

Change-Id: I9de6914f194a65ba627b2e5e805884f894fc044f
2017-11-13 22:48:49 +00:00
Fan Zhang
ba0077977f Get rid of SearchIndexableResources entirely.
Bug: 37741509
Test: robotests
Change-Id: I7e6dba5e13378beae632c838b7dd13acfdc50b10
2017-11-10 15:10:55 -08:00
Fan Zhang
b21112bd3d Add instrumentation test for SearchResultTrampoline intent.
Forgot to add this when creating intent-filter

Bug: 64938328
Test: atest
Change-Id: I8cfc26c2c589b2ae1942d365ed7dbca0da90d580
2017-11-10 12:25:47 -08:00
Fan Zhang
8068fda059 Add intent-filter to SearchResultTrampoline
Bug: 64938328
Test: atest
Change-Id: I3ac6506a6af3af9ff2bd60354ba23617b700ace8
2017-11-09 16:37:01 -08:00
Matthew Fritze
55ce64dcd9 Move Index provider conversion into Settings provider
Pre-patch, settings search provider would push all of its
fragments into to search via SearchIndexableResources with
an implicit contract of if the resource's xml == 0, then
it was a settings fragment with an Index provider.

One, implicit contract is bad. Two, it was messy at indexing time.

So this patch moves htat conversion into the search index provider.
Such that all of the indexables are either real Resources or Raw.

Change-Id: I39f4351c03d123bb9b45edb4df7f924cfaff2b38
Fixes: 65376542
Fixes: 37741509
Test: robotests
2017-11-07 11:18:26 -08:00
Fan Zhang
6438ee5466 Mark core unit tests for Presubmit
Bug: 68716631
Bug: 68720368
Test: rerun test
Change-Id: Ia8cca6aede824928fc358b005172bbe2ed670c8f
2017-10-31 14:09:31 -07:00
Fan Zhang
e261535192 Implement the missing PreferenceControllerMixin interface
Change-Id: I0bb28cf9d2ec24629485a754778faddcbc8f9fdb
Fixes: 68716631
Test: atest PreferenceControllerContractTest
2017-10-31 13:17:13 -07:00
TreeHugger Robot
11151f5052 Merge "Eliminate duplicate keys in pref xmls." 2017-10-28 19:39:28 +00:00
Fan Zhang
57ef92a810 Eliminate duplicate keys in pref xmls.
- Remove additional_system_update pref device_info page, we don't need
  it.
- Update keys in xml and Preference controller, and search index
  provider.
- Clean up in ScreenZoomPreference, it's anti-pattern to set fragment in
  constructor.
- Whitelist 2 that are super hard to remove.

Change-Id: Ibab6e2cb074513042a2ae007d9085aa64046eec8
Fixes: 67852637
Test: uniquePreferenceTest
2017-10-28 11:06:37 -07:00
Doris Ling
3977a6b482 Revert the way Special app access is launched.
- change it back to launch the fragment instead of intent activity.
- update the test case to launch special app access from Apps &
notifications page instead of directly launching it.

Change-Id: I61289ba0fa6cc4585c87cf337aa2007fb578450f
Fixes: 68397751
Test: visual, make SettingsUnitTests
2017-10-27 15:50:01 -07:00
TreeHugger Robot
295a6b42f4 Merge "Moved zenMode visual effects + automatic rule page" 2017-10-27 15:23:19 +00:00
Beverly
4359d4b9c9 Moved zenMode visual effects + automatic rule page
- Automatic zen rules have their own page like in N
- Minor string changes to page and add rule dialog
- Zen mode visual effects was moved into behavior settings

Bug: 63077372
Test: $ make SettingsUnitTests -j40
$ adb install -r ${OUT}/data/app/SettingsUnitTests/SettingsUnitTests.apk
$ adb shell am instrument -w com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

Change-Id: I9635f8f7969b76d036bc06ec44705815e540777a
2017-10-27 09:49:04 -04:00
Fan Zhang
f2b3825a09 Merge "Add a test to enforce unique id for preferences (in search)" 2017-10-26 18:50:05 +00:00
Fan Zhang
7765067f33 Add a test to enforce unique id for preferences (in search)
Change-Id: I007ad2b9bf381c601f9375f14e32d4e2bc086942
Fixes: 67852637
Test: is a test
2017-10-26 09:47:35 -07:00
Malcolm Chen
13d50cb0f5 MSIM support for Wi-Fi calling setting.
UI change to support Wi-Fi calling settings for multi-SIM devices.

Bug: b/65648147
Test: manual
Change-Id: Ia2e3a835400873bf6d8bfc7a7690d98e74049076
2017-10-25 11:48:23 -07:00
Fan Zhang
a8cac7a409 Move ManageApplications to sub package and remove dead code
Bug: 64804294
Test: rerun test
Change-Id: I23cbd8da9b65f52470030ba3b9b676ece2bada11
2017-10-12 13:48:54 -07:00
Fan Zhang
c8bff87a9f Turn off WifiTetherSettings page.
Merged-In: If92798ddf075801e66cd97ecacff2f8df1e41985
Change-Id: Idab770509a8049907a256cce2b8f00f236c2dbdc
Fixes: 65852564
Test: rerun robotests
Test: new instrumentation test to check flag initial state
2017-09-19 10:16:38 -07:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Bill Yi
d732b0a4e6 Import translations. DO NOT MERGE
Change-Id: Iead27f9c66c6bce2c1f3b27c29cf2c703da6dac6
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-09-13 09:33:48 -07:00
TreeHugger Robot
7f541b8227 Merge "Clean up test strings" 2017-09-06 19:49:36 +00:00
Fan Zhang
a0372028f0 Clean up test strings
- Mark everything untranslatable to avoid TC confusion

Change-Id: Iea43b0f5f63253833d91aeaa11b3c463cd170741
Fixes: 65355069
Test: builds
2017-09-06 10:54:19 -07:00
Bill Yi
ef8151c8b3 Import translations. DO NOT MERGE
Change-Id: If965ef4d51917904739ed4726b036a285adc6d6d
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-09-06 08:15:05 -07:00
Julia Reynolds
0e497230d9 Merge "Add settings page for notification channel groups" 2017-09-01 12:49:39 +00:00
Julia Reynolds
0c3f4bce57 Add settings page for notification channel groups
Bug: 63927402
Test: tests/unit/src/com/android/settings/notification/.*
Change-Id: Iebf7d8ba54f0cf5801a42f3161354d3cc5e5c848
2017-08-31 11:02:36 -04:00
Doris Ling
d47606ab6d Move tests from tests/app/ to tests/unit/
- second round, move all remaining items
- removed SoundSettingsIntegrationTest and DashboardAdapterTest as they
are obsolete.

Fixes: 62103184
Test: make SettingsUnitTests
Change-Id: Idc2eeb285acd209ef2d00c5451fff697002e1734
2017-08-29 15:32:53 -07:00
Stephen Chen
0246cd8a40 Merge "Add a "Add Network" button to SavedAccessPointsWifiSettings" into oc-mr1-dev am: a78eeb2d61
am: 31deb9a766

Change-Id: Ibd4f9959af5c5c1bde51ce1b9285531880301daa
2017-08-24 02:17:10 +00:00
Stephen Chen
dc1add0c61 Add a "Add Network" button to SavedAccessPointsWifiSettings
Bug: 36719359
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/SavedNetworkSettingsTest.java
Test: Open saved networks from WifiSettings. Ensure that exiting and
resuming the activity keeps the "Add Network" button on the bottom of
the network list. This is tested through the cases where networks are
forgotten/saved before resuming, and that pausing/resuming when the dialog
is open or closed does not affect the result.

Change-Id: Ib719a1f6b9468c0f8f44470eeed9144904672cf1
2017-08-17 14:00:30 -07:00
TreeHugger Robot
65e557754e Merge "onConnectedChanged should not update access points" 2017-08-10 23:35:07 +00:00
Doris Ling
109bb5e59a Move tests from tests/app/ to tests/unit/
- first round: move tests that currently pass

Bug: 62103184
Test: make SettingsUnitTests
Change-Id: Ief3adf88e5090621e5ec3957a71d1b56b4be186a
2017-08-09 17:12:46 -07:00