608 Commits

Author SHA1 Message Date
Dianne Hackborn
8ae5a8e7c0 Get to the point of being able to do native drawing.
A little cleanup.

Change-Id: I37ef0557abf330d91d6fe47e81d062206b3bc346
2010-07-01 18:44:46 -07:00
Dianne Hackborn
54a181b1a2 Make real API for native code to get its window.
Added implementation to use ANativeWindow and provide
it to a NativeActivity.

Change-Id: I890d71b6e15d4af71e6cf81b327961d7061ec1c2
2010-07-01 14:43:23 -07:00
Christopher Tate
160edb3645 Add ability to guard a thread against setting its own prio to bg
The guard is compiled out by default because it adds overhead to
android.os.Process.setPriority().

Change-Id: Ibb2a648c6349b381abb7ae62a358888b04fba871
2010-06-30 18:25:01 -07:00
Dianne Hackborn
3c80a4a044 Implement default key handling for native code.
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
2010-06-30 10:49:40 -07:00
Dianne Hackborn
2e9f93e8db Update native activity & event APIs to follow correct conventions.
Change-Id: Ie64fb3a9c68bc9c117fa5621b75d1f609e304e0e
2010-06-29 10:43:54 -07:00
Jeff Brown
349703effc Native input event dispatching.
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
2010-06-28 19:10:54 -07:00
Nick Pelly
9bf39efb1b Do not log AT command traffic by default.
Bug: 2792732
Change-Id: I24cb14c14f49e606f0aef1d05a533b90b3dfff53
2010-06-24 12:25:42 -07:00
Eric Laurent
619346f902 Added support for audio sessions in MediaPlayer and AudioTrack.
Audio sessions are used to associate audio effects to particular instances (or groups) of MediaPlayers or AudioTracks.

Change-Id: Ib94eec43241cfcb416590f435ddce7ab39a07640
2010-06-22 17:14:04 -07:00
Dianne Hackborn
a95e4cb62f First stab at attaching native event dispatching.
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
2010-06-22 11:21:50 -07:00
Mike Lockwood
aaf39f8406 Merge "GPS: remove GpsEventThread from GpsLocationProvider" into gingerbread 2010-06-22 06:44:03 -07:00
Mike Lockwood
f602d362ba GPS: remove GpsEventThread from GpsLocationProvider
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>
2010-06-22 09:26:41 -04:00
Jack Palevich
224107a421 Add OpenGL ES 2.0 VBO versions glDrawElements and glVertexAttribPointer.
Change-Id: Id0069535e97fe96eef74e4d0c1d19b010061fe3b
2010-06-22 20:08:40 +08:00
Jeff Brown
5c225b1680 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
2010-06-17 13:27:16 -07:00
Jeff Brown
9c3cda04d9 More work in progress on native events.
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
2010-06-15 16:43:18 -07:00
Jeff Brown
46b9ac0ae2 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
2010-06-13 17:42:16 -07:00
Chih-Chung Chang
b8bb78f54b Change camera interface to support multiple cameras.
Change-Id: Ie88fe706d2278acf762eca87780de349434778a4
2010-06-11 16:47:33 +08:00
Mathias Agopian
8b73ae4a1e fix [2757903] Crash in EGL when creating an EGLSurface
Change-Id: I995947ac40d1a5c86dce495550baf6864ecf5f54
2010-06-10 17:06:27 -07:00
Christopher Tate
a8ebe8b3f5 am df2e2eff: Merge "Watchdog now records kernel stacks when it fires" into froyo
Merge commit 'df2e2eff9446c0220515fa7aab7857135e04e12e' into kraken

* commit 'df2e2eff9446c0220515fa7aab7857135e04e12e':
  Watchdog now records kernel stacks when it fires
2010-06-06 12:10:08 -07:00
Mathias Agopian
fae5cb2b35 optimize Surface.readFromParcel()
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
2010-06-04 18:57:41 -07:00
Christopher Tate
ecaa7b41ca Watchdog now records kernel stacks when it fires
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
2010-06-04 14:55:02 -07:00
Jaikumar Ganesh
a7c0bdc4e4 Delete local references to avoid reference table overflow.
Change-Id: I2218b97647e381bfe6d329b1b6134bb76c1832b6
2010-06-03 16:59:01 -07:00
Dianne Hackborn
74323fd1ab Update NativeActivity to allow direct surface access.
No actual native API for using a surface, but it's a step.

Change-Id: I627f26b705abc7a05edf9117411abfacf0fae64a
2010-05-18 18:16:35 -07:00
Nick Kralevich
79290ae976 Get rid of warnings when compiled with -Wformat-security
Change-Id: I5a7ad5be2aaf0fa0d164204d3c1bebf02ec55745
2010-05-13 15:31:00 -07:00
Dianne Hackborn
7d5cea988b am 7e76b6d1: am 6d00151c: Merge "Hopefully fix issue #2662536: Why is launcher being killed?" into froyo
Merge commit '7e76b6d191e1173bd85337a2861d9914922f5a0d' into kraken

* commit '7e76b6d191e1173bd85337a2861d9914922f5a0d':
  Hopefully fix issue #2662536: Why is launcher being killed?
2010-05-11 10:23:56 -07:00
Dianne Hackborn
906497c574 Hopefully fix issue #2662536: Why is launcher being killed?
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
2010-05-10 17:19:58 -07:00
Chih-Chung Chang
e25cc65639 Support multiple cameras in framework.
Change-Id: I081f0fbdca4b633715ea7c3b3d42f8662d27598a
2010-05-10 11:21:14 +08:00
Kenny Root
b658cc42aa Merge "Prevent local reference table overflows" into kraken 2010-05-06 17:12:13 -07:00
Christopher Tate
fa9e7c05c7 Sketch of Native input for MessageQueue / Looper / ViewRoot
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
2010-05-06 17:00:54 -07:00
Kenny Root
485dd21bbe Prevent local reference table overflows
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
2010-05-06 16:35:21 -07:00
Jaikumar Ganesh
33232d26bb Merge "Add UUID property for adapter." into kraken 2010-05-05 15:25:54 -07:00
Dianne Hackborn
69969e48f2 First pass at NativeActivity.
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
2010-05-05 15:17:26 -07:00
Jaikumar Ganesh
94278c9fd2 Add UUID property for adapter.
4.64 version of Bluez has the UUID property of adapter being reported.

Change-Id: Ibf451a14d58620ba8bea812cd302be0b4def5f74
2010-05-04 15:57:50 -07:00
Jaikumar Ganesh
9997f66f62 Revert "Fix runtime reboot when connecting to a A2DP headset and"
This reverts commit 55b0110fc298c403887b1311d7eabfffa230495f.
2010-05-04 15:52:42 -07:00
Jaikumar Ganesh
55b0110fc2 Fix runtime reboot when connecting to a A2DP headset and
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
2010-05-04 15:28:27 -07:00
Marco Nelissen
55fb51aa41 resolved conflicts for merge of 86303198 to kraken
Change-Id: Idd921c7108e4c2cd4a861ee1fb8b43e5d56f8f2f
2010-04-26 17:42:07 -07:00
Marco Nelissen
8138cb49e4 Make Surface.toString() show more useful info to help debug bug 2594388.
Change-Id: I005d3388503d8886e11a26fece30b87572934f15
2010-04-26 16:51:17 -07:00
Mathias Agopian
a8a0aa8b92 better fix for [2420565] Surface.lockCanvas() updates the dirty region too often
Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
2010-04-21 22:25:35 -07:00
Carl Shapiro
dbc108a718 am 15feb4de: am 19275cb5: Merge "Remove code to pass the nonexistant lockprofsample flag to Dalvik." into froyo
Merge commit '15feb4defc61c7bded6fdd3ea1c3781f25666275' into kraken

* commit '15feb4defc61c7bded6fdd3ea1c3781f25666275':
  Remove code to pass the nonexistant lockprofsample flag to Dalvik.
2010-04-20 11:50:45 -07:00
Carl Shapiro
8ba73ac72c Remove code to pass the nonexistant lockprofsample flag to Dalvik.
Change-Id: If334e21d770bc21a9b7c4f04d0fb652f53359231
2010-04-20 01:27:50 -07:00
Carl Shapiro
49ee271bba am cb2906e4: am d5a873fb: Merge "Add command line flags to enable lock profiling." into froyo
Merge commit 'cb2906e4bbb96b0be83029572a78f97dc6763eca' into kraken

* commit 'cb2906e4bbb96b0be83029572a78f97dc6763eca':
  Add command line flags to enable lock profiling.
2010-04-16 13:31:39 -07:00
Carl Shapiro
d8f3ec6e83 Add command line flags to enable lock profiling. 2010-04-15 22:42:17 -07:00
Mathias Agopian
8b138323d5 don't hardcode "mSurface" throughout our source code
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
2010-04-12 16:29:36 -07:00
Dan Egnor
aeeea3da3c am 505f22d1: am 2d3df559: Merge "Fix sim build (sim doesn\'t have strl*() reliably...)" into froyo
Merge commit '505f22d1a4dbf1fceaf8deca443d7322386964e1' into kraken

* commit '505f22d1a4dbf1fceaf8deca443d7322386964e1':
  Fix sim build (sim doesn't have strl*() reliably...)
2010-04-10 11:47:29 -07:00
Dan Egnor
4e8d8238e1 Fix sim build (sim doesn't have strl*() reliably...)
Just stub out the TrafficStats code for the sim.
Bug: 2578938

Change-Id: Ie555f67f581d05ee446ea29cb2223feb350c52f9
2010-04-08 23:47:06 -07:00
Dan Egnor
5b4cc93b0d am f5d506d9: am 78158db5: Hail-Mary attempt to avoid apparent blocking problems in readEvents().
Merge commit 'f5d506d92958d43449cb9ef77e6c9b6087e1cd68' into kraken

* commit 'f5d506d92958d43449cb9ef77e6c9b6087e1cd68':
  Hail-Mary attempt to avoid apparent blocking problems in readEvents().
2010-04-08 23:08:56 -07:00
Dan Egnor
78158db510 Hail-Mary attempt to avoid apparent blocking problems in readEvents().
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
2010-04-08 22:59:43 -07:00
Dan Egnor
a40b3a8d98 am c1420832: am 5945579e: Merge "Change TrafficStats to a new JNI implementation." into froyo
Merge commit 'c1420832a8f9c7fa62b143ce63c71062b3969c1b' into kraken

* commit 'c1420832a8f9c7fa62b143ce63c71062b3969c1b':
  Change TrafficStats to a new JNI implementation.
2010-04-08 14:53:06 -07:00
Dan Egnor
2b4abcd0c7 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
2010-04-07 19:06:29 -07:00
Mike Lockwood
00b74270c9 Move files internal to LocationManagerService from framework.jar to services.jar
Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-04 18:44:05 -04:00
Jaikumar Ganesh
d4afde3d12 am b8fc825d: am 3a0d1d11: Merge "Fix crash while turning bluetooth on, due to a race condition." into froyo
Merge commit 'b8fc825dfafd8792a4d9daead9d3d1b4a4b55de5' into kraken

* commit 'b8fc825dfafd8792a4d9daead9d3d1b4a4b55de5':
  Fix crash while turning bluetooth on, due to a race condition.
2010-03-31 23:22:51 -07:00