Commit Graph

42306 Commits

Author SHA1 Message Date
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
Sunny Goyal
0d2518ba97 Merge "Clearing task when opening home settings in case it is already in the same task" 2017-12-11 17:36:31 +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
Sunny Goyal
ea63e4c6c6 Clearing task when opening home settings in case it is already in the same task
Test: Manually tested on device
Bug: 69960568
Change-Id: If9de28936a7156c4d9c68c85c168ff4aa7492151
2017-12-08 16:12:34 -08: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
Bill Yi
b8eb89579c Merge "Import translations. DO NOT MERGE" into oc-mr1-dev am: 814fb3b7a1 -s ours
am: 9840c89235  -s ours

Change-Id: If1f0055b82b51ae304b5bacafa95821d8eaa2d07
2017-12-08 06:04:47 +00:00
Bill Yi
9840c89235 Merge "Import translations. DO NOT MERGE" into oc-mr1-dev
am: 814fb3b7a1  -s ours

Change-Id: Ic4696096352546cb962ab57470ed569535791665
2017-12-08 06:01:46 +00:00
TreeHugger Robot
814fb3b7a1 Merge "Import translations. DO NOT MERGE" into oc-mr1-dev 2017-12-08 05:52:37 +00:00
TreeHugger Robot
256f6fb607 Merge "Update feature flag dashboard UI to display all features" 2017-12-08 05:50:54 +00:00
Bill Yi
ec657fd6ae Import translations. DO NOT MERGE am: 3ed385256a -s ours am: 14c47203b3 -s ours
am: 5811075aeb  -s ours

Change-Id: I0ea16471b0fe4caa83f0b08907325e6771d19ac2
2017-12-08 05:46:46 +00:00
Bill Yi
5811075aeb Import translations. DO NOT MERGE am: 3ed385256a -s ours
am: 14c47203b3  -s ours

Change-Id: Ic512ba80a6900175986841430f1b69e170bbd845
2017-12-08 05:42:43 +00:00
Bill Yi
14c47203b3 Import translations. DO NOT MERGE
am: 3ed385256a  -s ours

Change-Id: Idb17affa2264a9b46343c3bc9dea1978e5a92a32
2017-12-08 05:39:41 +00:00
Fan Zhang
aeff0be6a5 Merge "Update asset for no search result image" into oc-mr1-dev am: afa1efabad
am: ed6805142f

Change-Id: I7fae2db9c207c26277fbbf04c63911ed222e5d0b
2017-12-08 03:35:59 +00:00
Xin Li
33fa441a86 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: cb1056f9b4 -s ours am: 4f83509810
am: a038fb9044  -s ours

Change-Id: Ibfdba393783ac392dde8a42418b3cf8bfc8e34ff
2017-12-08 03:35:08 +00:00
TreeHugger Robot
c66dbdc2c5 Merge "Add controllers for default app shortcut preferences." 2017-12-08 02:20:11 +00:00
Bill Yi
3ed385256a Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I35a94b9a271e88bf4f0384d5619c59661516131d
2017-12-07 17:08:40 -08:00
Bill Yi
3ea52be26d Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I59dde21252b7681bb6dfcf9dae1f27192a3cd19e
2017-12-07 17:08:11 -08:00
TreeHugger Robot
81bd85ab80 Merge "Depend settings on slices in the support library" 2017-12-08 00:51:19 +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
ed6805142f Merge "Update asset for no search result image" into oc-mr1-dev
am: afa1efabad

Change-Id: Ib77d2973bf4f2155a7bdd73174fd4c4b9903bc17
2017-12-08 00:25:31 +00:00
TreeHugger Robot
afa1efabad Merge "Update asset for no search result image" into oc-mr1-dev 2017-12-08 00:19:09 +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
Stephen Li
5be4c0fdfd Manually merge changes from giant AOSP topic
Change-Id: Iec1a4fdf7f5e04f091608f148aa770cfcd5f8acc
2017-12-07 23:56:30 +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
Beverly Tai
347846c0e4 Merge "Fix failure of ZenModeAutomaticRulesPreferenceControllerTest" 2017-12-07 21:26:10 +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
Beverly Tai
13ea943d89 Merge "Fix ZenModeScheduleRuleSettingsTest null pointer" 2017-12-07 17:48:17 +00:00
Xin Li
a038fb9044 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: cb1056f9b4 -s ours
am: 4f83509810

Change-Id: I72dd8e97a660beaca9343cea99ef117a202fdf35
2017-12-07 15:23:18 +00:00
Xin Li
4f83509810 Merge "DO NOT MERGE: Merge Oreo MR1 into master"
am: cb1056f9b4  -s ours

Change-Id: Iba281b420566a85ffebf98941dbb5e456b724362
2017-12-07 15:17:25 +00:00
Beverly
1aabe820e8 Fix ZenModeScheduleRuleSettingsTest null pointer
Test: make ROBOTEST_FILTER=ZenModeScheduleRuleSettingsTest RunSettingsRoboTests -j40
Bug: 63077372
Change-Id: Ib843337e5867507eec1236fb4504035c151c348c
2017-12-07 10:04:20 -05:00
Jaekyun Seok
b000ace0eb Fix failure of ZenModeAutomaticRulesPreferenceControllerTest
Running ZenModeAutomaticRulesPreferenceControllerTest fails due to
missing field "DEFAULT_RULE_IDS".

"mDefaultRuleIds" should be used instead of it.

Bug: 63077372
Test: make \
    ROBOTEST_FILTER=ZenModeAutomaticRulesPreferenceControllerTest \
    RunSettingsRoboTests

Change-Id: Ieb4a4304a0404685e4a50eb3a5c863a0132ebf7d
2017-12-07 19:46:41 +09:00
Xin Li
82c94efa69 DO NOT MERGE: Merge Oreo MR1 into master am: 7b017d5a2f -s ours
am: 2ba6a22abb

Change-Id: Id5dd78948fe46817fdb0c65b2c4dc8d6536f3a37
2017-12-07 07:05:14 +00:00
Xin Li
2ba6a22abb DO NOT MERGE: Merge Oreo MR1 into master
am: 7b017d5a2f  -s ours

Change-Id: I38ef4306a74fb9c1ca39903d5a74df5db0753290
2017-12-07 04:36:38 +00:00
Hemant Gupta
13197bcc1e Bluetooth: Add support for PBAP UI preference
Usecase:
1) Connect with carkit that supports PBAP/MAP
2) Try to uncheck the checkbox for contact sharing from device sub
   settings menu

Expected Result:
1) DUT should display "Connected (No Media or Phone)"
1) Should be able to disconnect when checkbox moves from selected->unselected,
and carkit should be able to connect when checkbox is selected again

Observation:
1) No UI updates when PBAP/MAP are connected.
2) On unchecking Contact sharing checkbox nothing happens. PBAP connection
   remains active and user is not asked to disconnect profile level connection.

Fix:
Add support for PBAP UI preference in SettingsLib. Also Fix issues related to MAP
profile addition/removal.
Test: Connect from carkit, try disconnecting from sub settings menu by unchecking
Contact Sharing checkbox and check if PBAP is successfully disconnected.

Bug: 35014213
Change-Id: I4981aa063b2541b58ce1d36e3576578cbeb02acc
2017-12-07 09:31:03 +05:30
Jeff Sharkey
e677f49328 Merge "Guide user towards adoption when card is "empty"." 2017-12-07 03:09:59 +00:00
tiansiming
b65c4c3e25 Fix NPE when press ttsEngines settings icon
settingsIntent is obtained by method getSettingsIntent in
TtsEngines.java, and it has the chance to return null directly in
which case will lead to NPE crash when we startActivity in
TextToSpeechSettings.java with a null intent.
So, a judgement here makes sense.

Bug:https://issuetracker.google.com/issues/70266990
Test:
1) Install the apk "partner-BaiduSpeechService.apk" offered in the Bug link above.
2) Go to Settings -> Languages & input -> Advance -> Text-to-speech output
3) Choose "Duer voice engine 3.0" as the preferred engine
4) Press the settings icon in the right

Change-Id: I497a745ce62989f3ff1aee661648e90af25fb99e
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2017-12-07 10:08:34 +08:00
Xin Li
cb1056f9b4 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:29 +00:00
TreeHugger Robot
471044b58a Merge "Default DND rules show at top and can't be deleted" 2017-12-06 22:30:56 +00:00
Xin Li
7b017d5a2f DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: Iab7fd863c422780055277093cb9621197e09d969
2017-12-06 14:24:54 -08:00
Jeff Sharkey
e7a9b8bb20 Guide user towards adoption when card is "empty".
When a newly inserted SD card is empty, we'd like to guide the user
towards adopting it.  Similarly, if the card contains personal media
like photos, we'd like to guide the user towards using it as portable
storage.

Do this by quickly hunting around on the card for files under various
well-known directories.  Special logic to ignore bundled "helper"
apps included from the SD card factory.

Test: bit FrameworksCoreTests:android.os.EnvironmentTest
Bug: 69128181
Exempt-From-Owner-Approval: I wrote the original code.
Change-Id: I48323156dd4c3bb125fc9e66e17cc0384fe9c30c
2017-12-06 15:22:42 -07:00