79 Commits

Author SHA1 Message Date
Bjorn Bringert
d85e0bfaac am eed76b2a: Remove test for SearchManager activity context restriction.
Merge commit 'eed76b2a8ddc41af01cd3ae87c4722f3784c975c'

* commit 'eed76b2a8ddc41af01cd3ae87c4722f3784c975c':
  Remove test for SearchManager activity context restriction.
2009-06-22 09:56:43 -07:00
Bjorn Bringert
eed76b2a8d Remove test for SearchManager activity context restriction.
This restriction was removed in https://android-git.corp.google.com/g/4908
see http://b/issue?id=1926254
2009-06-22 16:10:41 +01:00
Android (Google) Code Review
2b31fec39c am 2c10b5f4: Merge change 4914 into donut
Merge commit '2c10b5f483f832523305c11d44035fc7f5d9a54b'

* commit '2c10b5f483f832523305c11d44035fc7f5d9a54b':
  Make all static methods in SearchManager non-static.
2009-06-22 07:26:36 -07:00
Bjorn Bringert
8d15382378 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.
2009-06-22 13:51:48 +01:00
Suchi Amalapurapu
c73e9ad55a am bc806f65: Remove deprecated api. Aptly rename freeStorageWithIntent to freeStorage.
Merge commit 'bc806f65edc33f6eda0f475ac84e5e037a013a90'

* commit 'bc806f65edc33f6eda0f475ac84e5e037a013a90':
  Remove deprecated api. Aptly rename freeStorageWithIntent to freeStorage.
2009-06-19 10:38:45 -07:00
Suchi Amalapurapu
bc806f65ed Remove deprecated api. Aptly rename freeStorageWithIntent to freeStorage. 2009-06-19 10:25:37 -07:00
Android (Google) Code Review
587c89e25b am 5c1c40d2: Merge change 4455 into donut
Merge commit '5c1c40d28cb4c0dc5efbdb6e9e695685044606e9'

* commit '5c1c40d28cb4c0dc5efbdb6e9e695685044606e9':
  add feedback test with gsm7bit special case characters
2009-06-17 15:38:39 -07:00
Tammo Spalink
0ff946e7b5 add feedback test with gsm7bit special case characters 2009-06-17 16:13:52 +08:00
Android (Google) Code Review
a28547d03f am 0fb46683: Merge change 3880 into donut
Merge commit '0fb466836bb654524683152371ecc32142cdf5de'

* commit '0fb466836bb654524683152371ecc32142cdf5de':
  Run search dialog in the system process.
2009-06-15 02:09:25 -07:00
Bjorn Bringert
8d17f3f24b Run search dialog in the system process.
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.
2009-06-15 09:05:26 +01:00
Satish Sampath
bc0df8d6a8 am 174ad503: In SearchablesTest, use the always available globalsearch.
Merge commit '174ad503ee5b24721d7d632ba9c68b9cd0bd6dd6'

* commit '174ad503ee5b24721d7d632ba9c68b9cd0bd6dd6':
  In SearchablesTest, use the always available globalsearch.
2009-06-10 07:45:53 -07:00
Satish Sampath
174ad503ee 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.
2009-06-10 12:06:46 +01:00
Satish Sampath
0d2037beb1 am 0e74aa0f: Fix broken Searchables unit tests.
Merge commit '0e74aa0f7ed90d46e0bdde02bf9b7b29c6b95bd8'

* commit '0e74aa0f7ed90d46e0bdde02bf9b7b29c6b95bd8':
  Fix broken Searchables unit tests.
2009-06-05 11:40:59 -07:00
Satish Sampath
5e23cbc660 am f9acde27: Include web search providers in Searchables.
Merge commit 'f9acde27486bcc6eea1092073f7b47c31749efd6'

* commit 'f9acde27486bcc6eea1092073f7b47c31749efd6':
  Include web search providers in Searchables.
2009-06-05 09:42:40 -07:00
Satish Sampath
0e74aa0f7e Fix broken Searchables unit tests.
The newly added code was using methods which were not overridden by the unit test, fixed now.
2009-06-05 15:40:49 +01:00
Satish Sampath
f9acde2748 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.
2009-06-05 10:34:53 +01:00
Bjorn Bringert
b15a5348e6 am c1823701: Handle EOF correctly in MemoryFile input stream.
Merge commit 'c1823701cc76790494fb622fe58f0942236cd7d0'

* commit 'c1823701cc76790494fb622fe58f0942236cd7d0':
  Handle EOF correctly in MemoryFile input stream.
2009-06-03 04:56:52 -07:00
Bjorn Bringert
c0cbfda0fe am 963cd006: Allow creating AssetFileDescriptors for MemoryFiles.
Merge commit '963cd006c45716b034f656bf7e7179e6476f7e4d'

* commit '963cd006c45716b034f656bf7e7179e6476f7e4d':
  Allow creating AssetFileDescriptors for MemoryFiles.
2009-06-03 04:56:49 -07:00
Bjorn Bringert
c1823701cc Handle EOF correctly in MemoryFile input stream.
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
2009-06-03 12:53:42 +01:00
Bjorn Bringert
963cd006c4 Allow creating AssetFileDescriptors for MemoryFiles.
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
2009-06-03 12:53:42 +01:00
Android (Google) Code Review
cf2924efa0 am c6653495: Merge change 1522 into donut
Merge commit 'c665349543b481b14e423ea9e7e2b368569ae311'

* commit 'c665349543b481b14e423ea9e7e2b368569ae311':
  support more minor cdms sms bearer data subparameters
2009-06-02 00:59:50 -07:00
Tammo Spalink
baae313f89 support more minor cdms sms bearer data subparameters
- also clean up CdmaSmsAddress
2009-06-02 11:10:53 +08:00
Bjorn Bringert
0ad6dc0ebc am 761e0918: Unmap memory in MemoryFile.close().
Merge commit '761e0918d30b6a3f292625b44b86dffd1538bc78'

* commit '761e0918d30b6a3f292625b44b86dffd1538bc78':
  Unmap memory in MemoryFile.close().
2009-05-29 06:48:43 -07:00
Bjorn Bringert
761e0918d3 Unmap memory in MemoryFile.close().
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.
2009-05-29 13:28:14 +01:00
Android (Google) Code Review
2c0858a481 am 511a0134: Merge change 2302 into donut
Merge commit '511a0134e1bfe90a23960eea72eca565e52aa816'

* commit '511a0134e1bfe90a23960eea72eca565e52aa816':
  added SmsMessage ConcatRef parsing validation
2009-05-26 10:11:29 -07:00
Fred Quintana
8943737692 add ipc support to batching 2009-05-22 14:17:48 -07:00
Tammo Spalink
550885d158 added SmsMessage ConcatRef parsing validation
addresses bugs:
http://b/issue?id=1870607
http://b/issue?id=1688238

and prior perforce commit:
http://s9/?change_num=136189
2009-05-22 13:38:35 +08:00
Android (Google) Code Review
f68498eaed am 5bc21aa0: Merge change 1127 into donut
Merge commit '5bc21aa0671d83e406b46e0431816dea8d9ca5cb'

* commit '5bc21aa0671d83e406b46e0431816dea8d9ca5cb':
  SmsHeader rewrite, in preparation for migration to public API.
2009-05-20 08:54:39 -07:00
Android (Google) Code Review
5bc21aa067 Merge change 1127 into donut
* changes:
  SmsHeader rewrite, in preparation for migration to public API.
2009-05-19 19:52:07 -07:00
Tammo Spalink
64c499113a 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
2009-05-20 09:27:10 +08:00
Bjorn Bringert
7ca4a171d2 am 5615d35b: Add tests for the new SQLite _TOKENIZE() \'tag\' column.
Merge commit '5615d35b28119865cd65a79814a69f910e0a3862'

* commit '5615d35b28119865cd65a79814a69f910e0a3862':
  Add tests for the new SQLite _TOKENIZE() 'tag' column.
2009-05-19 02:41:40 -07:00
Bjorn Bringert
5615d35b28 Add tests for the new SQLite _TOKENIZE() 'tag' column. 2009-05-19 09:53:38 +01:00
Android (Google) Code Review
f4c6ae8339 am 6342d393: Merge change 1575 into donut
Merge commit '6342d3936ad8c9e6cf5bba1fc88c4e9338391bb4'

* commit '6342d3936ad8c9e6cf5bba1fc88c4e9338391bb4':
  Change _TOKENIZE tests to test the new token_index column
2009-05-18 08:36:46 -07:00
Fred Quintana
ce31b2361d enhance ContentProvider with the ability to perform batch operations 2009-05-15 13:55:32 -07:00
Bjorn Bringert
819e3f2148 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.
2009-05-15 12:03:32 +01:00
Android (Google) Code Review
34f97460bd am f2331a6: Merge change 1063 into donut
Merge commit 'f2331a63c0e7f6ffeedf16185c92a0aeffa5512c'

* commit 'f2331a63c0e7f6ffeedf16185c92a0aeffa5512c':
  Refactor SearchableInfo.
2009-05-06 15:49:01 -07:00
Bjorn Bringert
a92041306e Refactor SearchableInfo.
- 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.
2009-05-06 13:54:42 +01:00
Tammo Spalink
84c9097d5b am d2b124f: new cdma sms unit tests (from QC on-site test)
Merge commit 'd2b124f97c52c566b68aff9fa58306f461686af0'

* commit 'd2b124f97c52c566b68aff9fa58306f461686af0':
  new cdma sms unit tests (from QC on-site test)
2009-05-06 01:31:33 -07:00
Tammo Spalink
d2b124f97c new cdma sms unit tests (from QC on-site test) 2009-05-06 15:05:45 +08:00
Android (Google) Code Review
26504548bf am ef65477: Merge change 844 into donut
Merge commit 'ef65477523a6170bab7897809d1a8f9a3f5165f6'

* commit 'ef65477523a6170bab7897809d1a8f9a3f5165f6':
  clean up cdma sms creation and parsing
2009-05-01 23:25:27 -07:00
Tammo Spalink
8478b59f17 clean up cdma sms creation and parsing
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
2009-05-01 14:11:44 -07:00
Android (Google) Code Review
e4ddb19acb am efae672: Merge change 725 into donut
Merge commit 'efae672d7303fb6682b2ae8704a62146297a0a5a'

* commit 'efae672d7303fb6682b2ae8704a62146297a0a5a':
  Add 'includeInGlobalSearch' attribute to searchable meta-data.
2009-04-29 13:41:22 -07:00
Android (Google) Code Review
cb6c7248ba am 05e4755: Merge change 724 into donut
Merge commit '05e47550bb5bcd7cff10b03c8da31e5b55ee4c91'

* commit '05e47550bb5bcd7cff10b03c8da31e5b55ee4c91':
  Split testSearchablesMocked into two tests.
2009-04-29 13:41:21 -07:00
Android (Google) Code Review
adf431b54a am 493b00a: Merge change 640 into donut
Merge commit '493b00afbfd4f603939ee98540a4d8df084107fd'

* commit '493b00afbfd4f603939ee98540a4d8df084107fd':
  Add GLOBAL_SEARCH intent for finding global search provider.
2009-04-29 13:35:48 -07:00
Android (Google) Code Review
c36349034a am d306052: Merge change 542 into donut
Merge commit 'd30605200b8b0f10e4740a9d7266d240023e69cd'

* commit 'd30605200b8b0f10e4740a9d7266d240023e69cd':
  enable additional cdma sms fields and user data encodings
2009-04-29 13:35:37 -07:00
The Android Open Source Project
8f080ec429 am f3ccf8a: Merge branch \'readonly-p4-donut\' into donut 2009-04-29 13:34:51 -07:00
Android (Google) Code Review
5c685a948e am 9c56513: Merge change 165 into donut
Merge commit '9c5651390056cd9c2f68d5df057739528bd4128b'

* commit '9c5651390056cd9c2f68d5df057739528bd4128b':
  Squashed commit of the following:
2009-04-29 13:11:32 -07:00
Bjorn Bringert
6d72e029cb Add 'includeInGlobalSearch' attribute to searchable meta-data.
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
2009-04-29 20:23:04 +01:00
Bjorn Bringert
aece7c6723 Split testSearchablesMocked into two tests. 2009-04-29 14:50:46 +01:00
Android (Google) Code Review
493b00afbf Merge change 640 into donut
* changes:
  Add GLOBAL_SEARCH intent for finding global search provider.
2009-04-29 03:38:01 -07:00