Removed old input dispatch code.
Refactored the policy callbacks.
Pushed a tiny bit of the power manager state down to native.
Fixed long press on MENU.
Made the virtual key detection and cancelation a bit more precise.
Change-Id: I5d8c1062f7ea0ab3b54c6fadb058c4d5f5a9e02e
Can be accessed through PowerProfile.getBatteryCapacity()
Individual device profiles need to be updated with their capacities.
(merged from master)
Change-Id: Ie76ab6de47c44807a46934331665e077a7226566
Implement notification manager handling of bad notifications, to
call a new activity manager to have the owner's process crashed
(if there is one).
Change-Id: Ib15e8d0c598756f3b39c99cc2045c18e054daf6b
Provides the basic infrastructure for a
NativeActivity's native code to get an object representing
its event stream that can be used to read input events.
Still work to do, probably some API changes, and reasonable
default key handling (so that for example back will still
work).
Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
We now clear the battery stats when unplugging after the
battery is full. This allows us to use the "total" stats as
a new "since last charged" stat. Total is gone. I never used
it, it was worthless. Since last charged is a lot more
interesting.
The battery history now collects a lot more stats, and keeps
control over how much it can collect. Printing is now more
descriptive.
The kinds of stats have been renamed to SINCE_UNPLUGGED and
SINCE_DISCHARGED. The other two stats are still there, but
no longer printed; a future change will eliminate them
completely along with all of their state.
Change-Id: I4e9fcfcf8c30510092c76a8594f6021e9502fbc1
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
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.