Commit Graph

360 Commits

Author SHA1 Message Date
Fan Zhang
1aeea9a9f8 Merge "Fix a bug where homepage is using staled locale for tiles" into pi-dev am: 086dbda475
am: a91023c9bc

Change-Id: I6bcb88bad6357ee4c2caba8b6a8df5147e657af0
2018-04-04 22:09:07 -07:00
TreeHugger Robot
086dbda475 Merge "Fix a bug where homepage is using staled locale for tiles" into pi-dev 2018-04-05 04:57:46 +00:00
Fan Zhang
f1030e8cdf Fix a bug where homepage is using staled locale for tiles
When setting a new locale, SettingsActivity restarts to load
everything in the new locale.

Data (containing locale specific title/summary etc) is reloaded
correctly and triggers a callback to UI to redraw.

However we skip the first callback as an optimization for app startup
time. When we restart fragment, we failed to save the state whether we
have already seen the first callback. So when data with new locale text
triggers the callback, it's being skipped and this make UI still render
in old locale.

The fix is to just save the state before fragment gets destroyed before
locale change so the callback can trigger later.

A better fix is: make data (Tile object) not cache text. Then we don't
need to worry about locale cache at all. We should do this fix in the
long term.

Test: localeswitcher
Test: adb shell am broadcast -a com.google.android.testing.i18n.localeswitcher.CHANGE_LOCALE -e LANGUAGE_TAG "zh"
Test: adb shell am broadcast -a com.google.android.testing.i18n.localeswitcher.CHANGE_LOCALE -e LANGUAGE_TAG "ja"

Fixes: 77470788
Bug: 77600770

Change-Id: Ic4223ddbb679db64d0fc3c29d16a5f61a66cc99c
2018-04-04 17:29:45 -07:00
Matthew Fritze
688ad64e00 Merge "Fix crash in non-indexable keys collection" into pi-dev am: 66e6e637a4
am: acc93635c3

Change-Id: I78aab2e3b7bc6f621e2425a88f3787e29f6ec2ff
2018-04-04 17:20:54 -07:00
Matthew Fritze
3cd543fb85 Fix crash in non-indexable keys collection
Some of the AmbientDisplay preference controllers were
crashing when their isAvailable methods were being called
by their fragment's search index providers, which meant that
the entire collection of non-indexable keys failed. Thus,
all search results were showing up. In the case of a secondary
user, they were able to see developer options which crashed
settings when clicked.

There are two issues addressed in this cl.
1. Fix the crashes so the non-indexable keys collection works
2. Contain each fragment's collection, so that if a fragment does
crash, the damage is minimized.

Part 1 is checking that the config in isAvailable is not null,
and creating one if so.

Part 2 is fixed by surrounding the collection of non-indexable
keys in a try-catch, with an option in the catch to re-throw the
error if a system property is set. Thus, in a new pre-submit
instrumentation test, we can and docheck if any of the fragments crash
when collecting non-indexable keys.

Change-Id: I820bd9cb2649aa6faff7f82fcf575a62e41dc4fc
Fixes: 77486668
Test: atest NonIndexableCrashTest, robotests
2018-04-04 13:36:33 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Fan Zhang
947a673f74 Remove more wrappers
- WallpaperManagerWrapper
- UserManagerWrapper

Bug: 76167422
Test: robotests
Change-Id: I3ca866089082e01f1e9d7a4554387962f45a5437
2018-04-02 16:51:40 -07:00
Neil Fuller
cbaa984cde Merge "Show time zone used in or after 2018 only" into pi-dev 2018-03-23 17:18:36 +00:00
Victor Chang
490e46e01b Show time zone used in or after 2018 only
- Year 2018 is picked as the new time zone data
for picker is introduced in 2018. I can be adjusted
in the future to show more merged time zones.
- Add test to ensure each region has at least
one time zone.
- Fix a issue not using a singleton of TimeZoneData
  in commit 6c33caad4b

Bug: 72142943
Test: atest SettingsUnitTests:TimeZoneDataTest
Change-Id: I5eba7fbd59a2d3fd2e8062c9615946dc4bbb6314
2018-03-23 08:23:51 +00:00
TreeHugger Robot
61e6b87e7d Merge "Recover print job ID from intent extras" into pi-dev 2018-03-21 17:29:35 +00:00
Fan Zhang
10420706e6 Merge "Remove SettingsLaunchPerformance test" into pi-dev 2018-03-21 16:53:47 +00:00
Philip P. Moltmann
b85ab7e979 Recover print job ID from intent extras
If the fragment was started via ACTION_PRINT_SETTINGS the intent extra
does not get transformed into a fragment argument. Hence need to check
the intent extra.

Fixes: 74456525
Test: Opened print job settings from a print notification,
      atest com.android.settings.print.PrintJobSettingsActivityTest
Change-Id: I6c4605309c348456a862c4d7b48a11400b62fb70
2018-03-21 08:13:45 -07:00
Fan Zhang
ff0228091f Remove SettingsLaunchPerformance test
Bug: 74834445
Test: TH presubmit
Change-Id: I3ab181a867480f7c61d12d2f5c1490f48b2024c8
2018-03-20 14:29:56 -07:00
TreeHugger Robot
a2da6221c0 Merge "Update AndroidTest.xml to be APCT suite ready" into pi-dev 2018-03-20 02:13:47 +00:00
jdesprez
881004ca26 Update AndroidTest.xml to be APCT suite ready
Test: atest SettingsUITests
Bug: 74440293
Change-Id: Id7940589a5cd216668ab4664bb802faaf70b5f68
2018-03-19 14:46:45 -07:00
Lei Yu
301a89d726 Remove dupe key in UniquePreferenceTest
The duplicate page already removed in b/70848054, we need to update
the test.

Change-Id: Ia1f313d211e7528311e56596dbab152aad54bf22
Fixes: 70848054
Test: runtest -x UniquePreferenceTest
2018-03-16 18:19:17 -07:00
Fan Zhang
3b47e5bc9f Reuse xml parser logic to scrape preference xml files.
Bug: 73668763
Test: atest
Test: robotests
Change-Id: Ifc241b5b4ec6d2935c4c532ff902a7ba352a98d6
2018-03-05 14:20:19 -08:00
Phil Weaver
203b923cb4 Settings reflect new a11y shortcut on lockscreen
Matching changes to the framework behavior. The
setting is on by default iff the user has agreed
to use the a11y shortcut.

Bug: 70944865
Test: Adding new test for this fragment that checks
this behavior

Change-Id: I7831f64cf3ec59c2d266340cc570227433a4febb
2018-03-03 03:35:24 +00:00
TreeHugger Robot
63c34f1e0c Merge "Gateway whitelist AdvancedConnectedDeviceDashboardFragment" 2018-03-01 22:33:30 +00:00
Fan Zhang
747f0e14ef Gateway whitelist AdvancedConnectedDeviceDashboardFragment
- Discovered a few more fragments that weren't whitelisted, so I
  whistlisted those as well.
- Also found ZenModeExternalRuleSettings is misconfigured in manifest
  and no longer needed, so deleted all artifacts about this activity.

Fixes: 74060141
Test:  atest
Change-Id: I159e403bfa6707e2939d075ecc2b8d2f13514153
2018-03-01 13:17:21 -08:00
Jack He
2b0dbf7d24 Bluetooth: Use config value for default max connected audio devices
* The first option in Bluetooth max connected audio devices preference
  should be using system default
* Added template based string array to show system default in the list
  preference and in preference summary when default is chosen
* Reset max connected audio devices property to empty string when
  development setting is disabled or when system default is chosen
* Added instrumentation test to check preference array size and whether
  default value is within range of preference array values
* Modified robolectric tests to verify the updated behaviors

Bug: 64767509
Test: Enable and disable multi-device mode in development settings
      make -j32 RunSettingsRoboTests
      atest SettingsUnitTests:BluetoothMaxConnectedAudioDevicesPreferenceControllerInstrumentationTest
Change-Id: I4915f12df0ac0e6f715e44e0df4a3707dde8d1a4
2018-03-01 02:01:30 +00:00
Fan Zhang
aed8994f6f Rename Indexable::getAllPreferenceControllers.
To getPreferenceControllers. "all" is redundant. Then internally, the
old getPreferenceControllers() is renamed to
createPreferenceControllers() to emphasize the controllers are created
from code (versus the ones created from xml).

Bug: 73668763
Test: robotest
Change-Id: Ifec46aefdc2a418031c8e152028b30bdcd396fc7
2018-02-23 16:37:28 -08:00
TreeHugger Robot
8e6d5ad27e Merge "Instantiate pref controllers from xml if it's defined." 2018-02-24 00:13:45 +00:00
Fan Zhang
917f101899 Instantiate pref controllers from xml if it's defined.
- If a <preference> tag also defines a controller, we will try to
  instantiate it before displaying the UI. The same logic is shared by
  BaseSearchIndexProvider so it also drives search suppression.

- If user also defines a list of controllers programatically, the
  programatically created ones takes precedence.

Bug: 73668763
Test: WIP
Change-Id: I7aecec270bcd3af261e012ef1f6995d2a523cfa1
2018-02-23 14:08:51 -08:00
hansson
a42bfa83df Merge "packages/apps/Settings: Set LOCAL_SDK_VERSION where possible." am: f5b75dd74d am: aa0812f42b
am: 685b923a1b

Change-Id: I39a6aad6f8bf21741de4feb838694ab43dc5d074
2018-02-23 07:35:31 +00:00
hansson
685b923a1b Merge "packages/apps/Settings: Set LOCAL_SDK_VERSION where possible." am: f5b75dd74d
am: aa0812f42b

Change-Id: I6ef97b4506cf656194090bcf9b0df543190f1e79
2018-02-23 07:30:14 +00:00
Andreas Gampe
f259c55eed Settings: Annotate JUnit4 test with @Test
Mollify Errorprone.

Bug: 72076216
Bug: 73796195
Test: m javac-check RUN_ERROR_PRONE=true
Test: m RunSettingsRoboTests
Test: atest WifiSettingsUiTest
Change-Id: I9bc950f0ecf8d6de89b9401ea4cf1c50fd3acbcd
2018-02-22 20:33:37 -08:00
Anton Hansson
861554a2d9 packages/apps/Settings: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: Ic906adbd670c4dbfe2cdf0b71cdbeaf9ac08a27e
2018-02-22 16:12:29 +00:00
TreeHugger Robot
a0d8315762 Merge "Remove use of forceUpdate." 2018-02-21 20:16:00 +00:00
TreeHugger Robot
28188cdd21 Merge "Move xmlParserUtils to core" 2018-02-21 03:34:37 +00:00
Fan Zhang
1ac5a01253 Move xmlParserUtils to core
This class is currently used by both search and slice, in the future
will be used by DashboardFragment to build controller list. So the scope
of this class is beyond search now.

Test: rerun robotests
Change-Id: If43ebca065aac31ad24f95a94bfe5be784109605
2018-02-20 17:43:28 -08:00
Fan Zhang
47854c2945 Migrate more places to subsetting launcher
Bug: 73250851
Test: robotests
Change-Id: Iaf29df45ddb42fd58f181cb01e10998a97cb7c34
2018-02-19 14:21:05 -08:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Adrian Roos
5bc4bdf35c Merge "Use new OverlayManager categories" 2018-02-16 22:47:11 +00:00
TreeHugger Robot
a33ee8b349 Merge "Fix instrumentation tests" 2018-02-14 17:22:55 +00:00
Adrian Roos
807cf8d2c5 Use new OverlayManager categories
Using this, we split overlays based on their category, so that
cutout emulation and theme overlays no longer clash in their
respective settings.

Bug: 72436677
Test: make ROBOTEST_FILTER=EmulateDisplayCutoutPreferenceControllerTest RunSettingsRoboTests
Change-Id: I23f22113351b3948beb9e3a1fb969700852539cc
2018-02-13 19:13:10 -08:00
Fan Zhang
d2e33e73a1 Fix instrumentation tests
Change-Id: I4f6891f095f4803e822b55a3f44d67ee4d173180
Fixes: 73242024
Test: atest
2018-02-12 14:26:47 -08:00
Leslie Watkins
29a2379b09 Merge "Remove all reference to SmsMirroring in Android Settings." 2018-02-12 22:13:48 +00:00
Leslie Watkins
58eb43a2e4 Remove all reference to SmsMirroring in Android Settings.
Test: Robotests

Change-Id: I3318c6915cae95522f09838f00a3c567fe9e5fc5
2018-02-12 22:05:56 +00:00
Doris Ling
f2ecc4bf26 Add test to verify external account settings is shown.
- add a test service that provides a test authenticator and a test
preference screen. Creates corresponding test account and verifies that
the preferences defined in the authenticator is displayed from the
account detail page.

Change-Id: Iab87177ae500d0a36272cf8ecf464139a3dc07cd
Fixes: 35353708
Test: make SettingsUnitTests
2018-02-09 14:27:06 -08:00
Sundeep Ghuman
0f711f86a6 Remove use of forceUpdate.
Now that WifiTracker correctly handles eviction of stale scan results
only after scanning has resumed, it is no longer necessary to
conditionally fetch APs on app resumption.

Fix broken test.

Bug: 68030053
Test: runtest --path
tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: Ib4c8d6e53cf760fcb5f00069da40c578171c09f4
2018-02-08 17:49:05 -08:00
Doris Ling
7459f40bfd Add test to verify Users settings shows in secondary user.
- also update launch sequence for Users settings tests as Users settings
has been moved inside system settings and the preference title has
changed.
- and change the test to run with AndroidJUnit4.

Change-Id: I049b83f9ae4b2724608af267e8900dd9e6749874
Fixes: 34774778
Test: make SettingsUnitTests
2018-02-08 14:06:23 -08:00
Fan Zhang
3d516e7607 Highlight row (instead of ripple) when come from search.
- Moved HighlightableAdapter to its own class
- Replaced ripple with blue background
- Bluebackground only stays for 5 seconds. After that it's replaced by
  ?attr/selectableBackground

Misc fixes.

- Fix NPE in UserSettings
- Update char limit on a new string

Change-Id: I4687e54e71fd7b9243f520b7630563df58be23d4
Fixes: 71715698
Fixes: 72761974
Test: robotests
2018-02-01 12:35:25 -08:00
Doris Ling
ce55d7c6a1 Remove app info page v1 related codes.
- change to use AppInfoDashboardFragment completely
- remove InstalledAppDetails and the corresponding tests

Change-Id: I8cbdf71cadc8b5743929abbafe91185e5e39b6b2
Fixes: 69384089
Test: make RunSettingsRoboTests
2018-01-29 17:14:32 -08:00
Fan Zhang
409eab14de Fix shortcut icon in launcher
When building icon for shortcut, check if the icon is LayerDrawable.
- If yes, only take the second layer (foreground).

Also move the class to shortcut package

Change-Id: I3513dbeb6509f11aa70ab3230d441e268ca9356d
Fixes: 72553870
Test: atest
2018-01-29 11:39:48 -08:00
Daniel Nishi
9f1352b4f3 Fix the UniquePreferenceTest.
By adding in the About Phone v2 screen, we duplicated some settings.

This isn't actually a problem because when the flag to turn on V2 is on,
V1 goes away, and vice versa.

Change-Id: I9aa327ac532ed2ac240bb2d6cbb327f299438889
Bug: 72459760
Test: adb shell am instrument -w -e class
com.android.settings.core.UniquePreferenceTest
com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
2018-01-25 02:26:17 +00:00
TreeHugger Robot
f3b61d1206 Merge "Fix the app ops settings tests by adding FLAG_ACTIVITY_NEW_TASK to Intents." 2018-01-24 18:02:18 +00:00
Julia Reynolds
1c542bbeb0 Remove unused intent.
Test: cts-verifier
Bug: 63927402
Change-Id: I0ae2f33f7e8f1cce9dbe8166b522eb9cbde4c8b5
2018-01-23 09:05:37 -05:00
Peter Visontay
cec65e9423 Fix the app ops settings tests by adding FLAG_ACTIVITY_NEW_TASK to Intents.
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
Change-Id: I187d68e6b214d975df0fe2a3d5dc88cadec35fa3
2018-01-23 13:32:34 +00:00
TreeHugger Robot
a9f6d41635 Merge "Block sleep options in Settings app when DISALLOW_CONFIG_SCREEN_TIMEOUT is set." 2018-01-19 22:25:23 +00:00