Commit Graph

4175 Commits

Author SHA1 Message Date
TreeHugger Robot
aceacf5d43 Merge "Move AppInfoDashboardFragment into appinfo package." 2017-12-13 21:22:36 +00:00
Beverly
69294a5d5c Simplify DND Behavior secondary text
Bug: 63077372
Change-Id: I0ac305ff429de27a65667441703b938305d8a03f
Fixes: 70627215
Test: make ROBOTEST_FILTER=ZenModeSettingsTest RunSettingsRoboTests -j40
2017-12-13 15:23:03 -05:00
James Lemieux
d9d4fda9fe Merge "Adopt robolectric 3.5.1" 2017-12-13 19:31:37 +00:00
Matthew Fritze
7fddfebf6c Add Slices Data object and DB Contract
Add in a Data object used to represent one row
in a new SQLite database used for building Slices.

The database has the following schema:
- Key
- Title
- Subtitle
- Screentitle
- Icon
- Fragment
- Controller

The key is the preference key.
Title, subtitle and Icon are for UI info.
Screentitle and fragment are for the intent.
Controller is used to get dynamic ui info (like summary),
and to take actions on the slice (like a toggle).

The actual indexing and a Slice will be handled in a subsquent CL,
but a prototype can be found here: ag/3324435

Test: robotests
Bug: 67996923
Change-Id: Id91deb58a3ab89ce1dab5a3f34cdb9ade6263aa8
2017-12-13 10:59:47 -08:00
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
Jordan Liu
567493a35c Merge "Add signal strength customization" 2017-12-13 18:20:08 +00:00
TreeHugger Robot
8412f70f6c Merge "Fix crashes related to ExternalSourcesDetails." 2017-12-13 07:02:07 +00:00
TreeHugger Robot
10a1602421 Merge "Add power save action to BatteryBroadcastReceiver" 2017-12-13 02:54:59 +00:00
James Lemieux
9453999e6f Adopt robolectric 3.5.1
Bug: 70581603
Test: make RunSettingsRoboTests
Change-Id: I21dba3381ae62ee12de1ce29bea473b3d0f069c0
2017-12-12 17:31:47 -08:00
Lei Yu
15b8b27646 Merge changes Ie1f934b4,Ic3b045a6
* changes:
  Create BluetoothSwitchPreference
  Add ConnectedUsbDeviceUpdater
2017-12-13 01:06:14 +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
TreeHugger Robot
fb72d22784 Merge "Add controllers for iinstant app related preferences." 2017-12-13 00:56:56 +00:00
jackqdyulei
5393991573 Add power save action to BatteryBroadcastReceiver
This cl makes BatteryBroadcastReceiver also listen to update about
battery saver.

Bug: 70530651
Test: RunSettingsRoboTests
Change-Id: I76b2f1b1047aa195ee9d8ff2a8a330cea31039d4
2017-12-12 16:56:22 -08:00
TreeHugger Robot
84e8c795b1 Merge "Add PrefController in XML support" 2017-12-13 00:02:35 +00: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
Matthew Fritze
7d2b4f5fc7 Add PrefController in XML support
Add the ability to define a Preference Controller
in xml using the 'controller' tag.

This is useful for two reasons:
- It allows the controllers to be instantiated via
reflection for Slices and Dashboard fragment
- Removes the requirement that controllers be defined manually
in Fragments

In order to be instantiable, they must have a unified construction
following either:

  ClassName(Context)
  ClassName(Context, String)

Also added a robotest that verifies that all controllers defined
in XML follow the constructor schema, and extend
BasePreferenceController.

Test: robotests
Bug: 67996923
Change-Id: I304b35dc666daebecf0c9e286696f3f2a510704a
2017-12-12 14:21:12 -08:00
TreeHugger Robot
15b42b89b8 Merge "Update the way OMS records details about overlays" into oc-mr1-dev 2017-12-12 21:48:17 +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
Doris Ling
6e447d69bc Add controllers for iinstant app related preferences.
For AppInfoDashboardFragment:
- add app installer preference into the preference screen
instead of creating it dynamically.
- add controller for the App Installer, Instant App buttons, and instant
app domains preferences.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: I8d362cacb78077c173130018c33c4d00abfe9843
2017-12-12 12:32:19 -08:00
Jordan Liu
3040fde446 Add signal strength customization
Also add default behavior in case carrier config bundle is null.

Bug: 69730732
Test: manual and new unit test
Change-Id: Ia38462a7e1b6f2e27ff45d93beef09465a68ae5c
2017-12-12 11:51:32 -08:00
Pavel Grafov
924e0e2154 Respect DISALLOW_UNIFIED_PASSWORD in Settings.
Bug: 63909482
Test: make ROBOTEST_FILTER=SecuritySettingsTest RunSettingsRoboTests
Test: make cts-verifier
Change-Id: Ia89501d5d5339c1340bee36a9bfb8ef72c4ee9b1
2017-12-12 18:20:20 +00:00
Lei Yu
30ba48c540 Merge "Add device name preference in pairing page" 2017-12-12 18:05:34 +00:00
TreeHugger Robot
2f7240ceb5 Merge "Update package name for PictureAndPictureSettings" 2017-12-12 01:05:33 +00:00
jackqdyulei
be555e2dad Add device name preference in pairing page
Also refactor the preference controller
1. Extend from BasePreferenceController.
2. pass in the preference key. Then it could be reused in different
places with different key.

Bug: 69333961
Test: Screenshot | RunSettingsRoboTests
Change-Id: I773ca022baa326481045c1659565c9a21111200a
2017-12-11 15:52:57 -08: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
65b18ae67e Merge "Delete about phone v1 code" 2017-12-11 22:51:42 +00:00
TreeHugger Robot
854e3e8266 Merge "Update the way OMS records details about overlays" 2017-12-11 21:51:35 +00:00
jackqdyulei
d055937664 Create BluetoothSwitchPreference
In the new design, bluetooth preference is not MasterSwitchPreference
any more. This cl creates BluetoothSwitchPreference while reuse the
BluetoothEnabler.

Future cl will remove the BluetoothMasterSwitchPreference when P
feature is finalized.

Bug: 69333961
Test: RunSettingsRoboTests
Change-Id: Ie1f934b4e93a6758a1b0cf83bb5098585a635c2a
2017-12-11 13:05:01 -08:00
TreeHugger Robot
a706583e79 Merge "Disable crashing ExternalSourcesSettingsTest#testManageExternalSourcesForApp" 2017-12-11 20:33:48 +00:00
TreeHugger Robot
834ce49dd9 Merge "Fix assertion in VisibilityPreferenceControllerTest." 2017-12-11 19:19:33 +00:00
jeffreyhuang
7ef47a9c5d Delete about phone v1 code
Bug: 36458278
Test: make RunSettingsRoboTests -j40
Change-Id: Ib8f420a86caa1da0165aa5c161eb584a009ed2b9
2017-12-11 10:57:37 -08:00
TreeHugger Robot
d3d1cf75cb Merge "Fix VisibilityPreferenceControllerTest." 2017-12-11 18:45:33 +00:00
TreeHugger Robot
bbdeafe58b Merge "Remove Slice getter from BasePreferenceController" 2017-12-11 17:40:05 +00:00
Tobias Thierer
9d01fe6823 Fix assertion in VisibilityPreferenceControllerTest.
The test was asserting that VISIBILIY_NO_OVERRIDE (an int)
is not contained in a List<String> (*), which is (trivially)
true but doesn't test what the test intends to test.

(*) or a List<CharSequence>, which is similarly wrong /
  meaningless, prior to the base CL http://ag/3345932

VisibilityPreferenceController uses Integer.toString() to
construct corresponding String values, so the test should
be checking for that String value. For consistency with
  testUpdateState_noGlobalRestriction()
this CL uses the equivalent (and slightly shorter)
String.valueOf(int) instead of Integer.toString().

Test: EXPERIMENTAL_USE_OPENJDK9=1.8 make RunSettingsRoboTests \
   ROBOTEST_FILTER=VisibilityPreferenceControllerTest

Change-Id: I48644729d3e0f29d7ffcc981aeef650f2b1426ef
2017-12-11 17:36:40 +00:00
Tobias Thierer
8f68856823 Fix VisibilityPreferenceControllerTest.
The test was expecting an ArgumentCaptor for RestrictedDropDownPreference
(extends ListPreference).setEntryValues(CharSequence[]) to be passed an
array of Strings, when actually it should have expected an array of
CharSequences.

This CL fixes the test to use CharSequence. Since CharSequence.equals()
is not guaranteed to be in terms of value equality of the characters,
a private static helper method:

  List<String> toStringList(CharSequence[] charSequences) { ... }

is used.

Bug: 70504129
Test: EXPERIMENTAL_USE_OPENJDK9=1.8 make -j30 showcommands dist \
  RunSettingsRoboTests RunSettingsRoboTests-jacoco \
  RunSettingsLibRoboTests RunSettingsLibRoboTests-jacoco \
  RunSettingsGoogleRoboTests RunSettingsGoogleRoboTests-jacoco \
  RunSuwRoboTests RunSuwRoboTests-jacoco \
  RunTurboRoboTests \
  RunStorageManagerRoboTests \
  RunTvSettingsRoboTests RunTvSettingsRoboTests-jacoco

Change-Id: I347b03e6cb01715cd1c7f50b5f36567e5f375ad7
2017-12-11 17:03: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
2f7fd8c592 Merge "Stop statically including legacy-android-test" 2017-12-09 11:18:13 +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
jackqdyulei
988199e202 Add ConnectedUsbDeviceUpdater
The usb updater listens to usb update and notify
ConnectedDeviceGroupController to add/remove
preference.

This cl:
1. Add ConntectedusbDeviceUpdater
2. Extract the UsbConnectionBroadcastReceiver since it would be
used both in controller and updater.
3. Add tests

Bug: 69333961
Test: RunSettingsRoboTests

Change-Id: Ic3b045a6faa4eba57d9b0c089ea1656141cc0220
2017-12-08 13:42:37 -08:00
jackqdyulei
8f73968308 Add feature flag to control battery app list.
If feature flag is on, then display the app list. Otherwise disable
it.

Bug: 70234293
Test: RunSettingsRoboTests
Change-Id: I1663f925abf95e0e4c1a46d98ca165303a76e979
2017-12-08 13:02:13 -08:00
jackqdyulei
1240549591 Move AppListGroup to PreferenceController
Move the app list in battery settings to PreferenceController. So that
we can:
1. Clean the code in PowerUsageSummary
2. Make it easy to add/move the app list to other place in furture.

This cl:
1. Move and make it invisible since in P we don't show app list in
battery main page.
2. Move related test to BatteryAppListPreferenceControllerTest

Bug: 70234293
Test: RunSettingsRoboTests
Change-Id: Ice7a42394916ff5e71305bfe22f5c35868d87fc7
2017-12-08 10:21:54 -08:00
Matthew Fritze
f527684183 Remove Slice getter from BasePreferenceController
After working through a prototype here: (ag/3324435)
it is clear that we don't need the controller to
provider the slice. We will build an index that
will contain sufficent UI information, and a reference
to the controller.

At Slice Bind time, we can get the curret value from the
controller, and the UI information from the Index.

Bug: 67996923
Test: robotests
Change-Id: Id43a51bcd73051bc719cd5829907583e0edf23b2
2017-12-08 10:09:57 -08:00
TreeHugger Robot
256f6fb607 Merge "Update feature flag dashboard UI to display all features" 2017-12-08 05:50:54 +00:00
TreeHugger Robot
c66dbdc2c5 Merge "Add controllers for default app shortcut preferences." 2017-12-08 02:20:11 +00:00
TreeHugger Robot
546d440931 Merge "Move codes generating html file from xml files to SettingsLib (1/2)" 2017-12-08 00:32:38 +00:00
Fan Zhang
3ba0381567 Update feature flag dashboard UI to display all features
Bug: 36222960
Test: robotests
Change-Id: I1aea8f32df9bd8ae24708374b60d173953a7c266
2017-12-07 16:11:58 -08:00
Maggie Wang
b44c5ac04a Merge "Send MODE_CHANGING broadcast before location mode change." 2017-12-08 00:00:08 +00:00
Doris Ling
765007b0bf Add controllers for default app shortcut preferences.
- add the default app shortcut preferences to the preference screen
xml instead of creating them dynamically in the fragment.
- add controller for each of the shortcut preference.
- move the corresponding shortcut detail settings into the appinfo
package.
- add individual preference screen xml for the shortcut detail settings
instead of using the shared screen template.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: I7bc0b3b727e87fb1a32a82291e64b8e290947671
2017-12-07 15:42:28 -08:00
Maggie
1949600132 Send MODE_CHANGING broadcast before location mode change.
When location mode is about to change in Settings app, send
MODE_CHANGING broadcast.

Fixes: 28057031
Test: manual
Test: robotests
Change-Id: I430941915daedf13e7b5d22dc8a6e37729d95b75
2017-12-07 23:21:55 +00:00