67 Commits

Author SHA1 Message Date
Android (Google) Code Review
1aa1a154fd Merge change 7959 into donut
* changes:
  Adding WRITE_EXTRENAL_STORAGE permission in AndroidManifest.xml file.
2009-07-20 16:11:33 -07:00
Swarna Kumar
c1889da850 Adding WRITE_EXTRENAL_STORAGE permission in AndroidManifest.xml file. 2009-07-20 16:06:20 -07:00
Yu Shan Emily Lau
b42c3a5809 Fix the build 2009-07-20 16:01:54 -07:00
Yu Shan Emily Lau
873eb57394 Added the vpn unit test template. 2009-07-20 14:51:25 -07:00
Dianne Hackborn
a53b828635 Add "nodpi" density, and expose a bunch of density-related APIs.
Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
2009-07-17 16:59:08 -07:00
Android (Google) Code Review
0bb0597a4b Merge change 7556 into donut
* changes:
  Temporarily suppress ServiceTest.
2009-07-16 13:46:57 -07:00
Brett Chabot
44ce817e0b Temporarily suppress ServiceTest.
ServiceTest appears to be causing the whole android unit_tests suite to fail in the
continuous system. Suppressing to stop the lab failure spam while continuing to investigate.
2009-07-16 12:20:53 -07:00
Android (Google) Code Review
c93af6dc5b Merge change 7441 into donut
* changes:
  Allow system colors in <font> tags
2009-07-16 00:06:23 -07:00
Bjorn Bringert
9cab7f7684 Allow system colors in <font> tags
Fixes http://b/issue?id=1970693
2009-07-15 22:47:03 +01:00
Bjorn Bringert
4e4371186d Update Searchables test with new GlobalSearch name
Fixes http://b/issue?id=1981558
2009-07-15 19:04:07 +01:00
Bob Lee
5621f0d928 Fixed NPE bugs in Uri. Fixes internal issue #1724719.
Modified getQueryParameter() to use the encoded query string. Fixes internal issue #1749094.
2009-07-10 14:54:08 -07:00
Bob Lee
b8b8f044f4 Uri.EMPTY.toString() was returning null due to an initialization order bug. Fixes internal issue #1957015. 2009-07-10 13:34:37 -07:00
Bjorn Bringert
444c727e0e Run search UI on its own thread.
Details:

- Add a new SearchDialogWrapper class that makes sure
  all access to the SearchDialog is run one a single thread
  other than the main ServerThread.
- Don't save/restore seach dialog state in Activity.
  This resulted in lots of calls to the SearchManager
  throughout the life cycle of all activities, for
  the questionable benefit of restoring the search dialog
  in a few cases.
- Remove search UI state save/restore, and the isVisible()
  method from SearchManagerService. They are no longer used,
  and were tricky to implement since they return values from
  the search UI thread to the service.
- Handle configuration changes in searchDialogWrapper instead
  of calling through from Activity.

Fixes http://b/issue?id=1938101

TODO:
- Activity.performPause() calls stopSearch(). This call may not happen
  until the new activity has been started. If the new activity starts a
  search immediately, this search could be cancelled by the old activity's
  call top stopSearch().
2009-07-08 17:43:49 +01:00
Android (Google) Code Review
a83bef5974 Merge change 6396 into donut
* changes:
  Add unit test for NeighboringCellInfo.
2009-07-07 18:09:21 -07:00
John Wang
75efd5d525 Add unit test for NeighboringCellInfo.
Add small unit test for NeighboringCellInfo in AndroidTests. The old telephony unit test directory, CoreTest/android, is marked as deprecated in AndroidTestHowto.

	new file:   tests/AndroidTests/src/com/android/unit_tests/NeighboringCellInfoTest.java
2009-07-07 14:02:11 -07:00
Tammo Spalink
0fd833a50f septet-align UD after any UDH for GSM-7bit coding 2009-07-07 14:17:28 +08:00
Android (Google) Code Review
d3de90f38d Merge change 5995 into donut
* changes:
  Turn off kerning when testing TextUtils.ellipsize().
2009-07-02 10:46:37 -07:00
Daisuke Miyakawa
40336782ea Add tests. internal bug id 1868702. 2009-07-02 14:33:39 +09:00
Eric Fischer
1f0dac38df Turn off kerning when testing TextUtils.ellipsize().
Otherwise, the different text measurement methods produce slightly
different results and cause the text to show different results for
Spanned vs. non-Spanned source strings.

Bug 1837826
2009-07-01 18:04:23 -07:00
Tammo Spalink
8203dc1bc8 cdma sms is91 support 2009-06-28 16:23:53 +08:00
Tammo Spalink
326c66d888 make BitwiseInputStream.read return int
Keep the maximum access 8 bits to avoid dealing with
endianness issues.
2009-06-24 14:42:33 +08: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
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
bc806f65ed Remove deprecated api. Aptly rename freeStorageWithIntent to freeStorage. 2009-06-19 10:25:37 -07:00
Tammo Spalink
0ff946e7b5 add feedback test with gsm7bit special case characters 2009-06-17 16:13:52 +08: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
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
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
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
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
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
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
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
5615d35b28 Add tests for the new SQLite _TOKENIZE() 'tag' column. 2009-05-19 09:53:38 +01: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
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
d2b124f97c new cdma sms unit tests (from QC on-site test) 2009-05-06 15:05:45 +08: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
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
Bjorn Bringert
74708bbdf8 Add GLOBAL_SEARCH intent for finding global search provider. 2009-04-28 12:15:56 +01:00
Tammo Spalink
8c49d32cb9 enable additional cdma sms fields and user data encodings
enable ia5 and octet user data encodings
properly expose parsed user data
support additional bearer data subparameter types
2009-04-28 15:49:59 +08:00
Karl Rosaen
f3ccf8a5a5 Merge branch 'readonly-p4-donut' into donut 2009-04-23 19:01:36 -07:00
Karl Rosaen
875d50a4b9 AI 147564: Merge back from search branch to donut. Notes:
- all public apis and framework changes have been reviewed by relevant folks in our branch (e.g romainguy)
  - all new public apis are @hidden; they will still get reviewed by api council once we're in git
  - other than that, it's mostly GlobalSearch and search dialog stuff, a new apps provider, and some tweaks
  to the contacts provider that was reviewed by jham

Automated import of CL 147564
2009-04-23 19:00:21 -07:00
Robert Greenwalt
96e20409af Squashed commit of the following:
commit 012b56fc607cf243cf4b29cb2a5f172bcbe0aecd
Author: Robert Greenwalt <robdroid@android.com>
Date:   Wed Apr 22 14:31:26 2009 -0700

    Additional fixes and tests for density.

commit 91fdc8e187551ae69e0029a4325fb3ad38fe411b
Author: Robert Greenwalt <robdroid@android.com>
Date:   Tue Apr 14 14:39:00 2009 -0700

    Fix runtime resource selection logic.

    Fix isBetterThan so that o or this may be supperior at any stage.
    Used to only handle this-better or tie at each stage, biasing against o.
    Also allows reset of unit test to succeed.  Fixes bug 1709202.
2009-04-22 14:35:11 -07:00
Tammo Spalink
e564b19ed2 replaced integer * and % with shift operations, for performance 2009-04-16 14:48:19 +08:00