Commit Graph

48 Commits

Author SHA1 Message Date
Jason Monk
ef71f605f3 Don't crash settings when out of space.
Change-Id: I2e36fe845601558d789f38ae9f70d1a1684d8fd4
Fixes: 28198128
2016-04-29 13:51:08 -04:00
Jason Monk
18fbdd023b Fix search after upgrade
Settings was dropping the search tables after upgrade but not
clearing the bit that says a full index has completed.

Change-Id: If49960b8cc07e72127bac211ae4d6c1f25b71c81
Fixes: 28414461
2016-04-28 10:08:29 -04:00
Jason Monk
6c9e884aa0 "Fix" search
- Only consider a locale actually indexed after it has had a full
   update run
 - Run all indexing queueing on the AsyncTask's serial threadpool
   to avoid more threading issues.

Change-Id: I8fc84b0faafc5c104d090b6bbd87857550b3af89
Fixes: 27826745
2016-04-14 14:34:16 -04:00
Alan Viverette
35c3454808 Allow use of comma to separate search keywords, update keywords
Bug: 26149710
Change-Id: I2d8095bbb007c011d7b3e2fe077115c696f9e39c
2015-12-15 09:50:44 -05: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
dff3faaf30 Fix bug #19313587 Settings unusable when userdata is full
- take care of low storage space use case: do not start
and Index update if we are is low storage space situation.

Change-Id: Ifa5bb618d087826c004b06aa7821b9634038734c
2015-02-27 11:14:11 -08:00
Alex Klyubin
cc254f4da9 Hidden ApplicationInfo flags are now in privateFlags.
See b9f8a5204a1b0b3919fa921e858d04124c582828.

Change-Id: I98bbe4b1a5ac0939e0000e4da8b21a1964c75e8b
2015-02-11 11:10:12 -08:00
Fabrice Di Meglio
0535ed559e Merge "Fix bug #17393417 Developer Options are not indexed after activating them" into lmp-dev 2014-09-04 22:09:19 +00:00
Fabrice Di Meglio
f91b4dbc33 Fix bug #17393417 Developer Options are not indexed after activating them
- add forceUpdate field copy in the UpdateData copy constructor

Change-Id: I245ce76bf9798c359219e153d2af9d08e7e11903
2014-09-04 15:04:23 -07:00
Fabrice Di Meglio
14be7d23a2 Fix bug #17208479 Have Cellular Networks Show up in Data Usage
- prevent collisions in the DocId (which is the primary key of
the FTS4 table)
- instead of just using "updatedTitle" hash, use instead
"updatedTitle + screenTitle"

Change-Id: If38f7bcc7fb857d59242d08c16c39adb80590254
2014-09-02 18:31:10 -07:00
Fabrice Di Meglio
72e07cf21c Fix bug #17250939 Stability: ANRs in Settings: at com.android.settings.search.Index.updateInternal(Index.java:518)
- do not care about getting a result for updating the Index as
there is no way to make it useful (the result will come later
when this is no more relevant)
- make a copy of the data to process and pass it to the AsyncTask

Change-Id: I6b8a08ecbe3d32cffac1314c03f682ebacfd64bf
2014-08-29 17:44:52 -07:00
Fabrice Di Meglio
9a60d7b569 Enforce the presence of the Indexable interface for Indexing
- check that the Indexable interface has been defined before indexing

Change-Id: Ia61915b2bd1240226ba560ecfd883a115b49da95
2014-07-24 19:53:47 -07:00
Fabrice Di Meglio
9301441e2a Code cleaning for Index
- make that UpdateData class static

Change-Id: I22ac148613fcaa4ed3ad615c4eca037b5dc6b986
2014-07-23 15:35:33 -07:00
Fabrice Di Meglio
e6b336d1a0 FR #14318673 Search - add synonyms
- add synonyms to be indexed at the same time as titles and sub-titles
- fix Wi-Fi keywords

Change-Id: I1cb026775592c29c2b813153574c6695e3e90f31
2014-07-10 15:05:51 -07:00
Fabrice Di Meglio
957ccf30b9 Search - add support for saving the UserId in the Index - part 2
- get UserId for remote SearchIndexablesProvider and put it into
the Index too

This CL depends on that Framework CL: a0791edf01524be7c9ae819b11c05e8191a97ded

See bug: ##15837747 Search - update for Enterprise support

Change-Id: I47789aa02545bbacc68468cabfb32a253003ec5b
2014-07-10 12:16:02 -07:00
Fabrice Di Meglio
d17a15bbc4 Search - add support for saving the UserId in the Index
- add the new "user_id" colum
- use -1 as a default value

This CL depends on that Framework CL for SearchIndexableData: 0d94539e67e997ed7687f33854fc581ce4668da5

See bug: #15837747 Search - update for Enterprise support

Change-Id: I0cf2866600732e8e99006050bf9ad388fa44b509
2014-07-10 16:39:43 +00:00
Fabrice Di Meglio
b86a2bc745 FR #16136331 Search - results should be ordered with match on Title and then on SubTitle
- issue two queries instead of one. The first is for matching on the Title
and the second is for matching on the SubTitle (but use EXECEPT clause for
filtering out the potential dupe results that may be coming from the Title)
- use a MergeCursor for aggregating the two Cursor

Change-Id: I0ba4bb227dbd4a113348da8ed788ca7cded986fb
2014-07-08 11:03:14 -07:00
Fabrice Di Meglio
c6dacf5e56 am c9548c17: Merge "Fix bug #15460001 "Cell broadcasts" setting search suggested in wifi only device though setting is not present" into lmp-preview-dev
* commit 'c9548c17471ff7d7826a769593250ca3467a2ba5':
  Fix bug #15460001 "Cell broadcasts" setting search suggested in wifi only device though setting is not present
2014-06-07 10:01:14 +00:00
Fabrice Di Meglio
dba577f8f0 Fix bug #15460001 "Cell broadcasts" setting search suggested in wifi only device though setting is not present
- implement a BaseSearchIndexProvider for WirelessSettings
- fix Context passed to the Index: now use an ApplicationContext
- also use the correct Context when dealing with Settings SearchIndexProvider
- also makes impossible a rogue BaseSearchIndexProvider to crash Settings
if not well behaving
- last, fix icon used for "NFC & more" search results

Change-Id: I8b5cc999fa57a9e1977ee57394801d54cf3dbabb
2014-06-06 16:35:41 -07:00
Fabrice Di Meglio
b438c13265 am 2aa32299: Merge "Fix bug #15335840 "Safety information" search suggestion shown though ..."Safety information" setting is not available in settings app" into lmp-preview-dev
* commit '2aa322991da364b9be74a6e13a4de314765eadd1':
  Fix bug #15335840 "Safety information" search suggestion shown though ..."Safety information" setting is not available in settings app
2014-05-30 22:39:53 +00:00
Fabrice Di Meglio
b2385ea462 Fix bug #15335840 "Safety information" search suggestion shown though
..."Safety information" setting is not available in settings app

- implement a SearchIndexProvider for DeviceInfoSettings and
remove some Preference indexing depending on the device state
and configuration
- remove old non used Preferences
- some code cleaning

Change-Id: I3b2c9dc7cb9f1137b553fed9330aeea4020bd2f8
2014-05-30 15:35:06 -07:00
Fabrice Di Meglio
cac94ba246 am 2bc41e29: Merge "Fix bug #15342475 Settings search ranking improvement" into lmp-preview-dev
* commit '2bc41e29b99961cbb3d879b1b45e4b14d8a5f3e1':
  Fix bug #15342475 Settings search ranking improvement
2014-05-30 21:33:47 +00:00
Fabrice Di Meglio
eed44c9d5f Fix bug #15342475 Settings search ranking improvement
- introduce the "base rank" concept. All SearchIndexablesProvider
will have a base rank and the Settings one will get a "0" base rank.
- use a map whose key is the authority name for the provider to get
and store the base rank
- if a base rank is not defined, use the current max defined one and
increment it to define the new one.

Then we will compute the real rank this way:

rank = (providerRank > 0) ? baseRank + providerRank : baseRank

Change-Id: Ifa82bfcdfc07f25c4a5f304f47550686f7d4c13d
2014-05-30 14:05:32 -07:00
Fabrice Di Meglio
363348dd8b FR #15314612 - Enable search on non accentuated chars
- update normalization step. Use a Normalizer for a string
decomposition to the NFD form and remove those diacritics with
a "\\p{InCombiningDiacriticalMarks}+" pattern.

See bug #15314612 Search - need to be able to search and have results
with non accentuated chars

Change-Id: Ifaf4cd2ca2fb712e1c6f5f5272f942dda99464e4
2014-05-28 16:20:38 -07:00
Fabrice Di Meglio
a8ac78b392 Search - prepare for better normalization
- code refactoring

See bug: #15314612 Search - need to be able to search and have results
with non accentuated chars

Change-Id: Ic3eb94c0effccf6592c02b3eaa78bf26a2d09714
2014-05-28 15:56:30 -07:00
Fabrice Di Meglio
b58b28e13e Fix bug #14494292 Settings>Search>Recent searches keep on populating the same keyword if it is searched again
- do the right thing: remove the previous search queries from the Database if needed
so that there will be no dupe

Change-Id: I707eb518ea7c2a64b1407c62ff164e249fe03fa9
2014-05-20 16:31:52 -07:00
Fabrice Di Meglio
55638cb6c6 Fix NPE when going into WiFi Settings
- this was occuring when updating the Index for remembered WiFi networks

Change-Id: Ifc8f843499e09150685a8dd9bfb705459f28c067
2014-05-09 20:07:13 -07:00
Fabrice Di Meglio
d297a58402 Add saved Search queries feature
- update SearchResultsSummary fragment to have two lists:
one for Search suggestions (saved queries) and one for
Search results
- a tap on a saved query will launch that Search query
- show the list of saved queries when tapping on the SearchView
- do some fancy hidding / unhidding of the saved queries list
and results list

Change-Id: If15055ab78b0ec5eef4e543173dc7b866bd08e27
2014-04-23 10:35:10 -07:00
Fabrice Di Meglio
b7390ba585 Fix missing summary for CheckBoxPreference
- "summaryOn" and "summaryOff" were parsed but we were missing
also "summary"

Repro case: search for "adt" (from Developer options)

Change-Id: Ifa829ec6c6f86cb426432f716c2d28df8550f9ea
2014-04-21 16:40:48 -07:00
Fabrice Di Meglio
8f5c65fd01 Search results - just show the first item of ListPreference entries
- need to increment the database model version to force re-indexing
- change entries separator from SPACE to PIPE
- just show the first entries value in the Search results

Change-Id: I747218ff3528c3231c0209f8870c12f65e036070
2014-04-15 14:09:25 -07:00
Fabrice Di Meglio
490099b135 Allow partial Index rebuilding thru updateFromClassNameResource(...)
- add a new boolean parameter to ask for Index rebuilding:
passing "true" will delete first all the data corresponding to the
"className" and then apply the update.

Change-Id: Ifc42fc560a14f5470b466cf6982915d9207fa3c7
2014-04-14 13:31:14 -07:00
Fabrice Di Meglio
724b702a86 Search - add support for deleting all preferences for a class name
- modify SQL delete query for passing any column in the DELETE statement
- modify deleteIndexableData(...) for passing a SearchIndexableData

Change-Id: I4c58e38422e67b1d464b0e51201520ce8717a14d
2014-04-14 11:24:16 -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
Svetoslav
caa0b54cbc Fallback to the default values when indexing from local resource.
If we are indexing from a local resource and the indexable resource does
not provide icon or class name or rank we fall back to the defaults.

Change-Id: Ibbed8b2a92e28799c26f5f80b3f058737535739d
2014-04-11 16:06:41 -07:00
Fabrice Di Meglio
45f754e506 Add Indexable.SearchIndexProvider.getNonIndexableKeys(Context)
- getNonIndexableKeys(Context) allow a SearchIndexProvider to tell which data
he does not want to index by providing a list of the data keys
- use this new API for SoundSettings and removing KEY_EMERGENCY_TONE related
settings if the device is not CDMA
- add a BaseSearchIndexProvider for code simplification

Change-Id: I23633ace1d7e390ee05fac0a5458a33e04e72d8d
2014-04-11 11:16:33 -07:00
Fabrice Di Meglio
a9d37050cb Some code refactoring
- use SearchIndexableResources.NO_DATA_RES_ID
- extract code for getting a SearchIndexProvider

Change-Id: I3d31cc58f70b9b0abfa6684d9d20b19534ec5e45
2014-04-10 17:58:27 -07:00
Fabrice Di Meglio
b1648e6c54 Fix bug3 13933442 Search - for security reasons only index data...
...from wellknown SearchIndexablesProvider

Check if the SearchIndexablesProvider is:

- having the correct android.permission.READ_SEARCH_INDEXABLES
read/write permissions
- a privileged one (like Settings App, Phone App)

Change-Id: I5fd1fef46716cca0e439196e24b607ff5506495c
2014-04-09 16:24:10 -07:00
Fabrice Di Meglio
b914322590 Code cleaning for Search Remote Provider queries
- use colums indices that are now defined into SearchIndexablesContract
- ... and at the same time fix an issue with some wrong column indices
that were used

Change-Id: If72ddc7d7171329ca533cb2763431902099769b9
2014-04-09 13:30:50 -07:00
Fabrice Di Meglio
7d39310c8d Fix bug #13928293 Search - remove "switchTextOn" / "switchTextOff" from indexing
- remove all related code
- update the Index database schema and its version

Change-Id: Iaa5219b77efe5db3a404708663fdf82f10d043d3
2014-04-09 12:09:42 -07:00
Fabrice Di Meglio
3b22695670 Fix issue about at which time Bluetooth devices name are indexed
- remembered devices name were only indexed when BT was turned on/off
- allow the same when they are paired
- remove device name from the Index if it is un-paired

Change-Id: I1206a591b0132789c3b003e52c7ffac630e80758
2014-04-08 17:49:01 -07:00
Fabrice Di Meglio
c1457323d2 Add support for saving and using the Preference's key value
- modify the SQlite data model
- update Index code for managing the key value
- pass the key when launching a Fragment or and Activity
- implement a small animation for highlighting the Preference
from a Search result

Change-Id: I617643a4e5e3b752ece8f45ce7d5429037e479da
2014-04-08 13:08:44 -07:00
Fabrice Di Meglio
dd41dfc483 Add indexing for SwitchPreferences
- now support the SwitchPreferences and save the "switchOn" and "switchOff"
attributes
- update Index database schema (and increment its version)
- fix an issue with some previous schema not rebuilt

Change-Id: I9cd48c666525f19474ef9bd5746d61b589058063
2014-04-02 19:37:39 -07:00
Fabrice Di Meglio
a41707200b Add indexing for ListPreferences
- now support ListPreferences and save the "entries" attribute
- update Index database schema (and increment its version)
- do some clever stuff when showing Search results: if there is
a "$s" or "%s" in the summary (replacement strings), just use
the entries instead

Change-Id: If36595c3816706b6349faff7d3c2e725d3ea33f4
2014-04-02 19:05:45 -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
d25314d330 Settings - update for new UI (no more Drawer)
- follow the UX spec by no more using a Drawer
- the Dashboard is now a Fragment that contains the list of Headers
- the search results are also put into a Fragment that is replacing
the initial one (Dashboard or other) when expanding the SearchView
- use a SearchView for query input
- when tapping on a Header or a Search Result, re-launch Settings as
an Activity so that we are benefiting from the Activity stack for
UP affordance and BACK button
- manage UP affordance to show it only when needed
- move some Actions to the Menu in the ActionBar for allowing space
to the Search action and removing some clutter
- fix an issue with the Index and WiFiEnabler and their cached Context
that was not updated when there was a Configuration change
- simplify the SettingsActivity code by extracting some inner classes

Change-Id: I50b5f77bb44a7fade1886114dbbc820609a5e63d
2014-03-28 15:51:29 -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