Commit Graph

41 Commits

Author SHA1 Message Date
Viesturs Zarins
99631a11ec Merge "Add searchable metadata attribute for injected tiles." into udc-qpr-dev am: 5bc1e9b38f am: 68fede37a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24792152

Change-Id: Iffe2d746713a2b7f03261ba02ecbce2713546e7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-26 10:30:22 +00:00
Viesturs Zarins
40765c7763 Add searchable metadata attribute for injected tiles.
Allowing the injector to directly control search behavior for their tiles.

Bug: b/299430183
Test: robotest, manual
Change-Id: I21915978d6722998a45741410cca72448aacf2e0
2023-09-25 08:24:01 +00:00
Chaohui Wang
58f0ee30fc Remove context from dashboardFeatureProvider
DashboardFeatureProviderImpl is created by using application context,
no need pass context in when get.

Bug: 286764889
Test: m Settings
Change-Id: Ia9672dfd9d3d71f64735cbc5979a6ad57c9429d3
2023-07-20 12:21:16 +08:00
Jason Chiu
e427cc6752 Search experience improvement for large screen
- Support fragment and direct link in SearchResultTrampoline
- Start activity for SI case and start deep link trampoline for others
- Disable menu highlight whenever the search bar is clicked
- Don't overwrite SettingsApplication's homepage activity in
  SliceDeepLinkHomepageActivity
- Scroll to highlighted menu entry after homepage is loaded to prevent
  UI overlapping

Bug: 201724410
Test: manual, robotest build pass
Change-Id: I5115d17d829e85036000da2e80f0e5b0598c733f
2021-11-03 18:44:01 +08:00
Jason Chiu
1ee1911104 Skip indexing dynamic and injected raw data when page search is disabled
Test: robotest
Fixes: 188059978
Change-Id: I99c86ee12c7696123df26c47cfed8c3ddfbdf353
2021-05-20 06:34:08 +00:00
Yanting Yang
c54002e192 Add custom site map pairs into SettingsSearchIndexablesProvider
Settings Search need Settings to provide custom site map pairs to build
up full breadcrumb for the search results from ScreenLockSettings,
WallpaperSuggestionActivity and WifiSettings2.

Bug: 147851992
Bug: 151206664
Test: manual test with Settings Search, robotests
Change-Id: Ide6e69b3336af255a388737d46147f2fc2ef9790
2020-03-26 23:04:33 +08:00
Yanting Yang
298a7fe2e5 Remove the index of the homepage category tiles
Do not index the tiles of homepage category since we would like to index
their target activity for search.

Fixes: 151418948
Test: visual
Change-Id: I693534de006b4dbcaf192858e6f7d031bad78fef
2020-03-17 17:55:49 +08:00
TreeHugger Robot
c050807cdc Merge changes from topic "query_nonpublic_slices"
* changes:
  Enable Settings Search to query private Slices.
  Add the impl for the ability to query non-public Slices
2019-11-27 11:09:31 +00:00
Jason Chiu
05599b89d2 Make Settings self-injected toggle switch searchable
- only skip ActivityTile
- skip items that has no static title

Bug: 132812768
Test: robotest
Change-Id: Idb3c111966c1dd96e2886aca2c7ead3b57ba119e
2019-11-27 17:11:26 +08:00
Yi-Ling Chuang
15da32c33f Enable Settings Search to query private Slices.
The base Uri is now determined by whether a certain config string is set
or not. When the config is set, Settings Search will then be able to
query private Slices, otherwise we'll just provide public ones.

Bug: 141088937
Test: rebuild
Change-Id: I63b689de4491b664a2d6f88867fbbb9b1da38277
2019-11-26 17:08:50 +08:00
Raff Tsai
a1678dade1 Add dynamic injection item to site map
- That will make injection able to build site map

Bug: 143116297
Test: manual
Change-Id: Ic07280519bb7f904a3e80e172b6cb8785b94616f
2019-11-12 17:06:36 +08:00
Stanley Wang
79eaa655ef Refactor SettingsSearchIndexablesProvider.
- Extract the adding raw indexable columns
  to createIndexableRawColumnObjects method.
- Refactor the getInjectionIndexableRawData
  method for query injection data.

Test: manual
Fixes: 144007045
Change-Id: I9c028818dcaff165c3b7f8d495f6002370cd30fa
2019-11-07 10:36:04 +08:00
Raff Tsai
c5e1fc677c Integrated SearchIndexableResources interface in Settings
- New SearchIndexableResources interface returns SearchIndexableBundle,
we don't need reflection to get SearchIndexableProvider

Bug: 135053028
Test: robolectric, check database search_index.db items
Change-Id: I5ed3416ccf72ef3d38db817fcb4aff7502649ed4
2019-11-05 17:38:32 +08:00
Stanley Wang
5bad457e91 Add query dynamic indexable data to SettingsSearchIndexablesProvider
- Add getDynamicSearchIndexableRawFromProvider method.
- Extract the injection indexable part to the
  getInjectionIndexableRawData method.
- Extract the getting indexable provider part to the
  getIndexableProviderValues method.

Test: manual
Fixes: 143741131
Change-Id: Idbf5b5419c0b78e0586e9c8d611dd51013eb0971
2019-11-01 16:15:23 +08:00
Jason Chiu
d0fa488304 Fix the inverted logic of indexing injected entries
The if statement was misplaced while changing the coding style in
previous CL.

Bug: 132812768
Test: manual
Change-Id: I01a2494bf8103c806ec9b3cbd1ff9f8b8c01aebe
2019-10-24 15:41:51 +08:00
Raff Tsai
d041c32e5e Make injected entries searchable
Add a injected item in queryDynamicRawData. SettingsIntelligence will
query this method in query time.

Fixes: 132812768
Test: manual
Change-Id: I4e2f56e86537930e3102280f7e8dc7691ea1ec4e
2019-10-19 07:53:49 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Stanley Wang
dbcdb95daa Implement slices api of SettingsSearchIndexablesProvider
add querySliceUriPairs method to  provider

Fixes: 129322803
Test: manual and robotests
Change-Id: I9255ed6dba5b8b1fc79caa3026c8b31924c95f4b
2019-03-29 15:02:03 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
60243e6873 Remove custom tintable check.
Make a bunch keys private in tile and DashboardCategory
Bug: 77600770
Test: robotests
Change-Id: I4693e6bb71bd50cc664f578c7f8e25e67da20b67
2018-08-03 16:38:36 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -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
Ben Lin
4d163fcc93 Add capability for OEMs to supply their own SearchIndexableResources.
This moves SearchIndexableResources to be supplied by FeatureFactory
rather than its own singleton, which in effect allows OEMs to supply their
own, in the case where they have their own classes they want to be
indexed (or, remove certain classes that used to be indexed).

Bug: 72179744
Test: All tests pass.

Change-Id: Ia06b2026df7eca4c53b44a5a589c4aaa0b69d96c
2018-01-19 11:49:51 -08:00
Doris Ling
bcb76351b3 Fix ConcurrentModificationException in SummaryLoader.
When the dashboard summary is being initialized, it will rebuild the UI
while the summary loader tries to to go through the tiles to update the
summary. Both is being done on a separate backgroud thread, and it will
run into concurrent modification issue if the thread is being swapped
while one is looping through the list.

Instead of letting clients access the list of tiles directly, add a
getter method in DashboardCategory to get a copy of the list of tiles
for all read-only operations.

Change-Id: I479669abd8d1d0a8ee9a4113d8ad2244da56f4d8
Fixes: 69677575
Test: make RunSettingsRoboTests
2017-11-28 16:43:07 -08: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
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
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
465d79776f Improve search indexing time.
- Some import clean up.
- Add timing log to track indexing time breakdown.
- Remove isAvailable() from UserDictionaryPreferenceController.

Bug: 36391685
Test: rebuild
Change-Id: If154c5dafba5d21cb1020497c44fbf67f03ad820
2017-07-18 14:53:49 -07:00
Matthew Fritze
473b6b45de Add public intent filters to indexing
Adds a public intent action to the index so that intents
can be created for callers outside of settings.

Change-Id: I9f87263f213b6de40542e8735c931ee1f0d82094
Fixes: 63136008
Test: make RunSettingsRoboTests
2017-07-06 23:12:21 +00:00
Matthew Fritze
2078bc2358 Remove search2 package and put everything into search
Change-Id: Ie8651c79ef023f154cd7120a88a20f3481abce2b
Fixes: 38502743
Test: make RunSettingsRoboTests
2017-05-23 13:57:28 -07:00
Matthew Fritze
4f198813ed Prevent empty non-Indexable keys from being added
Change-Id: I688cd5243bb1651d60f74e168a84ddf8723816e3
Fixes: 37646265
Test: make RunSettingsRoboTests
2017-05-02 10:42:07 -07:00
Matthew Fritze
2108f91fe6 Implements queryNonIndexableKeys for Settings
queryNonIndexableKeys returns a list of all of the
non-indexable keys for all providers in Settings

Change-Id: Id53cb2f55662e85c66f1c3f0c0e7d933b19fedaf
Fixes: 34623460
Test: RunSettingsRoboTests
2017-01-25 14:33:45 -08:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Fabrice Di Meglio
09e13da6a7 Some code cleaning
- use MatrixCursor var as in the other cases

Change-Id: Iba1163a851e62de9a0dd6e7c1c5d28f06452bdba
2014-04-14 17:01:02 -07:00
Fabrice Di Meglio
df278aa959 Update SettingsSearchIndexablesProvider for supporting queryNonIndexableKeys(...)
- add the new requested method "queryNonIndexableKeys" from the contract

Change-Id: I72be47851a7e19e3f14960f4e2b60c3e952f1fac
2014-04-14 10:54:58 -07:00
Fabrice Di Meglio
981efd1778 Code cleaning for the SettingsSearchIndexablesProvider
- use the real constants SearchIndexablesContract.COLUMN_INDEX_XML_RES_XXX
for the colum names

Change-Id: I820ce9d3b048345365639fe049aedccaf3f203d8
2014-04-09 19:33:47 -07:00
Fabrice Di Meglio
9593782d15 Add indexing for Notifications preferences
- also add indexing of CheckBoxPreferences
- also some code cleaning

Change-Id: I2943caaec3d64fb2a6be85168454fc76fe572afe
2014-04-01 13:21:01 -07:00
Fabrice Di Meglio
51bfee595c Add dynamic Preferences indexing (part 2)
- change the Index SQL model. Add a new "enabled" column.
- use that column for issuing a more restrictive search query
- change the SearchIndexProvider API to pass the "enable" state
- apply it to Bluetooth settings
- refactor the list of indexable resources (SearchIndexableResources)

Change-Id: Ic900fb27cb12a285a80d953aa1aa88f0070cd986
2014-03-20 20:40:04 -07:00
Fabrice Di Meglio
5135dce142 Add indexing for cached Bluetooth (BT) paired devices
- comply to the SEARCH_INDEX_DATA_PROVIDER
- add to the Index the name of previously paired BT devices
(this will work for now only and only if BT has been on during
the indexing)

Change-Id: I00065db0f4e9657cca3578a2fafa0ec39cfaa432
2014-03-20 14:02:42 -07:00
Fabrice Di Meglio
fa7dc240e9 Add external Preferences indexing
- define SettingsSearchIndexablesProvider as an internal
SearchIndexablesProvider
- protect access thru using android.permission.READ_SEARCH_INDEXABLES
- update WallpaperTypeSettings and WifiSettings for taking care of
the new model
- update the Dashboard for taking care about external Icons for the
search result
- update sqlite model/version for taking care about Intents
(enable launching external applications for showing the settings)

Change-Id: I2e38599327e6480f1754f52666becce0884cee9d
2014-03-19 14:56:09 -07:00