Commit Graph

5936 Commits

Author SHA1 Message Date
Jeff Brown 9efaaa4359 Even more native input dispatch work in progress.
Added more tests.
Fixed a regression in Vector.
Fixed bugs in pointer tracking.
Fixed a starvation issue in PollLoop when setting or removing callbacks.
Fixed a couple of policy nits.

Modified the internal representation of MotionEvent to be more
efficient and more consistent.

Added code to skip/cancel virtual key processing when there are multiple
pointers down.  This helps to better disambiguate virtual key presses
from stray touches (such as cheek presses).

Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
2013-07-30 13:56:53 -07:00
Jeff Brown 80d9c1cfb0 Support for multiple tests
The build system enforces some invariants that were being ignored
before.

Change-Id: Ie7675042af7f961a507386c13b2a0b592b591af8
2013-07-30 13:56:53 -07:00
Jeff Brown ea5c46b7c1 Remove PollLoop from host build.
We can't build (and we don't need) PollLoop in the SDK on all platforms.

Change-Id: I3b0f327bbb8bc58b9b8630b0161cf360403fea68
2013-07-30 13:56:53 -07:00
Jeff Brown 4d643d6fdb Fix include paths.
Change-Id: Ifda45688f9f02710a74d5d7a7d902bacf1441e2e
2013-07-30 13:56:53 -07:00
Jeff Brown 66db68948c Native input dispatch rewrite work in progress.
The old dispatch mechanism has been left in place and continues to
be used by default for now.  To enable native input dispatch,
edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy.

Includes part of the new input event NDK API.  Some details TBD.

To wire up input dispatch, as the ViewRoot adds a window to the
window session it receives an InputChannel object as an output
argument.  The InputChannel encapsulates the file descriptors for a
shared memory region and two pipe end-points.  The ViewRoot then
provides the InputChannel to the InputQueue.  Behind the
scenes, InputQueue simply attaches handlers to the native PollLoop object
that underlies the MessageQueue.  This way MessageQueue doesn't need
to know anything about input dispatch per-se, it just exposes (in native
code) a PollLoop that other components can use to monitor file descriptor
state changes.

There can be zero or more targets for any given input event.  Each
input target is specified by its input channel and some parameters
including flags, an X/Y coordinate offset, and the dispatch timeout.
An input target can request either synchronous dispatch (for foreground apps)
or asynchronous dispatch (fire-and-forget for wallpapers and "outside"
targets).  Currently, finding the appropriate input targets for an event
requires a call back into the WindowManagerServer from native code.
In the future this will be refactored to avoid most of these callbacks
except as required to handle pending focus transitions.

End-to-end event dispatch mostly works!

To do: event injection, rate limiting, ANRs, testing, optimization, etc.

Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
2013-07-30 13:56:53 -07:00
Andreas Huber 10e5da58e4 Fix String8 to free its memory only after assignment operations based on pointers are finished in case that pointer referred to the string's original contents.
Change-Id: I6961f3cf10ba3b728579ea63262db750a4cf8577
2013-07-30 13:56:53 -07:00
Kenny Root ad4f2e59af Add invariant check for stylesString size
It was possible for stylesStrings to claim to start past the end of the
data area thereby making mStringPoolSize larger than the data area.

Change-Id: Ibc4d5b429e3a388516135801c8abc3681daae291
2013-07-30 13:56:53 -07:00
Kenny Root 65d3c95a4d Range checking for ResTable_map
Correct previous offset change and get ready for safe-iop.

Change-Id: Ib276c726f32b0711a72f47d3263eb21640e5a800
2013-07-30 13:56:53 -07:00
Kenny Root 076618172d Improve checking in aapt dump
The aapt dump reading had less error checking than the actual parsing,
so this change brings it more into parity so that bad APKs don't crash
"aapt dump"

Change-Id: Ib30e63e41be5c652645c4aa0de580a87b184529d
2013-07-30 13:56:53 -07:00
Konstantin Lopyrev 7517432a55 Fix 1684100: Making sure that empty package, type and resource ids are not accepted.
Change-Id: I4c94877e4312e9a5b4d22c8625069ca056c62e40
2013-07-30 13:56:53 -07:00
Daisuke Miyakawa f16344acab Delete vCard code to platform/framework/opt/vcard.
Now all the code and related tests are in (top)/framework/opt/vcard.

See also 33mb46cb82 in platform/framework/opt/vcard.

Bug: 2735156
Change-Id: Ic3413110580874761e596b8fe9ad3c2e3c60795b
2013-07-30 13:56:53 -07:00
Daisuke Miyakawa 3073020282 Remove stale and inappropriate dependency.
Change-Id: I2e9412075c157a8649ac06e89a8987a36544d78b
2013-07-30 13:56:53 -07:00
Mathias Agopian 24ed9052bd Fix a typo in Singleton<>
it could cause the sLock field to be emitted several times
in different compilation unit. it also prevented to
have 2 Singleton<> in the same file.
2013-07-30 13:56:53 -07:00
Daisuke Miyakawa fcf836d32f Small fix around intermideate charset (ISO-8859-1).
After a few investigation, it is found that ISO-8859-1 is confirmed to be the
best charset for that use.

Modify comment so that we explicitly mention it.

Change-Id: I16e487fab33964a1665a1dd6991f2e8598f8895e
2013-07-30 13:56:53 -07:00
Daisuke Miyakawa e6cbafd07d Make vCard code a separated static library.
- Move the library to a separate directory in framewokr/base, and rename its package from
  android.pim.vcard to com.android.vcard.
- Move all tests for the library under the directory.
- Confirm all tests for vCard are successful.

It would be better for us to have this directory somewhere else (like external/).
But I'll submit this here now and move it to the right place as soon as possible.
From the view of build mechanism, we can do that immediately.

BUG: 2689523
Change-Id: I435e10571b7160bfcc029bed7c37aaac1c6fd69a
2013-07-30 13:56:53 -07:00
Mathias Agopian 9b0be73f2a added RWLock C++ wrapper
Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
2013-07-30 13:56:53 -07:00
Kenny Root c2b77d2fad ZipUtilsRO rewrite based on Dalvik Zip rewrite
Change the way zip archives are handled.  This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory
magic on a buffer of data read from the file, instead of a memory-mapped
section.  We use what we find to create a map that covers the Central
Directory only.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it.

This is based on Change I745fb15abb in the dalvik tree. Both
implementations share a common ancestry, but the cost of unifying them
outweighs the benefits of wrapping C calls.

Change-Id: Iddacb50fe913917c2845708a530872d65fdbe620
2013-07-30 13:56:53 -07:00
Dan Morrill eb502abd56 Adding PacketVideo attribution in NOTICE.
Change-Id: Id2fe398d4deed6ebd8cba8516ffc6c0334a961b0
2013-07-30 13:56:53 -07:00
Dan Egnor 88753ae9d8 Make static versions of libutils and libbinder.
Fix some small static-initialization-order issues (and a static-
initializers-missing issue) that result from doing so.  The static
libraries don't actually get used for anything real at the moment --
they're used for perf tests of bug 2660235.

Bug: 2660235
Change-Id: Iee2f38f79cc93b395e8d0a5a144ed92461f5ada0
2013-07-30 13:56:53 -07:00
Dianne Hackborn 88e4960025 New xlarge screen size.
Not complete, only for experimentation at this point.

This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.

The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.

Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
2013-07-30 13:56:53 -07:00
Dianne Hackborn 2937406b0d Revert "fix [2542425] memory leak during video recording"
This reverts commit 544592e14f8d7643238e40ba9879727497900f35.
2013-07-30 13:56:53 -07:00
Mathias Agopian 4e0ee2fd89 fix [2542425] memory leak during video recording
[Sorted|Keyed]Vector<TYPE> would leak their whole storage when resized
from the end and TYPE had trivial dtor and copy operators.

Change-Id: I8555bb1aa0863df72de27d67ae50e20706e90cf5
2013-07-30 13:56:53 -07:00
Mathias Agopian 15d0edcba0 fix [2542425] memory leak during video recording
Vector::sort() is using _do_copy() incorrectly; _do_copy() calls the
copy constructor, not the assignment operator, so we need to destroy
the "destination" before copying the item.

Change-Id: Iaeeac808fa5341a7d219edeba4aa63d44f31473c
2013-07-30 13:56:53 -07:00
Mathias Agopian 68f6481820 libutils Condition are now PRIVATE by default
Condition must be initialized with SHARED for the old behavior, where
they can be used accross processes.

Updated the two places android that require SHARED conditions.

PRIVATE conditions (and mutexes) use more efficient syscalls.

Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
2013-07-30 13:56:53 -07:00
Dianne Hackborn 30a8e2e135 Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources.  This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2013-07-30 13:56:53 -07:00
Tom Taylor df6e753fa7 Remove mms-common library
Put the Mms files back in the framework where they've been since 1.0.

Change-Id: I3c449468053ddd82d35c45a06d71957de660bf99
2013-07-30 13:56:53 -07:00
Christopher Tate 44ca383c5f Rename cleanspec => CleanSpec to match the build rule
Change-Id: I9cc9027ea82a90af5f369976823f0feb0a1eeda0
2013-07-30 13:56:53 -07:00
Christopher Tate 73308880cf Fix up missed refactoring in JNI reg and preloaded-classes
Change-Id: I079bdf4edfb9083eba3e15d8e4dbf3b2bad9190c
2013-07-30 13:56:53 -07:00
Christopher Tate a77468038b Refactor android.backup => android.app.backup
Change-Id: I0b21316ff890d7f3c7d4b82837bb60670724c2e8
2013-07-30 13:56:53 -07:00
Dianne Hackborn 70592f2c47 Refactor car mode.
Extract all UI behavior from dock observer and ACTION_DOCK_EVENT.

Also introduce a desk type to go along with the car type all through
the resource system, since we now need to have corresponding high-level
broadcasts for desk dock mode.  As part of that I also reworked some
of the logic for switching modes to all funnel through a single
update() call that looks all of the current state to decide what to
do next, and fixed various locking issues.

In addition I found there were bugs in the configuration change
handling causing us to only switch into the car mode config and
then never get out of it.  Unfortunately now that we are actually
changing the configuration for each mode change, the transitions
between them are really crummy as we restart all kinds of
activities. :(
2013-07-30 13:56:53 -07:00
Dianne Hackborn 8b51a1a88b Fix some bugs.
Bug #2376231: Apps lose window focus (and back key causes ANR) if the
lock screen is dismissed while the phone is in landscape mode

This is another case where we weren't recomputing the focused window
after changing the visibility policy.

bug #2479958: Investigate source of "Resources don't contain package
for resource number 0x7f0a0000"

Um, okay, so it turns out there were bugs all over the place where
we would load an XML resource from a another application, but not
use the Resources for that application to retrieve its resources...!
I think the only reason any of this stuff was working at all was
because it typically only cared about retrieving the resource
identifiers of the items (it would look up the values later).

Bug #2401082: Passion ERE26 monkey crash - InputMethodManagerService

Add some null checks.
2013-07-30 13:56:52 -07:00
Ken Shirriff 64d40b5e5d Remove calendar.jar.
This jar file failed to meet its goal of unbundling calendar.

bug 2468654
2013-07-30 13:56:52 -07:00
Dianne Hackborn aeb43bd6df Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:

- The aapt tool now sets a resource configurations sdk level to match any configs
  that have been set (for example if you specify density your sdk level will be
  at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
2013-07-30 13:56:52 -07:00
Ficus Kirkpatrick 7925ea7735 Demote the famous ResourceTypes warning to LOGV.
It is spamming the log bigtime and can be promoted back to LOGW
or worse by whoever decides to actually investigate the bug.

Change-Id: I72d950155378f641ebdfbacabae774f5736a52bc
2013-07-30 13:56:52 -07:00
Ken Shirriff 806246a598 Remove DateException and obsolete DateUtils functions.
These functions are deprecated and no longer used.
2013-07-30 13:56:52 -07:00
Wei Huang 47c6fcb973 define the "seen" column for sms and pdu tables. 2013-07-30 13:56:52 -07:00
Dianne Hackborn d882653c22 Re-arrange android-common so framework no longer links with it.
This is the framework part, moving classes around so the framework
no longer needs to link to android-common.  Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
2013-07-30 13:56:52 -07:00
Kenny Root 60ed8d122a Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.

This is part 1. Part 2 will include ResXMLParser optimizations.

Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
2013-07-30 13:56:52 -07:00
Mathias Agopian a580e68cc3 remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).
Add a Flattenable interface to libutils which can be used to flatten
an object into bytestream + filedescriptor stream.
Parcel is modified to handle Flattenable. And GraphicBuffer implements
Flattenable.

Except for the overlay classes libui is now independent of libbinder.
2013-07-30 13:56:52 -07:00
Doug Zongker 8f0251fd36 use framework base64 implementation
Change-Id: Ib1dc595e53d64901f81d06350c6ab9b138beff7e
2013-07-30 13:56:52 -07:00
Kenny Root e81635474c Totally remove Unicode.cpp and rely on ICU
Unicode.cpp used a packed data table for character data that essentially
duplicated ICU's functionality.

Change-Id: Ia68fe4ac94e89dc68d9a3f45f33f6e648a5500b7
2013-07-30 13:56:52 -07:00
Kenny Root 861e14ff9f Excise code from Unicode.cpp that was dead
Remove some utility functions for discovering character data
that ICU probably took over a while ago.

Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
2013-07-30 13:56:52 -07:00
Tobias Haamel 4ef8aea3b5 Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2013-07-30 13:56:52 -07:00
Ficus Kirkpatrick 7e3befe696 Fix mms-common's pathnames to match package spec.
Change-Id: I4ae65227ea29dff8a79bd1d9373dec46c4b53598
2013-07-30 13:56:52 -07:00
Tom Taylor 25d6d1576a Remove MMS from the framework
The MMS code has been moved into the mms-common library.
Move SqliteWrapper (and make it hidden) into the database
directory because Telephony.java depends on it. Create a mmscommon
library similar to androidcommon for a number of files used both
by the telephony layer, by mms, and by myfaves.

Change-Id: I2e23e87c4961b87c42a4c8a63f812fa9e0e44dec
2013-07-30 13:56:52 -07:00
Kenny Root 1443fdf933 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2013-07-30 13:56:52 -07:00
Dianne Hackborn aaa7ef86c6 Maybe really fix windows build. 2013-07-30 13:56:52 -07:00
Dianne Hackborn 3432efa95e Hopefully fix Windows build 2013-07-30 13:56:52 -07:00
Dianne Hackborn 235af97deb Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group.  Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
2013-07-30 13:56:52 -07:00
Kenny Root 9a2d83e698 Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2013-07-30 13:56:52 -07:00