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
Modify OOM adj classes a bit, to take into account the new
heavy weight app type, and give "foreground services" their
own category to have a bettery chance to manager them when
things go wrong.
Also add some new code to battery stats to keep a history
of changes to the battery level.
Change-Id: I29f5ab6938777e1a7eafd7d8c38b5e564cc9f96a
This is a new public API for developers to opt-in to strict rules
about what they're allowed to do on certain threads. (this is the
public face of the @hide dalvik.system.BlockGuard, added recently...)
In practice this will be used for developers to opt-in to declaring
that they don't want to be allowed to do various operations (such as
disk I/O or network operations) on their main UI threads. (these
operations are often accidental, or even when they are fast come with
a good chance of being slow or very slow in some cases....)
Implementation wise, this is just a thread-local integer that has a
bitmask of the things that aren't allowed, and more bits for saying
what the violation penalty is. The penalties, of which multiple can
be chosen, include:
* logging
* dropbox uploading for analysis/reporting
* annoying dialog
* full-on crashing
These are all only very roughly implemented at this point, but all
parts now minimally work end-to-end now, so this is a good checkpoint
commit before this gets too large.
Future CLs will polish all the above 4 penalties, including
checksumming of stacktraces and minimizing penalties for duplicate
violations.
Change-Id: Icbe61a2e950119519e7364030b10c3c28d243abe
On an inflation error, the StatusBarService cleans up, removes / doesn't add
the views, and calls into the StatusBarManagerService, which tells the
NotificationManagerService to remove the notification.
That then calls all the way back into the StatusBarService, but I think being
extra careful is okay. Throughout the status bar, it's all keyed off of the
IBinder key, so if the app comes in with a good notification while we're
cleaning up, we won't lose the new notification or anything like that.
Change-Id: Iea78a637495a8b67810c214b951d5ddb93becacb
Unfortunately, PduParser does not allow application/vnd.wap.multipart.alternative as M-RETRIEVE.CONF but some Mobile carrier send message with this type.
This patch allows that and take the first part of multipart as message body.
It fixes http://code.google.com/p/android/issues/detail?id=8957
Change-Id: Ic93259c91331d1e67100439114b7c4f43a834368
Only one can be running at a time, their process can not be killed,
and a notification is posted while it is running.
Change-Id: I843015723947e0c934ae63a1aeee139327c0bc01
The EBNF statemachine description language was to difficult
to remember changed to use a simpler and more obvious psuedo
language.
Added HANDLED and NOT_HANDLED as it makes the psuedo code
more obvious.
Added getCurrentMessage primarily for use by code in enter
so that it can know why the new state is being entered.
Change-Id: I1446e417b77684fbde0020b1da0975eedc57cce4
Merge commit 'a3d5549c802bc4fbf1e1ca05bc3552db17212036' into kraken
* commit 'a3d5549c802bc4fbf1e1ca05bc3552db17212036':
Use SystemClock.elapsedRealtime in ShutdownThread timeout logic
Merge commit '098e58da93f304d7d7791f193c6237870b94989d' into froyo-plus-aosp
* commit '098e58da93f304d7d7791f193c6237870b94989d':
Use SystemClock.elapsedRealtime in ShutdownThread timeout logic
This avoids problems if the time is reset while shutting down.
Change-Id: I54c7c787e55648ebf5a68e79056f92fbac0081ae
Signed-off-by: Mike Lockwood <lockwood@android.com>
Merge commit '007ad7700a23ff7e618cfeee1eab97063c93b800' into kraken
* commit '007ad7700a23ff7e618cfeee1eab97063c93b800':
Adapt to new location of libcore
Parse custom text header and ignore it.
Parse "multipart/vnd.wap.multipart.alternative" which is a part of multipart body (nested multipart).
'uses-library' was not working for persistent applications.
Fix an NPE in InputMethodService when mExtractAction is null.
Some MMS carrier append own custom header as text into PduData. We should parse it and ignore it at the moment.
Change-Id: I4d6cf20f5cf99172ebbe310ab18101316eb04c77
Merge commit 'f9e90378d50210298d1cec2b913653597cd62be4' into kraken
* commit 'f9e90378d50210298d1cec2b913653597cd62be4':
Move the public method HttpDateTime.parse() into AndroidHttpClient.
Merge commit 'bc284a5f9f1e3f19ddd45cfb233f0d1775b612a7' into froyo-plus-aosp
* commit 'bc284a5f9f1e3f19ddd45cfb233f0d1775b612a7':
Move the public method HttpDateTime.parse() into AndroidHttpClient.
Merge commit '140d040b6a5d2dc01e999e6f7b69863c71b2272b' into kraken
* commit '140d040b6a5d2dc01e999e6f7b69863c71b2272b':
Pass cookie to TOKEN_CONTACT_INFO so that QuickContact without photo works again
Merge commit 'd8b9b511821a06d86b3ffaab0d71ee9ce3834678' into froyo-plus-aosp
* commit 'd8b9b511821a06d86b3ffaab0d71ee9ce3834678':
Pass cookie to TOKEN_CONTACT_INFO so that QuickContact without photo works again
Merge commit '733a2f654934d452b2febf6f80cd1136830758d5' into kraken
* commit '733a2f654934d452b2febf6f80cd1136830758d5':
Fix a crash in BatteryStatsImpl, due to a previous fix.
Merge commit '1b4c0d702066794b9ce97b02721aa9e552997381' into froyo-plus-aosp
* commit '1b4c0d702066794b9ce97b02721aa9e552997381':
Fix a crash in BatteryStatsImpl, due to a previous fix.
This is probably the real fix for the original bug. The last line was probably not
well formed and resulted in an overrun in the native code.
Bug: 2564824
Change-Id: I8a9cc267f8045a61eff4b5d532258afa32a8b837