Before, SuggestionsAdapter would not close input streams after
reading icons from them. This leaks file descriptors and,
in the case of MemoryFiles, virtual address space.
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
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.
* changes:
Corrected the name of the native library the SynthProxy class loads (libttssynthproxy instead of libsynthproxy) to match the lib name from frameworks/base/tts/jni/Android.mk.
* changes:
Addressed comments of change 2515 for the TtsService class: - made the SpeechItem and SoundResource inner classes static, - prefixed the TtsService member variables by 'm', - changed indentation from 2 to 4 characters.
- made the SpeechItem and SoundResource inner classes static,
- prefixed the TtsService member variables by 'm',
- changed indentation from 2 to 4 characters.
Merge commit 'b33940abca9d43891575f58a1107c8ec247afed1' into donut
* commit 'b33940abca9d43891575f58a1107c8ec247afed1':
AI 149494: Minor improvements to wording in design tips for missing activity and notifications
(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
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
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.