Commit Graph

3945 Commits

Author SHA1 Message Date
Matthew Fritze
fb772248b1 Move search querying into a single API
Settings now collects search results from a single
loader which fetches from an aggregator. This is to
facilitate the separation of search functionalitiy,
where "query" becomes a single synchronous call.
In this case, the aggregator will move to the
unbundled app and would be called on the
other end of the Query call. i.e. the new search
result loader will just call query, and unbundled
search will handle everything else.

An important implication is that the results will
be returned in a ranked order. Thus the ranking and
merging logic has been moved out of the RecyclerView
adapter (which is a good clean-up, anyway).

The SearchResultAggregator starts a Future for each
of the data sources:
- Static Results
- Installed Apps
- Input Devices
- Accessibility Services

We allow up to 500ms to collect the static results,
and then an additional 150ms for each subsequent
loader. In my quick tests, the static results take
about 20-30ms to load. The longest loader is installed
apps which takes roughly 50-60ms seconds (note that
this will be improved with dynamic result caching).

To handle the ranking in DatabaseResultLoader,
we start a Future to collect the dynamic ranking before
we start the SQL queries. When the SQL is done, we
wait the same timeout as before. Then we merge the
results, as before.

For now we have not changed how the Dynamic results
are collected, but eventually they will be a cache
of dynamic results.

Bug: 33577327
Bug: 67360547
Test: robotests
Change-Id: I91fb03f9fd059672a970f48bea21c8d655007fa3
2017-10-30 14:20:49 -07:00
Fan Zhang
fdf96975e3 Clean up: use AppPreference for PowerGaugePreference
- And remove the code for customizing app icon size.

Bug: 65182905
Bug: 68426851
Test: robotests
Change-Id: I4e37bbee3636266f7c1a639b8e9faabb78d61110
2017-10-30 12:20:49 -07:00
Fan Zhang
1c3a4de93d Switch to use small icon for most app related pages
- Renamed AppProgressPreference to AppPreference to handle most app
  related prefs
- Add ed AppSwitchPreference - the same layout as AppPreference except
  it's a SwitchPreference
- Use above 2 prefs in most app related pages.
  - Everything under special access pages
  - Recent app list in App & notifications
  - App data usage detail page
  - Default app picker pages

Bug: 65182905
Test: robotests
Change-Id: I96c980ba1db49e36dabe25b5eade1197215aad11
2017-10-30 12:20:49 -07:00
Fan Zhang
974d2fe080 Update UI to use a smaller icon for ManageApplication page.
- Rewrite preference_app.xml to have a small icon
- Update ApplicationViewHolder to hide/show summary row dynamically
  - but only do this for notification settings - this UI has empty
    summary for most row. For other UI, just keep the empty summary row
    until summary comes in. If we also hide/show summary row there will
    be a height change animation which is janky.

Bug : 65182905
Fixes: 63582851
Test: robotests

Change-Id: Ice67324f08c67e014a018dfc51e00fe4449036dd
2017-10-30 12:20:49 -07:00
TreeHugger Robot
ecb8355aff Merge "Remove locale checking for indexing." 2017-10-30 16:48:29 +00:00
Fan Zhang
f68e6ec2ae Move app ops classes to their own package
Bug: 68426851
Test: robotests
Change-Id: I076b7adf59d4bf66792eb0aebaa3dc305d6d0c4b
2017-10-28 14:22:45 -07:00
TreeHugger Robot
11151f5052 Merge "Eliminate duplicate keys in pref xmls." 2017-10-28 19:39:28 +00:00
Fan Zhang
752928ed0d Merge "Make SettingsShadowResources Thread Safe" 2017-10-28 18:55:43 +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
jeffreyhuang
c682766176 Make SettingsShadowResources Thread Safe
- Add synchronization locks to data structures in
 SettingsShadowResources to avoid ConcurrentModificationException
 - Make temporary variables final variables

Change-Id: I39a894c67d0b5e5b21bc0b9aa89180ba6989f01d
Fixes: 67850343
Test: make RunSettingsRoboTests -j40
2017-10-27 16:39:32 -07:00
Matthew Fritze
cb4b385794 Remove locale checking for indexing.
Remove the the indexing check for the
index data's locale to match the locale of
the device. We don't require locale for
indexables, and we reindex on locale change.

It had introduced a bug where when locale
changed, the default us-en results would
not be added to the db.

Change-Id: I43a4284f5c23bc51ee3efdfcabe511eac2d3317d
Fixes: 66916397
Fixes: 68380443
Test: robotests
2017-10-27 16:03:28 -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
Doris Ling
8b14a1a7a6 Change to use the expand button in support lib.
- functionality for hiding portions of the preferences in the preference
screen is added to the support lib. So, changing the settings
implementation to use the feature from the support lib instead.
- remove ProgressiveDisclosureMixin and the related code

Fixes: 63985174
Test: make RunSettingsRoboTests
Change-Id: Ib1d39b2db93d78a56c7adf90abcae5226f9564c2
2017-10-27 13:16:38 -07:00
Christine Franks
34f7b5af59 Merge "Move color mode to DisplayTransformManager" 2017-10-27 16:10:22 +00:00
TreeHugger Robot
244f4c5686 Merge "Misc clean up in search" 2017-10-27 15:41:29 +00: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
TreeHugger Robot
85fb6726e9 Merge "Search in Settings for Japanese" 2017-10-27 03:31:46 +00:00
TreeHugger Robot
b40d1db1ae Merge "Call SuggestionService.launch when click suggestion." 2017-10-27 01:24:31 +00:00
Suzuki Yuka
75664c6e02 Search in Settings for Japanese
Normalize Hiragana and Katakana in Settings search.

Fixes: 28410478
Test: manual - set the device language to Japanese
               and search in Settings.
Test: manual

Change-Id: Iee76da6a895ea006959c23f4eb64f62af0917c34
2017-10-26 18:15:17 -07:00
Fan Zhang
823dde54c7 Misc clean up in search
- Remove updateFromClassNameResource() because it's just a no-op method.
- Simplify SearchIndexResources
- Update some pref pages to have unique keys.

Change-Id: I51e542d9947aafd046861ce7be0b4c7213fcd01d
Fixes: 64951285
Test: UniquePreferenceKeyTest
Test: robotest
Bug: 67852637
2017-10-26 17:54:45 -07:00
Fan Zhang
8052ac0b36 Call SuggestionService.launch when click suggestion.
Bug: 68267490
Test: robotests
Change-Id: I8614f256fc1a87395b5c9d41e3621164a2ded5e1
2017-10-26 15:23:49 -07:00
jackqdyulei
d65bb52dc8 Don't consider managedProfile in PowerUsageAdvanced
When calculating how many uses exists, we shouldn't count the
managedProfile since this is not the normal user.

Bug: 37681923
Test: RunSettingsRoboTests
Change-Id: Ic24e98f8e8696530d534bc9e1d8f675ad6ad5063
2017-10-26 15:08:50 -07:00
TreeHugger Robot
471bc86ae6 Merge "Update activity titles for fragments without preference screen." 2017-10-26 21:14:01 +00:00
Christine Franks
dd811e246b Move color mode to DisplayTransformManager
Bug: 68159303
Test: make -j100 && make RunSettingsRoboTests -j100
Change-Id: I1eb599bfec8e1841af43c43ca1c505233cb87c3d
2017-10-26 14:10:23 -07:00
Christine Franks
3d1d4a6628 Move color mode to DisplayTransformManager
Bug: 68159303
Test: make -j100 && make RunSettingsRoboTests -j100

Merged-In: I6cb3287ab4a8043e41765d55da24914f1744dcfa
Change-Id: I6cb3287ab4a8043e41765d55da24914f1744dcfa
2017-10-26 13:11:58 -07:00
Doris Ling
ed4685fafb Update activity titles for fragments without preference screen.
1. Move getPreferenceScreenResId() from individual subclass to
InstrumentedPreferenceFragment.

2. Removed InstrumentedPreferenceFragment.getTitle() and let the
preference fragments that do not have preference screen set the activity
title directly instead.

3. Removed OptionsMenuFragment as all it does is call
setHasOptionMenu().
- changed subclasses of OptionsMenuFragment to extend from
InstrumentedPreferenceFragment directly.
- none of the exisitng subclasses actually implements the option menu
related methods to provide any option menu. So, the setHasOptionMenu()
call is not added to the subclasses.

4. Update Languages preference title.
- launch the fragment from the preference controller instead of from the
default handling, as we need the title res id at launch time to get it
work properly when retrieving the title from back stack.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Ibecdcab32cbaed8bf604ec5ebe0a926b4e489a7d
2017-10-26 12:01:06 -07:00
Fan Zhang
f2b3825a09 Merge "Add a test to enforce unique id for preferences (in search)" 2017-10-26 18:50:05 +00:00
Xiangyu/Malcolm Chen
d254d4603f Merge "MSIM support for Wi-Fi calling setting." 2017-10-26 17:59:27 +00:00
Romain Guy
9143fb26b4 Add new color mode setting
Replace the "vivid" mode setting with a new 3 choice screen:
- Natural (sRGB)
- Boosted (sRGB + 10% saturation)
- Saturated (unmanaged, colors are assigned the native color space)

The "Colors" setting that replaces "Vivid" only appears on devices
that support wide gamut rendering and color management. Changing
the color mode has an immediate effect and triggers a configuration
change in running application so that applications that request
wide color gamut rendering can react properly (since they lose
that ability).

Bug: 68159303
Test: make RunSettingsRoboTests
Merged-In: I7009723e11ee164c93719f0e42fed9d1b3cf6e01
Change-Id: I7009723e11ee164c93719f0e42fed9d1b3cf6e01
(cherry picked from commit 05fa18f847)
2017-10-26 10:09:34 -07:00
Jeffrey Huang
9e1570c5f3 Merge "Introduce MemoryUsagePreferenceController" 2017-10-26 16:51:07 +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
TreeHugger Robot
2bb74379e5 Merge "Update preference screen title." 2017-10-25 20:30:31 +00:00
Christine Franks
7f3176aceb DO NOT MERGE - Move color mode to DisplayTransformManager
am: cd2b7aea5f

Change-Id: I1ebad738c64493b1929b2eb299b41c1bb365f6fe
2017-10-25 20:23:06 +00:00
jackqdyulei
88a4b0b0e5 Move the bluetooth icon logic to settingslib
This cl contains the moving about:
1. Several methods in Bluetooth/Utils.java
2. Bluetooth icon drawables
3. Bluetooth strings
4. Tests

Bug: 65488978
Test: RunSettingslibRoboTests

Change-Id: I682daa3eeb5022beb90a95763c70d19d32d54915
2017-10-25 12:49:59 -07:00
Christine Franks
cd2b7aea5f DO NOT MERGE - Move color mode to DisplayTransformManager
Bug: 68159303
Test: make -j100 && make RunSettingsRoboTests -j100

Change-Id: I6cb3287ab4a8043e41765d55da24914f1744dcfa
2017-10-25 12:42:23 -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
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
Jeffrey Huang
9d31fa4c8f Merge "Update DeviceModelPreferenceController" 2017-10-25 17:17:08 +00:00
Fan Zhang
f2ba1167c5 Merge "Only allow Settings app launch search result page" 2017-10-25 16:47:44 +00:00
Chia-I Wu
c60a52b9aa Merge "Add new color mode setting" into oc-mr1-dev am: 94aa05059d
am: c892a3cfc9

Change-Id: I971cf848dd70597c97270a008912c099c6bd24db
2017-10-25 04:55:14 +00:00
Chia-I Wu
c892a3cfc9 Merge "Add new color mode setting" into oc-mr1-dev
am: 94aa05059d

Change-Id: I31d9b51c1299564546a61a708f2058a815dd2974
2017-10-25 04:38:57 +00:00
TreeHugger Robot
2f83dc76b6 Merge "Rename files for consistency." 2017-10-25 02:36:36 +00:00
Daniel Finchelstein
9c07451786 Rename files for consistency.
Test: CTS (API2 tests)

Change-Id: I8a079525499e564c438281fcf5b3ef8333925f5b
2017-10-24 17:54:33 -07:00
jeffreyhuang
c57f18d853 Introduce MemoryUsagePreferenceController
- Use a hard-coded preference instead of injecting
 so that search can index the preference
 - Create a preference controller to update the summary

Change-Id: Idf822ccbb7a58a9ec561d5c2c2948dbc3272544f
fixes: 36463051
Test: Manual using settings app
2017-10-24 16:52:36 -07:00
Fan Zhang
25f29bf126 Only allow Settings app launch search result page
Bug: 68199963
Test: robotest
Change-Id: I0018e9c60b0dd46fc2420a563a93b706bf252dc4
2017-10-24 16:27:47 -07:00
Romain Guy
05fa18f847 Add new color mode setting
Replace the "vivid" mode setting with a new 3 choice screen:
- Natural (sRGB)
- Boosted (sRGB + 10% saturation)
- Saturated (unmanaged, colors are assigned the native color space)

The "Colors" setting that replaces "Vivid" only appears on devices
that support wide gamut rendering and color management. Changing
the color mode has an immediate effect and triggers a configuration
change in running application so that applications that request
wide color gamut rendering can react properly (since they lose
that ability).

Bug: 68159303
Test: make RunSettingsRoboTests
Change-Id: I7009723e11ee164c93719f0e42fed9d1b3cf6e01
2017-10-24 22:19:09 +01:00
Fan Zhang
89b8e5c103 Deprecate resId field in SearchIndexableResources
Change-Id: Ie69a68beae51e35c7bc861cd124d8195c1ed39dd
Bug: 37741509
Test: robotests
2017-10-24 09:59:16 -07:00
Rajeev Kumar
331a4459f0 resolve merge conflicts of ac0fd76521 to master
Change-Id: I260f92df29e737736e4c0f531656417a202ee607
Test: I solemnly swear I tested this conflict resolution.
2017-10-23 22:36:09 -07:00
Rajeev Kumar
ac0fd76521 Remove SearchIndexProvider from DataPlanUsageSummary fragment.
am: dd8e66fa20

Change-Id: I0b27a9c68a17f87876d477bad0d10b270aecd550
2017-10-24 05:01:49 +00:00