Merge commit '2c10b5f483f832523305c11d44035fc7f5d9a54b'
* commit '2c10b5f483f832523305c11d44035fc7f5d9a54b':
Make all static methods in SearchManager non-static.
They were only static because of a now removed restriction that
only activity contexts could instantiate SearchManager.
This only changes hidden APIs, but all users of the changed methods
must be updated to use them non-statically before this is submitted.
Merge commit '5c1c40d28cb4c0dc5efbdb6e9e695685044606e9'
* commit '5c1c40d28cb4c0dc5efbdb6e9e695685044606e9':
add feedback test with gsm7bit special case characters
Fixes http://b/issue?id=1905863
This is needed to address two security issues with global search:
http://b/issue?id=1871088 (Apps can read content providers through GlobalSearch)
http://b/issue?id=1819627 (Apps can use GlobalSearch to launch arbirtrary intents)
This also fixes http://b/issue?id=1693153 (SearchManager.OnDismissListener
never gets called)
To fix the security issues, GlobalSearch also needs to require
a non-app permission to access its content provider and launch intents.
Merge commit '174ad503ee5b24721d7d632ba9c68b9cd0bd6dd6'
* commit '174ad503ee5b24721d7d632ba9c68b9cd0bd6dd6':
In SearchablesTest, use the always available globalsearch.
The earlier used googlesearch package may not be available in some devices so switching to globalsearch which has searchable info relevant for this unit test.
Merge commit 'f9acde27486bcc6eea1092073f7b47c31749efd6'
* commit 'f9acde27486bcc6eea1092073f7b47c31749efd6':
Include web search providers in Searchables.
- Along with ACTION_SEARCH we now enumate ACTION_WEB_SEARCH as well so web search providers are covered in the searchables list. This fixes a broken unit test.
- Moved get/setPreferredWebSearchActivity and get-all-web-search-providers implementation to this module when the searchables list gets updated, so that it happens on boot and on package add/remove events and remains up to date. The duplicate code in WebSearchProvider will be removed in a separate change.
- Also made Searchables broadcast an intent when the searchables list got rebuilt, so components such as GlobalSearch/SuggestionSources no longer need to do this on their own.
Before, the variants of MemoryFile.MemoryInputStream.read() would throw
IOException or IndexOutOfBoundsException if EOF was encountered
before the requested number of bytes was read. This violates
the contract of InputStream.read().
This patch makes read() return the number of bytes available, if any.
If already at EOF, -1 is returned. The patch also adds new tests,
which checks cases where MemoryFile.MemoryInputStream.read()
should throw IndexOutOfBoundsException or return -1. several of these
tests failed with the old code and pass now.
This fixes http://b/issue?id=1881894
This allows content providers to use in-memory data to implement
ContentProvider.openAssetFile(), instead of just normal files
and sockets as before.
To test cross-process use of AssetFileDescriptors for MemoryFiles,
a test content provider and a client for it are added to
AndroidTests.
Fixes http://b/issue?id=1871731
Merge commit 'c665349543b481b14e423ea9e7e2b368569ae311'
* commit 'c665349543b481b14e423ea9e7e2b368569ae311':
support more minor cdms sms bearer data subparameters
As reported in http://b/issue?id=1398215 MemoryFile did not
munmap(2) the ashmem region after closing it. This
causes the process to leak virtual address space.
This change fixes the problem by calling munmap(2) in
close(). The unmapping is done by a helper method deactivate().
The change also replaces the use of an int for the
file descriptor with a FileDescriptor object to
make sure that we keep track of when the file descriptor
has been closed. I chose to implement it this way because I
will need decativate() and a FileDescriptor object in an
upcoming change that allows sending MemoryFile file
descriptors between processes.
The change also adds a number of tests for the behavior
of close(). The testCloseRead() and testCloseWrite() fail
with the old MemoryFile implementation, and testCloseLeak()
causes a segfault. They all pass now.
Merge commit '5bc21aa0671d83e406b46e0431816dea8d9ca5cb'
* commit '5bc21aa0671d83e406b46e0431816dea8d9ca5cb':
SmsHeader rewrite, in preparation for migration to public API.
See http://b/issue?id=1751571
Changes the semantics of SmsHeader from containing only opaque data
to exposing occurs-once frequently-used fields together with a list
of opaque fields. Also changes the coding to and from byte array to
be symmetrical, whereas previous encoding had an extra length field.
Cdma SmsMessage -- cleanup of code paths along with adjustments to
match the new header semantics, which should address at least some
of the issues with concatenated messages. See http://b/issue?id=1809759
Merge commit '5615d35b28119865cd65a79814a69f910e0a3862'
* commit '5615d35b28119865cd65a79814a69f910e0a3862':
Add tests for the new SQLite _TOKENIZE() 'tag' column.
Merge commit '6342d3936ad8c9e6cf5bba1fc88c4e9338391bb4'
* commit '6342d3936ad8c9e6cf5bba1fc88c4e9338391bb4':
Change _TOKENIZE tests to test the new token_index column
The SQLite _TOKENIZE function has been changed to use a third
column, token_index. This commit adds tests for the
_TOKENIZE token_index column, and for the source column,
which was previously untested.
- Removes the mSearchable field which was only
for communication between the constructor and
getActivityMetaData().
- Removes the badge and query rewriting fields,
since their values can be efficiently computed
on the fly.
- Makes all the other public fields private and adds getters
for them.
- Makes all fields final, except mActionKeys.
- Removes the DBG_INHIBIT_SUGGESTIONS_CONSTANT.
I don't see why we would every want that, and it
complicated making the fields final.
- Makes all fields in ActionKeyInfo final.
- Makes all fields in ActionKeyInfo private and adds getters.
- Removes the use of ActioKeyInfo.mKeyCode for failure
signalling. Uses IllegalArgumentException instead.
- Replaces the ad hoc linked list for looking up
action keys by a HashMap. This is needed to
make the fields in ActionkeyInfo final, and also avoids O(N)
lookup in the (unlikely) case that an activity
has lots of action keys.
- Don't throw exceptions when reading searchable
meta-data, since that could crash SearchManagerService.
- Adds debug logging.
related to issue http://b/issue?id=1782245
- fixes 7bit ASCII encode and decode (previous completely broken)
- also consolidates encoding of user data, and changed to match
the conventions of the new data coding -- previously likely
broken for several cases
Merge commit 'd30605200b8b0f10e4740a9d7266d240023e69cd'
* commit 'd30605200b8b0f10e4740a9d7266d240023e69cd':
enable additional cdma sms fields and user data encodings
The attribute is not yet public.
Also adds a SearchManager method for listing all
searchables that can be included in global search.
This is the framework part of http://b/issue?id=1819651