700 Commits

Author SHA1 Message Date
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
Satish Sampath
8dbe612dc6 Adding internal method replacePreferredActivity.
This was required because we need a way to set the preferred activity for a
particular intent filter based on user selection (in our case the
ACTION_WEB_SEARCH intent filter for selecting the preferred search engine from
the list of available search engines providers). The current
addPreferredActivity call was not sufficient since it leaves the existing
preferred activities in the list and does not remove them, which this call
does.
2009-06-03 07:54:42 +01:00
Romain Guy
9af0b4f7be Add new listener to GestureOverlayView. This listener fires whenever the overlay thinks the user is starting a new gesture. This allows Home to snap the workspace back to its original position during a gesture operation. 2009-06-02 21:59:42 -07:00
Android (Google) Code Review
432900bffb Merge change 2962 into donut
* changes:
  Fixes #1890914.
2009-06-02 15:16:34 -07:00
Romain Guy
ce16d787bd Fixes #1890914.
Bright theme's background color should be #fff9f9f9 instead of pure white (#ffffffff).
2009-06-02 15:15:12 -07:00
Karl Rosaen
a058f02b59 progress towards impression and click stats on all sources, plus some internal cleanup
(framework portion)

suggestionCursor has new callbacks for impressions and clicks
- impressions now used to trigger "more" UI, cleanup apis around that

search dialog reports which position was clicked on via cursor#respond
- can now detect when sources under "more results" are clicked
- also used to simplify existing stuff:
  - can detect when "more results" entry is clicked and toggle base on that (no longer need INTENT_ACTION_CURSOR_RESPOND one off)
  - use response from click reporting to instruct which position should be selected
2009-06-02 15:00:37 +01:00
Android (Google) Code Review
b3c3778edb Merge change 2844 into donut
* changes:
  Added some icon debug logging to SuggestionsAdapter.
2009-06-02 01:31:21 -07:00
Bjorn Bringert
b791f34474 Added some icon debug logging to SuggestionsAdapter.
Good for checking that lazy contact photos works.
2009-06-02 09:29:34 +01:00
Android (Google) Code Review
4ff42ad6d7 Merge change 2843 into donut
* changes:
  Use JNI region calls in MemoryFile read and write.
2009-06-02 01:25:24 -07:00
Bjorn Bringert
ad984f1933 Use JNI region calls in MemoryFile read and write.
This will reduce copying or pinning, depending on GC policies, which should
improve performance. See dalvik/docs/jni-tips.html#RegionCalls for more information.

Fixes http://b/issue?id=1887911
2009-06-02 09:22:42 +01:00
Android (Google) Code Review
35feec46d9 Merge change 2761 into donut
* changes:
  TODO's from Teleca with modifications from wink.
2009-06-02 00:49:46 -07:00
Android (Google) Code Review
f5df83035a Merge change 2879 into donut
* changes:
  Add backup side of new FullBackupAgent class
2009-06-01 19:30:54 -07:00
Christopher Tate
93e7e22ec9 Add backup side of new FullBackupAgent class
This class backs up an app's entire data directory tree.  Intended for use
by the backup-through-adb full mirroring facility, etc.  @hide because
it's not really something end apps will need to use.
2009-06-01 16:49:50 -07:00
Android (Google) Code Review
2ba3223cc9 Merge change 2855 into donut
* changes:
  Add a new method to load html data into the WebView.
2009-06-01 15:22:18 -07:00
Android (Google) Code Review
c17f16e33a Merge change 2851 into donut
* changes:
  Change comment for SUGGEST_COLUMN_INTENT_EXTRA_DATA to clarify that this column is for use by global search only.
2009-06-01 14:50:26 -07:00
Ramanan Rajeswaran
8cb6617107 Add a new method to load html data into the WebView. 2009-06-01 14:43:44 -07:00
Wink Saville
f315238a2b TODO's from Teleca with modifications from wink. 2009-06-01 14:39:20 -07:00
Mike LeBeau
21fd5f144a Change comment for SUGGEST_COLUMN_INTENT_EXTRA_DATA to clarify that
this column is for use by global search only.
2009-06-01 22:30:56 +01:00
Android (Google) Code Review
b249890bc6 Merge change 2835 into donut
* changes:
  Add framework support for scrolling to the "More results..." list item when it is clicked.
2009-06-01 14:21:54 -07:00
Mike LeBeau
ae9760b62c Add framework support for scrolling to the "More results..." list item
when it is clicked.
2009-06-01 21:53:09 +01:00
Android (Google) Code Review
fa30c0eed3 Merge change 2548 into donut
* changes:
  Fix a bug in AppSecurityPermissions where it wouldn't display permissions used by an app if it uses a shared user id. Remove the else clause and always get the list of requested permissions first before adding the permissions obtained via the shared user id. Also change an if condition and comments for better readability
2009-06-01 10:21:05 -07:00
Android (Google) Code Review
162c9d0e90 Merge change 2805 into donut
* changes:
  base: Rename WRITE_SDCARD -> WRITE_EXTERNAL_STORAGE
2009-06-01 09:58:44 -07:00
Android (Google) Code Review
10d273bb69 Merge change 2591 into donut
* changes:
  Check if the ownerView is still attached to window in refreshPositionVariables.
2009-06-01 09:55:44 -07:00
San Mehat
5a3a77dabd base: Rename WRITE_SDCARD -> WRITE_EXTERNAL_STORAGE
Signed-off-by: San Mehat <san@google.com>
2009-06-01 09:25:28 -07:00
Christopher Tate
181fafaf48 Retool the backup process to use a new 'BackupAgent' class
Backups will be handled by launching the application in a special
mode under which no activities or services will be started, only
the BackupAgent subclass named in the app's android:backupAgent
manifest property.  This takes the place of the BackupService class
used earlier during development.

In the cases of *full* backup or restore, an application that does
not supply its own BackupAgent will be launched in a restricted
manner; in particular, it will be using the default Application
class rather than any manifest-declared one.  This ensures that the
app is not running any code that may try to manipulate its data
while the backup system reads/writes its data set.
2009-05-31 13:10:03 -07:00
Android (Google) Code Review
afbc9ab370 Merge change 2692 into donut
* changes:
  * Chagned RecognitionService interface to use more complex RecognitionResult instead of String.
2009-05-29 17:09:19 -07:00
Mitsuru Oshima
34b234d53f * Chagned RecognitionService interface to use more complex RecognitionResult instead of String. 2009-05-29 16:54:55 -07:00
Android (Google) Code Review
c3b7e4e7dd Merge change 2736 into donut
* changes:
  Telephony support for SMS memory reporting to the network.
2009-05-29 15:16:22 -07:00
Android (Google) Code Review
f422dc495a Merge change 2566 into donut
* changes:
  Fix javadoc typos. No code changes.
2009-05-29 15:07:45 -07:00
Romain Guy
8d78756c16 Fix the build. 2009-05-29 15:02:55 -07:00
Romain Guy
0a63716ed0 Modify the base gestures API to use streams instead of files. Adds new wrappers to easily load/save gestures from files, resources, etc. Do the same for the letters recognizer. 2009-05-29 14:43:54 -07:00
jsh
867641ece3 Telephony support for SMS memory reporting to the network.
- Use ordered broadcast to allow receivers to set a result code.
- Ack SMS with result code.
- New RIL command to report memory status.
- Fixed a typo in a Gservices setting.
- Merge in CL 137895 (hold a wake lock while broadcasting SMS_RECEIVED).
2009-05-29 14:22:36 -07:00
Android (Google) Code Review
7a8c437723 Merge change 2737 into donut
* changes:
  Fixes #1878499.
2009-05-29 13:54:39 -07:00
Romain Guy
d1c67d42ab Fixes #1878499.
Ignore touch up events that happen after a gesture was cancelled. This fix also improves performance by ignoring move events that are within the touch threshold.
2009-05-29 13:53:16 -07:00
Android (Google) Code Review
d1353cc4f1 Merge change 2731 into donut
* changes:
  Fixes #1873537.
2009-05-29 13:43:57 -07:00
Android (Google) Code Review
9d981343c9 Merge change 2732 into donut
* changes:
  Fix for #1878497.
2009-05-29 12:29:17 -07:00
Romain Guy
9ffe1ae56b Fix for #1878497.
Always pre-allocate a gesture's bounding box to avoid possible NPEs.
2009-05-29 12:28:23 -07:00
Romain Guy
c51ef9702d Fixes #1873537.
Only update the popup window when it is shown. This avoids throwing an NPE in PopupWindow.
A PopupWindow is only aware of its content view after being shown.
2009-05-29 12:05:11 -07:00
Android (Google) Code Review
a3d28bd5c2 Merge change 520 into donut
* changes:
  Enforce permissions for PhoneStateListener events.
2009-05-29 11:48:34 -07:00
Jaikumar Ganesh
4551565943 Enforce permissions for PhoneStateListener events.
PhoneStateListener events like LISTEN_CALL_STATE_CHANGED,
have privacy information like phone numbers and hence,
need to be protected with a permission. The permission
READ_PHONE_STATE is used for this purpose. Use the permission
trick to ensure backward compatability.
2009-05-29 11:38:00 -07:00
Romain Guy
e32edc614e Fixes #1884152. This change improves how the opaque property is handled with respect to dividers.
If the list is opaque and its background is not, then we want to fill a solid rect where the dividers should be when they are skipped for non-selectable items. When the list is opaque and the background is also opaque, there is no need to draw something in lieu of the dividers since the background will do it for us.
2009-05-29 10:33:36 -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
Bjorn Bringert
9fc2e9c965 MemoryFile constructor and native methods throw IOExceptions.
These native methods in android.os.MemoryFile throw IOException but their
Java declarations did not include "throws IOException":
native_open(),native_mmap(),native_read(),native_write(),native_pin()

The MemoryFile(String,int) constructor calls native_open and
native_mmap, but does not declare that it throws IOException. The other
Java methods that call the native methods do actually declare that they
throw IOException.

This means that any code that created memory files could throw
an IOException, without knowing about it.

This changes adds "throws IOException" to the native methods and to
the constructor. The constructor change changes the public API, but
maintains binary compatibility. There is some precedent for making
source incompatible source API changes for this sort of thing
(see https://mondrian.corp.google.com/changelist/124214-p9).

The change also makes the native methods static, which
they seem to have been intended to be, as indicated by the
second parameter to the native implementations being named
"clazz".

This requires changes to the Compatibility Test Suite to catch the exceptions.
This is done in https://android-git.corp.google.com/g/2617
Unfortunately that change must be submitted together with this one in order
not to break the build.

Fixes http://b/issue?id=1881829
2009-05-29 09:06:44 +01:00
Android (Google) Code Review
607384d45f Merge change 2678 into donut
* changes:
  Converted the angle of OrientedBoundingBox to degrees
2009-05-28 21:13:26 -07:00
Romain Guy
f40f074c43 Revert "Revert "Bug fixes and performance improvements""
This reverts commit 436466d75edb5f6fd848504d998f244426ea5a09.
2009-05-28 21:12:01 -07:00
Android (Google) Code Review
f6355e24f5 Merge change 2399 into donut
* changes:
  Motorola additions for CDMA support without CdmaSuppConnTracker
2009-05-28 20:29:10 -07:00
Yang Li
f3ede869b8 Converted the angle of OrientedBoundingBox to degrees 2009-05-28 18:00:50 -07:00
Wink Saville
dda5391d50 Motorola additions for CDMA support without CdmaSuppConnTracker
There are corresponding changes to hardware/ril and packages/apps/Phone
that are required to go with these changes.
2009-05-28 17:32:34 -07:00
Android (Google) Code Review
1e2e44e900 Merge change 2365 into donut
* changes:
  Fix wifi multicast API for public use.
2009-05-28 14:02:39 -07:00