The guard is compiled out by default because it adds overhead to
android.os.Process.setPriority().
Change-Id: Ibb2a648c6349b381abb7ae62a358888b04fba871
The native code now maintains a list of all keys that may use
default handling. If the app finishes one of these keys
without handling it, the key will be passed back off to Java
for default treatment.
Change-Id: I6a842a0d728eeafa4de7142fae573f8c11099e18
Target identification is now fully native.
Fixed a couple of minor issues related to input injection.
Native input enabled by default, can be disabled by setting
WindowManagerPolicy.ENABLE_NATIVE_INPUT_DISPATCH to false.
Change-Id: I7edf66ed3e987cc9306ad4743ac57a116af452ff
Audio sessions are used to associate audio effects to particular instances (or groups) of MediaPlayers or AudioTracks.
Change-Id: Ib94eec43241cfcb416590f435ddce7ab39a07640
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
Rather than polling for events from the native code in an event thread,
we now require the GPS HAL libraries to call our callbacks from a thread
that is registered with the JVM to call directly into Java.
This eliminates a thread from our code and removes one step in the chain
of message passing from the GPS to the Location Manager client.
Change-Id: I2745a157690310ba9a699a8369f54a7366c6b1ba
Signed-off-by: Mike Lockwood <lockwood@android.com>
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
Refactored the code to eliminate potential deadlocks due to re-entrant
calls from the policy into the dispatcher. Also added some plumbing
that will be used to notify the framework about ANRs.
Change-Id: Iba7a10de0cb3c56cd7520d6ce716db52fdcc94ff
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
Merge commit 'df2e2eff9446c0220515fa7aab7857135e04e12e' into kraken
* commit 'df2e2eff9446c0220515fa7aab7857135e04e12e':
Watchdog now records kernel stacks when it fires
this is called for each relayout() and used to create a full Surface (cpp)
which in turn did some heavy work (including an IPC with surfaceflinger),
most of the time to destroy it immediatelly when the returned surface
(the one in the parcel) was the same.
we now more intelligentely read from the parcel and construct the new
object only if needed.
Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
The kernel threads are appended to the usual /data/anr/traces.txt file
and dropboxed along with the usual Dalvik stack dumps.
Change-Id: I120f1f5ee54c965efe9ac0c7f40fdef56385f1fa
NOTE: this change depends on the kernel publishing /proc/$PID/stack
It looks like there was a subtle bug where Process.setOomAdj() could
return false just because the given process doesn't exist, even though
it is documented to only return false if OOM killing is not supported
at all. This would cause the activity manager to fall into its code
path of trying to clean up processes itself, which it does a much
poorer problem at. I am thinking we may be seeing this problem more
now that the activity manager is killing background processes itself
when there are too many of them.
In addition, this change cleans up and reduces some of the logging
around killing processes.
Finally, try to improve process LRU management a bit by taking
into account process dependencies. Any dependent processes are
pulled up in the LRU list with the processes that is actually
moving. Also, we bring a process up if someone accesses its content
provider.
Change-Id: I34ea161f839679345578ffe681e8d9c5d26ab948
MessageQueue now uses a socket for internal signalling, and is prepared
to also handle any number of event input pipes, once the plumbing is
set up with ViewRoot / Looper to tell it about them as appropriate.
Change-Id: If9eda174a6c26887dc51b12b14b390e724e73ab3
If we're grabbing references to many strings in a loop, we have to
remove our local references so we don't overflow the VM's local
reference table.
Also, use env->ExceptionCheck() instead of checking for NULL value
returns on trying to allocate new items.
Bug: 2663816
Change-Id: I9cb5e17f6181dbb2f2c03d53841b2f5d8ab10f68
This is a rough sketch of the new pure-native API, which you can
use through a NativeActivity in your manifest (no Java code in
the .apk needed!).
Intentionally no docs yet, the API is still being seriously
messed with. But it works.
Change-Id: I0e916d58a0d159ecaf3689e41834eb8dc681c0c0
user toggles BT state.
Bug:2607218
This happens when Bluetooth is turned off, and when the headset is
still trying to connect. We get the connection result of
attempt before Bluetooth was toggled. We need to ignore this result.
Change-Id: I023406ec6d59880754ca4f1de676d0dce71b13c6
Merge commit '15feb4defc61c7bded6fdd3ea1c3781f25666275' into kraken
* commit '15feb4defc61c7bded6fdd3ea1c3781f25666275':
Remove code to pass the nonexistant lockprofsample flag to Dalvik.
this is used in a few places to get access to the android.view.Surface
native surface. use a macro instead. Also rename the field to mNativeSurface.
Change-Id: I1c6dea14abd6b8b1392c7f97b304115999355094
Use the same procedure (select() with a short timeout) used by "logcat -d",
which doesn't seem to have any blocking problems.
Bug: 2569403
Change-Id: Ia27bb4207919a1288716b41a007b4b4b52f8e90a
Merge commit 'c1420832a8f9c7fa62b143ce63c71062b3969c1b' into kraken
* commit 'c1420832a8f9c7fa62b143ce63c71062b3969c1b':
Change TrafficStats to a new JNI implementation.
Also change phone's ConnectionStateTrackers to use it directly,
rather than through the INetStat binder interface.
Bug: 2578938
Change-Id: I8858e2609cbec3be845a0ce5178cb03f67e01b41
Merge commit 'b8fc825dfafd8792a4d9daead9d3d1b4a4b55de5' into kraken
* commit 'b8fc825dfafd8792a4d9daead9d3d1b4a4b55de5':
Fix crash while turning bluetooth on, due to a race condition.