Commit Graph

641 Commits

Author SHA1 Message Date
Jeff Brown
d8816c3c4c Fix app switch latency optimization.
This optimization was broken due to recent changes in how ANRs are handled.

Change-Id: Ic99248a12755fadac8d4893e7d305b773e038d3d
2010-09-16 16:41:46 -07:00
Jeff Brown
87fab277fd am 61cf67a2: am 24326f72: Merge "Input API review." into gingerbread
Merge commit '61cf67a220ba3205737c646c1c836a92074220de'

* commit '61cf67a220ba3205737c646c1c836a92074220de':
  Input API review.
2010-09-16 13:05:50 -07:00
Jeff Brown
128e33421b Merge "Input API review." into gingerbread 2010-09-16 12:57:56 -07:00
Jeff Brown
02a71f7ab4 am 7642c82c: am f4d788c9: Merge "Make input dispatcher only ANR for foreground windows." into gingerbread
Merge commit '7642c82c291051919aad87c797e2dc1d77ed55e1'

* commit '7642c82c291051919aad87c797e2dc1d77ed55e1':
  Make input dispatcher only ANR for foreground windows.
2010-09-15 21:42:28 -07:00
Jeff Brown
53a415e6d1 Make input dispatcher only ANR for foreground windows.
Redesigned the input dispatcher's ANR timeout mechanism so it is much
closer to Froyo's policy.  ANR is only ever signalled if the dispatcher
is waiting on a window to finish processing its previous event(s) and
there is new pending input.

In the old code, we tracked the dispatch timeout separately for each
input channel.  This was somewhat complicated and also resulted in the
situation where applications could ANR long after the user had pushed
them into the background.

Change-Id: I666ecada0952d4b95f1d67b9f733842b745c7f4b
2010-09-15 18:52:08 -07:00
Mathias Agopian
3fd1ed5938 am 310da64d: am f182e8a8: fix a typo where the eventtags code were wrong
Merge commit '310da64d78750cdba4349d7cc0a268c07155569d'

* commit '310da64d78750cdba4349d7cc0a268c07155569d':
  fix a typo where the eventtags code were wrong
2010-09-15 17:53:43 -07:00
Mathias Agopian
6a3de9a424 fix a typo where the eventtags code were wrong
Change-Id: I517112a1475c10b71009a0aa9c3894c76a1f270f
2010-09-15 12:46:59 -07:00
Jeff Brown
dc543aec70 am 14bc6b5d: am 09340a4b: Merge "Replace epoll() with poll() and rename PollLoop to Looper." into gingerbread
Merge commit '14bc6b5d0677e5c454a67775c852f90389bb4567'

* commit '14bc6b5d0677e5c454a67775c852f90389bb4567':
  Replace epoll() with poll() and rename PollLoop to Looper.
2010-09-15 12:32:29 -07:00
Mathias Agopian
c479e18db0 resolved conflicts for merge of 48a86240 to master
Change-Id: I2305fef9f4dd46183337217d822df3c675b6b6e5
2010-09-15 12:29:18 -07:00
Jeff Brown
b5764e066c Input API review.
Drop currently unsupported input features.
Add documentation comments.

Change-Id: I407d2e1dd90c5ee82983a3ccf177430d35ee7592
2010-09-14 20:46:14 -07:00
Jeff Brown
b06cca6228 Merge "Replace epoll() with poll() and rename PollLoop to Looper." into gingerbread 2010-09-14 15:27:33 -07:00
Jeff Brown
59abe7e090 Replace epoll() with poll() and rename PollLoop to Looper.
As part of this change, consolidated and cleaned up the Looper API so
that there are fewer distinctions between the NDK and non-NDK declarations
(no need for two callback types, etc.).

Removed the dependence on specific constants from sys/poll.h such as
POLLIN.  Instead looper.h defines events like LOOPER_EVENT_INPUT for
the events that it supports.  That should help make any future
under-the-hood implementation changes easier.

Fixed a couple of compiler warnings along the way.

Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
2010-09-14 01:59:45 -07:00
Mathias Agopian
35b48d10bc Add logging of various important graphics events
There are 16 events logged in the event log:
SF_APP_DEQUEUE_BEFORE
SF_APP_DEQUEUE_AFTER
SF_APP_LOCK_BEFORE
SF_APP_LOCK_AFTER
SF_APP_QUEUE

SF_REPAINT
SF_COMPOSITION_COMPLETE
SF_UNLOCK_CLIENTS
SF_SWAP_BUFFERS
SF_REPAINT_DONE

SF_FB_POST_BEFORE
SF_FB_POST_AFTER
SF_FB_DEQUEUE_BEFORE
SF_FB_DEQUEUE_AFTER
SF_FB_LOCK_BEFORE
SF_FB_LOCK_AFTER

all events log the buffer conserned and a timestamp in microseconds.

by default the logging is not enabled, to turn it on:
adb shell service call SurfaceFlinger 1006 i31 1
adb shell setprop debug.graphic_log 1

The effect is immediate in SurfaceFlinger, but applications need to be
restarted.

Change-Id: Ifc2e31f7aed072d9a7dede20ff2ce59231edbec1
2010-09-13 23:16:58 -07:00
Jeff Brown
055a7926e6 am 0f0541e4: am b88102f5: Input dispatcher ANR handling enhancements.
Merge commit '0f0541e40cfef51eb5c3769e53c1aa853b53aaf6'

* commit '0f0541e40cfef51eb5c3769e53c1aa853b53aaf6':
  Input dispatcher ANR handling enhancements.
2010-09-12 17:15:19 -07:00
Jeff Brown
a665ca805c Input dispatcher ANR handling enhancements.
This change is essentially a rewrite of the main input dispatcher loop
with the target identification folded in.  Since the input dispatcher now
has all of the window state, it can make better decisions about
when to ANR.

Added a .5 second deadline for processing app switch keys.  This behavior
predates Gingerbread but had not previously been ported.

Fixed some timing inaccuracies in the ANR accounting that could cause
applications to ANR sooner than they should have.

Added a mechanism for tracking key and motion events that have been
dispatched to a window so that appropriate cancelation events can be
synthesized when recovering from ANR.  This change helps to keep
applications in sync so they don't end up with stuck buttons upon
recovery from ANRs.

Added more comments to describe the tricky parts of PollLoop.

Change-Id: I13dffca27acb436fc383980db536abc4d8b9e6f1
2010-09-12 16:52:03 -07:00
Romain Guy
0ddf0656c4 Merge "Purge Skia objects from GL caches as needed." 2010-09-08 18:06:11 -07:00
Romain Guy
4e0c1f27fd Purge Skia objects from GL caches as needed.
Change-Id: I754c671cf790ad5ae8bf047ad328034217da4ecc
2010-09-08 18:04:33 -07:00
Jeff Brown
e1e37e4c7b am 8723bb58: am b21fb104: Fix key repeat delay.
Merge commit '8723bb58b17a07b7ca036cc76d737c6c0f4b13c7'

* commit '8723bb58b17a07b7ca036cc76d737c6c0f4b13c7':
  Fix key repeat delay.
2010-09-08 14:38:09 -07:00
Jeff Brown
6240634883 resolved conflicts for merge of a05088c1 to master
Change-Id: I7973f9f28586dec9b9659f8f662f40db7997a521
2010-09-08 13:02:55 -07:00
Jeff Brown
61ce3982e1 Fix key repeat delay.
Change-Id: I6216e082324ee29bf50e37acc673350ca5417c4d
2010-09-08 12:28:43 -07:00
Jeff Brown
af30ff6020 Add support for secure views.
Added the MotionEvent.FLAG_WINDOW_IS_OBSCURED flag which is set by the
input manager whenever another visible window is partly or wholly obscured
the target of a touch event so that applications can filter touches
accordingly.

Added a "filterTouchesWhenObscured" attribute to View which can be used to
enable filtering of touches when the view's window is obscured.

Change-Id: I936d9c85013fd2d77fb296a600528d30a29027d2
2010-09-08 11:50:55 -07:00
Dianne Hackborn
c946422d58 am a1205f07: am 2d3739d4: Merge "Modify native ALooper to take an explicit ident." into gingerbread
Merge commit 'a1205f07a6f0c745e8f42f16fe38c06af04143c7'

* commit 'a1205f07a6f0c745e8f42f16fe38c06af04143c7':
  Modify native ALooper to take an explicit ident.
2010-09-07 18:52:06 -07:00
Dianne Hackborn
45e0acb41a Modify native ALooper to take an explicit ident.
The ALooper API now uses an explicit "identifier" for the integer
that is returned rather than implicitly using the fd.  This allows
the APIs that had the fd to be a little more sane.

Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
2010-09-07 15:46:55 -07:00
Jeff Brown
9b83cce203 am df02df11: am 307ed31c: Merge "Remove incomplete input device enumeration NDK API." into gingerbread
Merge commit 'df02df115a594553b3ebaa95a0a7f7185a8787d3'

* commit 'df02df115a594553b3ebaa95a0a7f7185a8787d3':
  Remove incomplete input device enumeration NDK API.
2010-08-31 15:53:17 -07:00
Jeff Brown
774cf1baa1 Remove incomplete input device enumeration NDK API.
Change-Id: I32de74ff5fcf0e29179a2aee03ddabd22fa485bb
2010-08-31 15:24:55 -07:00
Brad Fitzpatrick
f3372f7ca3 am ae087369: am 63070856: Merge "Don\'t propagate StrictMode over one-way Binder calls." into gingerbread
Merge commit 'ae087369c56a270c33c1c1af5be7d3c5d7f94e80'

* commit 'ae087369c56a270c33c1c1af5be7d3c5d7f94e80':
  Don't propagate StrictMode over one-way Binder calls.
2010-08-31 15:06:24 -07:00
Brad Fitzpatrick
5273603e98 Don't propagate StrictMode over one-way Binder calls.
This was causing stack stitching problems where a one-way call with
violations followed by a two-way call without violations was getting
the previous one-way call's violation stack stitched on to the second
caller's stack.

The solution is a little more indirect than I would've liked
(preserving the binder's onTransact flags until enforceInterface) but
was seemingly necessary to work without changing the AIDL compiler.
It should also be sufficiently cheap, since no new calls to
thread-local IPCThreadState lookups were required.  The additional
work is just same-thread getter/setters on the existing
IPCThreadState.

Change-Id: I4b6db1d445c56e868e6d0d7be3ba6849f4ef23ae
2010-08-31 13:16:49 -07:00
Jeff Brown
d363aa2e41 am 36f0cb26: am 8d60866e: Input device calibration and capabilities.
Merge commit '36f0cb26cbb4ef62995ff2e5a540cf8814e7f030'

* commit '36f0cb26cbb4ef62995ff2e5a540cf8814e7f030':
  Input device calibration and capabilities.
2010-08-30 18:29:12 -07:00
Jeff Brown
38a7fabd96 Input device calibration and capabilities.
Finished the input device capability API.
Added a mechanism for calibrating touch devices to obtain more
accurate information about the touch contact area.
Improved pointer location to show new coordinates and capabilities.
Optimized pointer location display and formatting to avoid allocating large
numbers of temporary objects.  The GC churn was causing the application to
stutter very badly when more than a couple of fingers were down).
Added more diagnostics.

Change-Id: Ie25380278ed6f16c5b04cd9df848015850383498
2010-08-30 18:16:43 -07:00
Mathias Agopian
2ac5b0d6de am d322d163: am ae66946b: Merge "fix a race in SF buffer management" into gingerbread
Merge commit 'd322d16323176ddd5fef3383798176f64d0078c8'

* commit 'd322d16323176ddd5fef3383798176f64d0078c8':
  fix a race in SF buffer management
2010-08-27 16:18:12 -07:00
Mathias Agopian
0e7f4292c7 fix a race in SF buffer management
also remove some unused code.

Change-Id: Iae2c3309b7a08055f3e13a5b866c5c084993e352
2010-08-26 17:42:27 -07:00
Mathias Agopian
4ad298c12c am bc4389ed: am 8395b462: Merge "fix [2931513] Add support for setting the orientation of an ANativeWindow" into gingerbread
Merge commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64'

* commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64':
  fix [2931513] Add support for setting the orientation of an ANativeWindow
2010-08-24 17:56:40 -07:00
Mathias Agopian
b661d66013 fix [2931513] Add support for setting the orientation of an ANativeWindow
Also implement support for cropping.

Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
2010-08-24 15:40:50 -07:00
Jamie Gennis
89c2dd2cc2 Change the framework to use the new camera preview path.
This change makes the camera HAL interface take an ANativeWindow interface from
which all the camera preview buffers will be allocated.  The framework code
running in application processes now passes a Surface object rather than an
ISurface to the camera server via Binder when setting the preview surface.  The
camera server then forwards that Surface object (which implements the
ANativeWindow interface) to the camera HAL, which uses it to communicate with
SurfaceFlinger to allocate the camera preview buffers.

Change-Id: Ie438f721559cd7de5e4f848a26d96360dda07b5f
2010-08-23 14:31:30 -07:00
Andreas Huber
3f45e44adf Merge "Squashed commit of the following:" 2010-08-23 12:31:59 -07:00
Andreas Huber
8b42e8a5d8 Squashed commit of the following:
commit 35cc68814a9537c31fde146e171e7b0bbdfe211e
Author: Andreas Huber <andih@google.com>
Date:   Mon Aug 16 08:48:42 2010 -0700

    Only enable support for yuv to yuv conversion on passion, where it's available, use the slower yuv->rgb565 path everywhere else.

commit d8ac5a8814103e60d11d2acf61997fc31a1dc58d
Author: Andreas Huber <andih@google.com>
Date:   Fri Aug 13 13:56:44 2010 -0700

    The software renderer takes over all rendering, converting from yuv to yuv if possible and rgb565 otherwise.

commit 684972074b74318bdcb826ed9b5b0864d2d2e273
Author: Andreas Huber <andih@google.com>
Date:   Fri Aug 13 09:34:35 2010 -0700

    A first shot at supporting the new rendering APIs.

Change-Id: Iea9b32856da46950501f1a700f616b5feac710fd
2010-08-23 12:30:24 -07:00
Kenny Root
24b2aee9ca am 821afa9a: am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread
Merge commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973'

* commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973':
  Add OBB flags to support overlays
2010-08-21 09:41:12 -07:00
Jeff Brown
e09c4c710e am d25f0aea: am 99401b29: Merge "Add support for throttling motion events." into gingerbread
Merge commit 'd25f0aea1cebe93aff55a75374e172f87115f1b3'

* commit 'd25f0aea1cebe93aff55a75374e172f87115f1b3':
  Add support for throttling motion events.
2010-08-21 09:35:13 -07:00
Jeff Brown
297f493405 am 33992d41: am 72e0b2ab: Merge "Fix some input device mapping bugs with certain drivers." into gingerbread
Merge commit '33992d4195fe55f42ba6919f5a07707a51a12d5d'

* commit '33992d4195fe55f42ba6919f5a07707a51a12d5d':
  Fix some input device mapping bugs with certain drivers.
2010-08-19 23:43:19 -07:00
Kenny Root
1068812158 Merge "Add OBB flags to support overlays" into gingerbread 2010-08-19 09:09:32 -07:00
Jeff Brown
542412c8c9 Add support for throttling motion events.
Change-Id: I24b3a17753e91ecda60a60fe5cd2e6b3260e033d
2010-08-18 16:58:27 -07:00
Jeff Brown
db1e2bcbc8 am 29eb491a: am 3922484d: Merge "Optimize EventHub reads." into gingerbread
Merge commit '29eb491a5addc78003299ecab6ab6c716201f9dc'

* commit '29eb491a5addc78003299ecab6ab6c716201f9dc':
  Optimize EventHub reads.
2010-08-18 14:21:07 -07:00
Jeff Brown
6f7d4ed7b8 am 8fd80e92: am 72ce4235: Merge "Fix possible race conditions during channel unregistration." into gingerbread
Merge commit '8fd80e924a2f40f6a785f834914f8a6f18a3aa9d'

* commit '8fd80e924a2f40f6a785f834914f8a6f18a3aa9d':
  Fix possible race conditions during channel unregistration.
2010-08-18 14:20:24 -07:00
Jeff Brown
36cb115c77 Merge "Fix some input device mapping bugs with certain drivers." into gingerbread 2010-08-18 13:38:32 -07:00
Jeff Brown
d64c855821 Fix some input device mapping bugs with certain drivers.
On single-touch devices, pointer up/down is signalled by a BTN_TOUCH
key event.  Previously we handled BTN_TOUCH immediately but some drivers
may produce the sequence BTN_TOUCH, ABS_X, ABS_Y, SYN_REPORT on pointer down
which caused us to emit a bad initial pointer down location.
Now we wait for SYN_REPORT before reporting the up or down.

On multi-touch devices, pointer up can be signalled by as little as
the sequence SYN_MT_REPORT, SYN_REPORT.  This change ensures that we
handle this case.

Added support for reading ABS_MT_PRESSURE when available.
Corrected mapping of touchMajor/touchMinor on single touch devices.
Minor code cleanup.

Change-Id: Ic7ec4811241ed85a06e59b8a839ca05180d491d4
2010-08-18 13:37:45 -07:00
Jeff Brown
62576ec6f3 am 3922484d: Merge "Optimize EventHub reads." into gingerbread
Merge commit '3922484d7458a4ab72fc1ca8952a0776dd1c7d20' into gingerbread-plus-aosp

* commit '3922484d7458a4ab72fc1ca8952a0776dd1c7d20':
  Optimize EventHub reads.
2010-08-18 13:37:44 -07:00
Jeff Brown
4c8c491bbb am 72ce4235: Merge "Fix possible race conditions during channel unregistration." into gingerbread
Merge commit '72ce42352c1c229e05d910b4176f3cddb608e814' into gingerbread-plus-aosp

* commit '72ce42352c1c229e05d910b4176f3cddb608e814':
  Fix possible race conditions during channel unregistration.
2010-08-18 13:36:08 -07:00
Jens Gulin
7dcaa58496 Keep track of remaining fd when devices are removed
Sometimes the wrong fd was accessed when the device was addressed
by device id.

The earlier implementation assumed that two arrays were in sync
but one of them was compacted when devices were removed. Instead
of that dependency the device now keeps track of it's file descriptor.

Change-Id: Ib0f320603aafb07ded354bc3687de9759c9068f2
2010-08-18 10:54:03 -07:00
Kenny Root
28e9b9f243 Add OBB flags to support overlays
* Add flags field in OBB footer to support overlays.

* Remove unused 'crypto' and 'filesystem' fields in obbtool (could
  later be supported in the "flags" field of the OBB footer).

* Add notes to document OBB classes before shipping.

Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
2010-08-18 09:34:58 -07:00
Jeff Brown
827630744a Optimize EventHub reads.
Change-Id: Id7d09c0a6e5c741c1e29becd2b6560772c5ff372
2010-08-17 19:40:26 -07:00
Jeff Brown
0cacb87f02 Fix possible race conditions during channel unregistration.
Previously, the input dispatcher assumed that the input channel's
receive pipe file descriptor was a sufficiently unique identifier for
looking up input channels in its various tables.  However, it can happen
that an input channel is disposed and then a new input channel is
immediately created that reuses the same file descriptor.  Ordinarily
this is not a problem, however there is a small opportunity for a race
to arise in InputQueue.

When InputQueue receives an input event from the dispatcher, it
generates a finishedToken that encodes the channel's receive pipe fd,
and a sequence number.  The finishedToken is used by the ViewRoot
as a handle for the event so that it can tell the InputQueue when
the event has finished being processed.

Here is the race:

1. InputQueue receives an input event, assigns a new finishedToken.
2. ViewRoot begins processing the input event.
3. During processing, ViewRoot unregisters the InputChannel.
4. A new InputChannel is created and is registered with the Input Queue.
   This InputChannel happens to have the same receive pipe fd as
   the one previously registered.
5. ViewRoot tells the InputQueue that it has finished processing the
   input event, passing along the original finishedToken.
6. InputQueue throws an exception because the finishedToken's receive
   pipe fd is registered but the sequence number is incorrect so it
   assumes that the client has called finish spuriously.

The fix is to include a unique connection id within the finishedToken so
that the InputQueue can accurately confirm that the token belongs to
the currently registered InputChannel rather than to an old one that
happened to have the same receive pipe fd.  When it notices this, it
ignores the spurious finish.

I've also made a couple of other small changes to avoid similar races
elsewhere.

This patch set also includes a fix to synthesize a finished signal
when the input channel is unregistered on the client side to
help keep the server and client in sync.

Bug: 2834068
Change-Id: I1de34a36249ab74c359c2c67a57e333543400f7b
2010-08-17 17:03:42 -07:00
Jean-Baptiste Queru
68f73555d5 am ddbcce3a: Merge "resolved conflicts for merge of be50507b to gingerbread-plus-aosp" into gingerbread-plus-aosp
Merge commit 'ddbcce3afbb38680fb84583f7bad5209307e6459'

* commit 'ddbcce3afbb38680fb84583f7bad5209307e6459':
  Keep track of remaining fd when devices are removed
2010-08-17 09:06:52 -07:00
Jean-Baptiste Queru
28a989b03b resolved conflicts for merge of be50507b to gingerbread-plus-aosp
Change-Id: Iaa5fb62f7b82b488bca192e7f374c044c7e1e6a7
2010-08-17 09:01:26 -07:00
Jeff Brown
fff3f4af49 am f66f8a58: am 95af0c14: Merge "Add support for the PointerLocation overlay." into gingerbread
Merge commit 'f66f8a58cc4412bd258e1d5b11cac17a617bdc58'

* commit 'f66f8a58cc4412bd258e1d5b11cac17a617bdc58':
  Add support for the PointerLocation overlay.
2010-08-11 16:22:47 -07:00
Jeff Brown
2f09a77659 Merge "Add support for the PointerLocation overlay." into gingerbread 2010-08-11 16:15:48 -07:00
Jeff Brown
3f9ff2076c Add support for the PointerLocation overlay.
This change involves adding a new method to IWindowManager,
monitorInput() that returns an InputChannel to receive a copy of all
input that is dispatched to applications.  The caller must have
the READ_INPUT_STATE permission to make this request (similar to
other window manager methods such as getKeycodeState).

Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
2010-08-11 14:46:32 -07:00
Kenny Root
8264321e31 am 80328ba0: am 8ea71511: Merge "Initial tool for OBB manipulation" into gingerbread
Merge commit '80328ba09606bd0825d7d4c9a4f213d1de09e53a'

* commit '80328ba09606bd0825d7d4c9a4f213d1de09e53a':
  Initial tool for OBB manipulation
2010-08-11 14:15:20 -07:00
Kenny Root
1dfd9f8a97 Initial tool for OBB manipulation
Add "obbtool" host command for adding, removing, and querying Opaque
Binary Blob (OBB) information from a file.

Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
2010-08-11 11:24:41 -07:00
Dianne Hackborn
f09b0ae832 am 679ac09a: am a5ae50cd: Merge "More native work." into gingerbread
Merge commit '679ac09a5c22175354f3a04b28456b323839530e'

* commit '679ac09a5c22175354f3a04b28456b323839530e':
  More native work.
2010-08-11 00:50:56 -07:00
Dianne Hackborn
c3ef3ae552 More native work.
Implement save/restore of state, and add native APIs for
configuration information.

Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
2010-08-11 00:29:59 -07:00
Jeff Brown
8cf167fd58 am 95105f3c: am c3fc2d03: Fix safe mode and KeyEvent.getMaxKeyCode().
Merge commit '95105f3c25110f28b236cfa71e9ad74533eef854'

* commit '95105f3c25110f28b236cfa71e9ad74533eef854':
  Fix safe mode and KeyEvent.getMaxKeyCode().
2010-08-10 16:39:10 -07:00
Jeff Brown
8d4dfd25f7 Fix safe mode and KeyEvent.getMaxKeyCode().
Bug: 2901731
Change-Id: I78617c1b9dee3790fc590e5af4b5083368873184
2010-08-10 16:28:03 -07:00
Kenny Root
404b6473e9 am d7ce227b: am 818490ab: Fix String8::operator+
Merge commit 'd7ce227bcb854f048124bbc487eba844c6599142'

* commit 'd7ce227bcb854f048124bbc487eba844c6599142':
  Fix String8::operator+
2010-08-06 19:04:09 -07:00
Kenny Root
aa966638b9 Fix String8::operator+
The LHS was ignored when using:
  String8 + String8
  String8 + (const char*)

Add unit tests for above.

Bug: 2898473
Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
2010-08-06 09:00:10 -07:00
Chris Tate
5e9ccb8f3b am 9f6b16a2: am 5d46ce24: Merge "Enhanced VelocityTracker for > 5 pointers and fixed bugs." into gingerbread
Merge commit '9f6b16a29b62f29496bc652cfec7d6fe9f08c7f4'

* commit '9f6b16a29b62f29496bc652cfec7d6fe9f08c7f4':
  Enhanced VelocityTracker for > 5 pointers and fixed bugs.
2010-08-04 11:12:32 -07:00
Jeff Brown
b183fbd646 Enhanced VelocityTracker for > 5 pointers and fixed bugs.
Improved PointerLocation tool to use VelocityTracker more efficiently
and correctly when multiple pointers are down.

Fixed a bug in TouchInputMapper where it was not correctly copying
the id to index map in the last touch data.  This could cause strange
behavior on secondary pointer up events.

Also added finished callback pooling in InputQueue.

Change-Id: Ia85e52ac2fb7350960ea1d7edfbe81a1b3e8267b
2010-07-30 20:08:29 -07:00
Jeff Brown
ec05cd4a97 am 3b724c83: am 00e5c613: Merge "Improve thread safety of input mappers." into gingerbread
Merge commit '3b724c836b13b320b2b2c492c28660617e0d503e'

* commit '3b724c836b13b320b2b2c492c28660617e0d503e':
  Improve thread safety of input mappers.
2010-07-30 14:52:12 -07:00
Jeff Brown
b51719b9ae Improve thread safety of input mappers.
Also fixed bug where old touch screen size could be reported by
getMotionRange if an orientation change occurred but the user has not
yet touched the screen.

Bug: 2877345
Change-Id: I7878f47458f310ed6ebe6a5d1b2c9bec2c598ab9
2010-07-30 14:43:58 -07:00
Mathias Agopian
73409df32e resolved conflicts for merge of 02513855 to master
Change-Id: Ie33d57798d3d5b800edde753dac86de062bc270c
2010-07-29 22:06:44 -07:00
Mathias Agopian
a48bcf62b6 Added SensorManager.getMinDelay()
Exposed the new "min delay" sensor property through native and
java sensor apis. This allows the caller to know what is the
maximum rate at which a sensor can return events, or, if a sensor
works in "update" mode (events returned only when the value changes).

Also augmented SensorManager.regusterSensorEvent() so that it can
accept a value in microsecond in addition to the 4 constants already
defined.

Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
2010-07-29 18:18:00 -07:00
Jeff Brown
f67c53eee3 DO NOT MERGE: Fix input event injection ANRs on UI thread.
Added a new asynchronous injection mode and made the existing
synchronization mechanism more robust.

Change-Id: Ia4aa04fd9b75ea2461a844c5b7933c831c1027e6
2010-07-29 12:54:27 -07:00
Jeff Brown
e5a5aa16d3 Fixed StatusBar ANRs due to input event injection on UI thread.
Added a new asynchronous injection mode and made the existing
synchronization mechanism more robust.

Change-Id: I0464f70ff5cbd519dbb02686b2cb5d810fe7dbb2
2010-07-29 12:19:08 -07:00
Mathias Agopian
bc5aac5d45 am 9362ea76: am 9f2a91bc: Merge "fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot dequeue all allocated buffers at once." into gingerbread
Merge commit '9362ea760f565389f5accce7e17476d05510ed59'

* commit '9362ea760f565389f5accce7e17476d05510ed59':
  fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot dequeue all allocated buffers at once.
2010-07-28 16:36:08 -07:00
Mathias Agopian
edae28809a Merge "fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot dequeue all allocated buffers at once." into gingerbread 2010-07-28 16:30:56 -07:00
Christopher Tate
01d1669b89 am 1de9f490: am bae6fe24: Merge "Support streaming of compressed assets > 1 megabyte" into gingerbread
Merge commit '1de9f490b5c3f293b3748be3d4ccf3f78cdf460b'

* commit '1de9f490b5c3f293b3748be3d4ccf3f78cdf460b':
  Support streaming of compressed assets > 1 megabyte
2010-07-28 15:41:30 -07:00
Christopher Tate
46f28d328a Merge "Support streaming of compressed assets > 1 megabyte" into gingerbread 2010-07-28 15:36:48 -07:00
Christopher Tate
a45a8008c6 Support streaming of compressed assets > 1 megabyte
Compressed assets larger than one megabyte are now decompressed on demand
rather than being decompressed in their entirety and held in memory.  Reading
the data in order is relatively efficient, as is seeking forward in the stream.
Seeking backwards is supported, but requires reprocessing the compressed data
from the beginning, so is very inefficient.

In addition, the size limit on compressed assets has been eliminated.

Change-Id: I6e68247957e6c53e7e8ba70d12764695f1723bad
2010-07-28 15:33:28 -07:00
Jeff Brown
2ef6cdec33 am 9795a25d: am 6d0fec2d: Refactor input reader to support new device types more easily.
Merge commit '9795a25da060f9a7df87da8ab43fb1086d4322a5'

* commit '9795a25da060f9a7df87da8ab43fb1086d4322a5':
  Refactor input reader to support new device types more easily.
2010-07-28 14:27:55 -07:00
Jeff Brown
e57e895080 Refactor input reader to support new device types more easily.
Refactored the input reader so that each raw input protocol is handled
by a separate subclass of the new InputMapper type.  This way, behaviors
pertaining to keyboard, trackballs, touchscreens, switches and other
devices are clearly distinguished for improved maintainability.

Added partial support for describing capabilities of input devices
(incomplete and untested for now, will be fleshed out in later commits).

Simplified EventHub interface somewhat since InputReader is taking over
more of the work.

Cleaned up some of the interactions between InputManager and
WindowManagerService related to reading input state.

Fixed swiping finger from screen edge into display area.

Added logging of device information to 'dumpsys window'.

Change-Id: I17faffc33e3aec3a0f33f0b37e81a70609378612
2010-07-28 14:16:15 -07:00
Mathias Agopian
208cb07724 fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot dequeue all allocated buffers at once.
this situation happened when the last buffer needed to be resized
(or allocated, the first time). the assumption was that the buffer
was in use by SF itself as the current buffer (obviously, this
assumption made no sense when the buffer had never been allocated, btw).

the system would wait until some other buffer became the "front" buffer.

we fix this problem by entirely removing the requirement that the
buffer being resized cannot be the front buffer. instead, we just
allocate a new buffer and replace the front buffer by the new one.

the downside is that this uses more memory (an extra buffer) for a
brief amount of time while the old buffer is being reallocated and
before it has actually been replaced.

Change-Id: I022e4621209474ceb1c671b23deb4188eaaa7285
2010-07-27 20:11:35 -07:00
Brad Fitzpatrick
b8f4015c0a am 245cb784: am 84c924a6: Merge "Replace several IPCThreadState::get() lookups with one." into gingerbread
Merge commit '245cb7846c82f7c0840e13f0b994d356846b1678'

* commit '245cb7846c82f7c0840e13f0b994d356846b1678':
  Replace several IPCThreadState::get() lookups with one.
2010-07-27 14:04:14 -07:00
Brad Fitzpatrick
70081a1511 Replace several IPCThreadState::get() lookups with one.
Also, make StrictMode's ThreadLocal final.

Change-Id: I08d400ed254fa67bb7a3dae1227f205a54c00df0
2010-07-27 12:28:57 -07:00
Mathias Agopian
267e73c675 am 1f2ec407: am 23e8de26: propagate sensor event rate properly
Merge commit '1f2ec4070aa9c999d41dc50a892a896e894c5710'

* commit '1f2ec4070aa9c999d41dc50a892a896e894c5710':
  propagate sensor event rate properly
2010-07-21 18:13:39 -07:00
Mathias Agopian
a7a3160daa resolved conflicts for merge of bc54e63c to master
Change-Id: I4245b15b4cda6963d735442c0c6a04a0477ff5e1
2010-07-21 18:10:22 -07:00
Mathias Agopian
e3c8234765 propagate sensor event rate properly
Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc
2010-07-21 16:09:39 -07:00
Mathias Agopian
a7352c9f4a new SensorService
remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.

Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
2010-07-19 17:57:29 -07:00
Jamie Gennis
3154334630 am 04b95313: am c8c79a65: Merge "Re-use existing Surface objects when reading them from parcels." into gingerbread
Merge commit '04b953132edb5482f0aa6d992f89e7016961528c'

* commit '04b953132edb5482f0aa6d992f89e7016961528c':
  Re-use existing Surface objects when reading them from parcels.
2010-07-16 16:25:23 -07:00
Jeff Brown
e085084dc5 am 7b8df313: am 00ba8844: Fix individual pointer id up/down reporting.
Merge commit '7b8df313f714d6e8d536e0f8bbe5496fe9a6c26d'

* commit '7b8df313f714d6e8d536e0f8bbe5496fe9a6c26d':
  Fix individual pointer id up/down reporting.
2010-07-16 16:25:13 -07:00
Jamie Gennis
874da6e438 Merge "Re-use existing Surface objects when reading them from parcels." into gingerbread 2010-07-16 15:14:44 -07:00
Jeff Brown
3cf1c9b844 Fix individual pointer id up/down reporting.
Fix a minor threading bug in InputManager dump.

Change-Id: Ic2eecf7df5a8dc9f40561fcb03ebe58a2c073778
2010-07-16 15:11:24 -07:00
Jamie Gennis
aca4e22879 Re-use existing Surface objects when reading them from parcels.
This change adds a process-global cache of previously deserialized Surface
objects so that if a Surface object wrapping the same ISurface gets received
again the same Surface can be used.  This is important because the 'tail'
pointer in the SharedBufferClient is stored only on the client side, and needs
to be the same for all the Surface objects wrapping an ISurface instance.  This
solves the problem by making there only be one Surface object wrapping an
ISurface per process.

Change-Id: I4bf0b8787885c56277622fca053022d2bb638902
2010-07-16 13:03:15 -07:00
Jeff Brown
cfa6d98278 resolved conflicts for merge of f7adbe10 to master
Change-Id: I898a5e53b180adaee2337c0c0b9896c799d056e7
2010-07-16 10:06:33 -07:00
Dianne Hackborn
a2c4654c2f am 9c37e5ad: am 75a91389: Merge "Implement native key pre-dispatching to IMEs." into gingerbread
Merge commit '9c37e5add9d7678a29b4e0d1e178fe78a13db961'

* commit '9c37e5add9d7678a29b4e0d1e178fe78a13db961':
  Implement native key pre-dispatching to IMEs.
2010-07-16 09:12:29 -07:00
Jeff Brown
0a128e3cbe Fix bug with phantom input windows.
Add dumpsys integration for the native input dispatcher.
Add some InputDevice API stubs.
Add an appendFormat helper method to String8 for printf style
string formatting mainly for debugging purposes.
Use generic ArrayList<WindowState> everywhere in WindowManagerService
to eliminate unnecessary casts all over.

Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44
2010-07-16 00:02:48 -07:00
Jeff Brown
1a15c6eaff resolved conflicts for merge of aca672ba to master
Change-Id: I7ae11fca0acdbf513a4870226d0d3e3cafbe9a08
2010-07-15 23:47:29 -07:00
Brad Fitzpatrick
721c4162c3 am cc52121c: am c4b204bd: Merge "More StrictMode work, keeping Binder & BlockGuard\'s thread-locals in-sync." into gingerbread
Merge commit 'cc52121c4f88e9feb8404937bcbfff6e73084666'

* commit 'cc52121c4f88e9feb8404937bcbfff6e73084666':
  More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync.
2010-07-15 23:05:35 -07:00
Christopher Tate
ba57d1b9a5 am 078ccbdb: am 2c40582a: Merge "Add native C APIs for working with the Asset Manager" into gingerbread
Merge commit '078ccbdbb98c118aa87cab2fef61ff90dd128358'

* commit '078ccbdbb98c118aa87cab2fef61ff90dd128358':
  Add native C APIs for working with the Asset Manager
2010-07-15 23:05:27 -07:00
Dianne Hackborn
0e8852766d Implement native key pre-dispatching to IMEs.
This significantly re-works the native key dispatching code to
allow events to be pre-dispatched to the current IME before
being processed by native code.  It introduces one new public
API, which must be called after retrieving an event if the app
wishes for it to be pre-dispatched.

Currently the native code will only do pre-dispatching of
system keys, to avoid significant overhead for gaming input.
This should be improved to be smarted, filtering for only
keys that the IME is interested in.  Unfortunately IMEs don't
currently provide this information. :p

Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
2010-07-15 22:05:33 -07:00
Jeff Brown
5c1ed84a2d Add support for new input sources.
Added several new coordinate values to MotionEvents to capture
touch major/minor area, tool major/minor area and orientation.

Renamed NDK input constants per convention.

Added InputDevice class in Java which will eventually provide
useful information about available input devices.

Added APIs for manufacturing new MotionEvent objects with multiple
pointers and all necessary coordinate data.

Fixed a bug in the input dispatcher where it could get stuck with
a pointer down forever.

Fixed a bug in the WindowManager where the input window list could
end up containing stale removed windows.

Fixed a bug in the WindowManager where the input channel was being
removed only after the final animation transition had taken place
which caused spurious WINDOW DIED log messages to be printed.

Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
2010-07-15 18:32:33 -07:00
Brad Fitzpatrick
be581cfa17 Merge "More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync." into gingerbread 2010-07-15 15:42:12 -07:00
Christopher Tate
9373680116 Add native C APIs for working with the Asset Manager
Change-Id: I493b142c4b35e5cc1a1e85283bb5dfb306a6d261
2010-07-15 14:28:21 -07:00
Brad Fitzpatrick
a877cd85b5 More StrictMode work, keeping Binder & BlockGuard's thread-locals in-sync.
Change-Id: Ia67cabcc17a73a0f15907ffea683d06bc41b90e5
2010-07-15 13:18:05 -07:00
Mathias Agopian
9382d111bb am c74034b6: am 24651682: added BinderService<> template to help creating native binder services
Merge commit 'c74034b6bf0940dc80c4d4efa1e677ad0d2dfd6c'

* commit 'c74034b6bf0940dc80c4d4efa1e677ad0d2dfd6c':
  added BinderService<> template to help creating native binder services
2010-07-14 20:18:50 -07:00
Mathias Agopian
a1e6bc864f added BinderService<> template to help creating native binder services
Change-Id: Id980899d2647b56479f8a27c89eaa949f9209dfe
2010-07-14 18:43:19 -07:00
Mathias Agopian
d10f9fbc39 am db386f2c: am c9a11088: Merge "first step at implementing the native sensor support" into gingerbread
Merge commit 'db386f2c263c6e9e4b825d4c9a320849f8f2c916'

* commit 'db386f2c263c6e9e4b825d4c9a320849f8f2c916':
  first step at implementing the native sensor support
2010-07-14 16:39:55 -07:00
Mathias Agopian
e1ea0811de Merge "first step at implementing the native sensor support" into gingerbread 2010-07-14 16:32:04 -07:00
Mathias Agopian
589ce85ee4 first step at implementing the native sensor support
in this commit:
- implemented the C stub
- implemented the binder interfaces involved
- implemented most of the C++ client side

missing:
- SensorManager cannot connect to the SensorServer yet
(because there is no SensorServer yet)

Change-Id: I75010cbeef31c98d6fa62fd5d388dcef87c2636b
2010-07-13 22:21:56 -07:00
Dianne Hackborn
66d3d8e488 am f8d9379b: am d76b67c3: IME events are now dispatched to native applications.
Merge commit 'f8d9379bd834573feca085284970cf686993c330'

* commit 'f8d9379bd834573feca085284970cf686993c330':
  IME events are now dispatched to native applications.
2010-07-13 19:50:36 -07:00
Dianne Hackborn
ce838a265d IME events are now dispatched to native applications.
And also:

- APIs to show and hide the IME, and control its interaction with the app.
- APIs to tell the app when its window resizes and needs to be redrawn.
- API to tell the app the content rectangle of its window (to layout
  around the IME or status bar).

There is still a problem with IME interaction -- we need a way for the
app to deliver events to the IME before it handles them, so that for
example the back key will close the IME instead of finishing the app.

Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
2010-07-13 18:36:46 -07:00
Jeff Brown
94eed383c9 am 89ee578b: am fd035829: Add initial gamepad support.
Merge commit '89ee578b7053d27a50922f82feb94bf6054b330c'

* commit '89ee578b7053d27a50922f82feb94bf6054b330c':
  Add initial gamepad support.
2010-07-13 17:48:56 -07:00
Jeff Brown
8575a87b0d Add initial gamepad support.
Change-Id: I0439648f6eb5405f200e4223c915eb3a418b32b9
2010-07-13 17:04:57 -07:00
Brad Fitzpatrick
0c2aaca5d6 am 706623dd: am c0a7e690: Add Parcel::readExceptionCode() and Parcel::writeNoException()
Merge commit '706623ddb8314850c0551f0b66e24b5f0bd28620'

* commit '706623ddb8314850c0551f0b66e24b5f0bd28620':
  Add Parcel::readExceptionCode() and Parcel::writeNoException()
2010-07-13 15:57:20 -07:00
Brad Fitzpatrick
837a0d0fb2 Add Parcel::readExceptionCode() and Parcel::writeNoException()
Add native Parcel methods analogous to the Java versions.

Currently, these don't do much, but upcoming StrictMode work changes
the RPC calling conventions in some cases, so it's important that
everybody uses these consistently, rather than having a lot of code
trying to parse RPC responses out of Parcels themselves.

As a summary, the current convention that Java Binder services use is
to prepend the reply Parcel with an int32 signaling the exception
status:

     0: no exception
     -1: Security exception
     -2: Bad Parcelable
     -3: ...
     -4: ...
     -5: ...

... followed by Parceled String if the exception code is non-zero.

With an upcoming change, it'll be the case that a response Parcel can,
non-exceptionally return rich data in the header, and also return data
to the caller.  The important thing to note in this new case is that
the first int32 in the reply parcel *will not be zero*, so anybody
manually checking for it with reply.readInt32() will get false
negative failures.

Short summary: If you're calling into a Java service and manually
checking the exception status with reply.readInt32(), change it to
reply.readExceptionCode().

Change-Id: I23f9a0e53a8cfbbd9759242cfde16723641afe04
2010-07-13 15:45:18 -07:00
Dianne Hackborn
47c320febd am b14f325a: am 289b9b62: Add ANativeWindow API for directly drawing to the surface bits.
Merge commit 'b14f325a0118ffce286155caaabaae149653462c'

* commit 'b14f325a0118ffce286155caaabaae149653462c':
  Add ANativeWindow API for directly drawing to the surface bits.
2010-07-09 17:05:23 -07:00
Dianne Hackborn
9147d11a5f Add ANativeWindow API for directly drawing to the surface bits.
Also other cleanup and fixes:

- We now properly set the default window format to 565.
- New APIs to set the window format and flags from native code.
- Tweaked glue for simpler handling of the "destroy" message.
- Um, other stuff.

Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
2010-07-09 16:58:19 -07:00
Dianne Hackborn
895b3d0bdd am 49159f07: am 74bf59b4: Merge "Add new glue code for writing native apps." into gingerbread
Merge commit '49159f0748c704e53a7bd754f26113d9ab844a97'

* commit '49159f0748c704e53a7bd754f26113d9ab844a97':
  Add new glue code for writing native apps.
2010-07-08 19:10:17 -07:00
Kenny Root
8d3ee58899 am d481cdd4: am c9535de8: Merge "Add OBB file helper class" into gingerbread
Merge commit 'd481cdd4c0305f8afd857fe3ec3fbf189b744370'

* commit 'd481cdd4c0305f8afd857fe3ec3fbf189b744370':
  Add OBB file helper class
2010-07-08 19:08:57 -07:00
Jeff Brown
9aac262cb3 resolved conflicts for merge of 167449e5 to master
Change-Id: Ib448e69a726eb45b5c9099d2574e40b8345eee67
2010-07-08 19:01:13 -07:00
Dianne Hackborn
3c5d125ed7 Add new glue code for writing native apps.
This factors out the boiler-plate code from the sample
app to a common glue code that can be used for everyone
writing this style of app: a dedicated app thread that
takes care of waiting for events and processing them.

As part of doing this, ALooper has a new facility to allow
registration of fds that cause ALooper_pollOnce() to return
the fd that has data, allowing the app to drive the loop
without callbacks.  Hopefully this makes some people feel better. :)

Also do some other cleanup of the ALooper API, plus some
actual documentation.

Change-Id: Ic53bd56bdf627e3ba28a3c093faa06a92be522b8
2010-07-08 11:06:59 -07:00
Kenny Root
47ecb07ed4 Merge "Add OBB file helper class" into gingerbread 2010-07-07 18:14:13 -07:00
Chris Tate
9e1568cc2d Merge "More native input dispatch work." into gingerbread 2010-07-07 17:43:12 -07:00
Kenny Root
b94a9a668f Add OBB file helper class
ObbFile is a binary blob that will be used in packaging large files
with smaller APKs.

Change-Id: Ib1594346cfa2f49113de6565af77c24efbd89d63
2010-07-07 09:57:50 -07:00
Dianne Hackborn
747f65e77a am e24901d3: am 68267415: Add new native Looper API.
Merge commit 'e24901d3adb28fff72821d4e8e2ccc25b2184550'

* commit 'e24901d3adb28fff72821d4e8e2ccc25b2184550':
  Add new native Looper API.
2010-07-07 09:14:57 -07:00
Jeff Brown
f16c26dec9 More native input dispatch work.
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
2010-07-03 19:23:01 -07:00
Dianne Hackborn
efa1085066 Add new native Looper API.
This allows us to avoid exposing the file descriptor of
the event queue; instead, you attach an event queue to
a looper.  This will also should allow native apps to be
written without the need for a separate thread, by attaching
the event queue to the main thread's looper and scheduling
their own messages there.

Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
2010-07-02 18:57:02 -07:00
Dianne Hackborn
ed2b843c91 am 177c405a: am c6e1d880: Merge "Introduce official public NativeWindow type." into gingerbread
Merge commit '177c405a242e811b1010bd8382b5807ab8df31a8'

* commit '177c405a242e811b1010bd8382b5807ab8df31a8':
  Introduce official public NativeWindow type.
2010-06-30 16:11:21 -07:00
Dianne Hackborn
e12e3d7692 Merge "Introduce official public NativeWindow type." into gingerbread 2010-06-30 16:05:30 -07:00
Jeff Brown
ac18906a2e am 0c2df984: am d8ae2885: Merge "Fix injection of specially intercepted keys like HOME." into gingerbread
Merge commit '0c2df98425c8fa4ce092eebea80ae197547f6a86'

* commit '0c2df98425c8fa4ce092eebea80ae197547f6a86':
  Fix injection of specially intercepted keys like HOME.
2010-06-30 15:48:50 -07:00
Dianne Hackborn
b2007c4b89 resolved conflicts for merge of 7f6c6e8f to master
Change-Id: Id9dddb78c51f16ff8c4b60339421c94fde506db2
2010-06-30 15:44:58 -07:00
Dianne Hackborn
4b5e91e482 Introduce official public NativeWindow type.
Not yet hooked up to anything in the NDK, but requires renaming
the existing android_native_window_t type everywhere.

Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
2010-06-30 15:32:04 -07:00
Jeff Brown
c393eb6cf5 Fix injection of specially intercepted keys like HOME.
This change mainly unwinds a premature optimization in the
dispatch pipeline.
To test HOME injection, run 'adb shell input keyevent 3'.

Change-Id: I1c4b7377c205da7c898014b8b07fc6dc1d46e4dd
2010-06-30 14:41:59 -07:00
Dianne Hackborn
189ed23c10 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
Chris Tate
751ba60979 am af4a2d1f: am ddcb543a: Merge "Fix native input dispatch in the emulator." into gingerbread
Merge commit 'af4a2d1f52c7d54408db341781399d2886de72c1'

* commit 'af4a2d1f52c7d54408db341781399d2886de72c1':
  Fix native input dispatch in the emulator.
2010-06-29 17:06:31 -07:00
Jeff Brown
4036f7f2b4 Fix native input dispatch in the emulator.
Set a default orientation of ROTATION_0.
Added some more careful checks based on whether we have valid
absolute axis information from the driver.
Reset key repeating during configuration changes since the keyboard
device may have been removed.

Change-Id: I685960828acffcb17595fc5683309e8064a76714
2010-06-29 16:52:21 -07:00
Dianne Hackborn
3fc3eee094 am b5f05d00: am 0934fbb6: Merge "Update native activity & event APIs to follow correct conventions." into gingerbread
Merge commit 'b5f05d0018d72531e40c2afadfee90e9bc0c8893'

* commit 'b5f05d0018d72531e40c2afadfee90e9bc0c8893':
  Update native activity & event APIs to follow correct conventions.
2010-06-29 12:21:16 -07:00
Dianne Hackborn
9c7f8186ae Update native activity & event APIs to follow correct conventions.
Change-Id: Ie64fb3a9c68bc9c117fa5621b75d1f609e304e0e
2010-06-29 10:43:54 -07:00
Chris Tate
1f0c9ea984 am 96725326: am 31e0ffe8: Merge "Native input event dispatching." into gingerbread
Merge commit '96725326149687168937cf62f75364cf9cc3e96b'

* commit '96725326149687168937cf62f75364cf9cc3e96b':
  Native input event dispatching.
2010-06-28 19:16:42 -07:00
Jeff Brown
50de30a523 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
Jens Gulin
af997c4962 Keep track of remaining fd when devices are removed
Sometimes the wrong fd was accessed when the device was addressed
by device id.

The earlier implementation assumed that two arrays were in sync
but one of them was compacted when devices were removed. Instead
of that dependency the device now keeps track of it's file descriptor.

Change-Id: I2b8a793d76b89ab464ae830482b309fe86031671
2010-06-28 11:36:14 +02:00
Mathias Agopian
f27f8ed2a3 am 687f8a2e: am 1cb3fdc9: Merge "Fix a bug in sp<> and wp<> which could cause memory corruptions" into gingerbread
Merge commit '687f8a2eb78c95bb9974951dbe38124f8543bacb'

* commit '687f8a2eb78c95bb9974951dbe38124f8543bacb':
  Fix a bug in sp<> and wp<> which could cause memory corruptions
2010-06-25 14:22:51 -07:00
Mathias Agopian
8c3c51bb33 Fix a bug in sp<> and wp<> which could cause memory corruptions
when assigning a smart pointer to another one, we need to make
sure to read all the data we need from the right-hand-side
reference (the assignee) before we decRef the assigned.

This bug would cause linked-list of smart-pointers to fail
miserably.

Change-Id: Ibb554c15fddf909f7737c632b7c80322e80ea93f
2010-06-24 21:49:02 -07:00
Dianne Hackborn
c1c3308f03 am e3e2883f: am e24a60aa: Merge "First stab at attaching native event dispatching." into gingerbread
Merge commit 'e3e2883f2232007174ead562610eb01201890d9b'

* commit 'e3e2883f2232007174ead562610eb01201890d9b':
  First stab at attaching native event dispatching.
2010-06-23 10:32:25 -07:00
Brad Fitzpatrick
f9e01ea481 am efcf68aa: am ef8f96a7: Merge "Start of work on passing around StrictMode policy over Binder calls." into gingerbread
Merge commit 'efcf68aa1fd7fcfd52cf3d2837ed8db8e797194b'

* commit 'efcf68aa1fd7fcfd52cf3d2837ed8db8e797194b':
  Start of work on passing around StrictMode policy over Binder calls.
2010-06-23 10:18:18 -07:00
Jeff Brown
12c9ce8bc4 am b1efc3f6: am 7fbdc84e: More native input event dispatching.
Merge commit 'b1efc3f68277a8c38c21e2d2e8ce05287118ecfe'

* commit 'b1efc3f68277a8c38c21e2d2e8ce05287118ecfe':
  More native input event dispatching.
2010-06-23 10:17:22 -07:00
Dianne Hackborn
4d96bb6ae3 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
Brad Fitzpatrick
03bd2484c8 Merge "Start of work on passing around StrictMode policy over Binder calls." into gingerbread 2010-06-21 15:31:01 -07:00
Jeff Brown
51d45a710e More native input event dispatching.
Added ANRs handling.
Added event injection.
Fixed a NPE ActivityManagerServer writing ANRs to the drop box.
Fixed HOME key interception.
Fixed trackball reporting.
Fixed pointer rotation in landscape mode.

Change-Id: I50340f559f22899ab924e220a78119ffc79469b7
2010-06-21 13:59:34 -07:00
Brad Fitzpatrick
702ea9d42f Start of work on passing around StrictMode policy over Binder calls.
This is (intendend to be) a no-op change.

At this stage, Binder RPCs just have an additional uint32 passed around
in the header, right before the interface name.  But nothing is actually
done with them yet.  That value should right now always be 0.

This now boots and seems to work.

Change-Id: I135b7c84f07575e6b9717fef2424d301a450df7b
2010-06-21 12:56:35 -07:00
Jeff Brown
e780fc9d96 am 42bb545a: am 5c225b16: Even more native input dispatch work in progress.
Merge commit '42bb545a54d89f0ddbb230d7a01ea4210c0f6c00'

* commit '42bb545a54d89f0ddbb230d7a01ea4210c0f6c00':
  Even more native input dispatch work in progress.
2010-06-17 13:32:45 -07:00
Jeff Brown
f4a4ec2063 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
ac69c9607f am 2dfd2aa4: am 92266a78: Merge "More work in progress on native events." into gingerbread
Merge commit '2dfd2aa413a91965c1a247980598c795db9b4c38'

* commit '2dfd2aa413a91965c1a247980598c795db9b4c38':
  More work in progress on native events.
2010-06-15 16:50:12 -07:00
Jeff Brown
54bc281639 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
4215f50740 am 34b418cd: am 5e95930b: am 43a9527c: Fix include paths.
Merge commit '34b418cddbd2f05d5c0a98c550c65e457015134e'

* commit '34b418cddbd2f05d5c0a98c550c65e457015134e':
  Fix include paths.
2010-06-13 20:03:20 -07:00
Jeff Brown
66d9df50da Fix include paths.
Change-Id: Ifda45688f9f02710a74d5d7a7d902bacf1441e2e
2010-06-13 19:35:19 -07:00
Jeff Brown
04c1a8cdec resolved conflicts for merge of 9e660c82 to master
Change-Id: Ic4bd85cbaa5b9a10dcb474a0dad46490bf967e43
2010-06-13 19:16:55 -07:00
Jeff Brown
e839a589bf 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
Mathias Agopian
67c4219aa3 am 34e5d967: am 55f8209d: Merge "allow re-targetting of surfaces" into kraken 2010-06-08 20:18:05 -07:00
Mathias Agopian
579b3f88d0 allow re-targetting of surfaces
Surfaces can now be parcelized and sent to remote
processes. When a surface crosses a process
boundary, it looses its connection with the
current process and gets attached to the new one.

Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
2010-06-08 20:10:02 -07:00
Mathias Agopian
fcd61524e8 am f5f7d389: am fae5cb2b: optimize Surface.readFromParcel() 2010-06-04 19:17:16 -07:00
Mathias Agopian
e78d81eddd am fd89b1c8: am 7623da43: split surface management from surface\'s buffers management 2010-06-04 19:17:12 -07:00
Mathias Agopian
a0c30e9241 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
Mathias Agopian
b7e930db17 split surface management from surface's buffers management
Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
2010-06-04 18:57:41 -07:00
Vasu Nori
e733497af5 add API to Cursor to get column value type
Change-Id: I3ef1bcdb2eb1c45f68e829ccb6e3ecde28076591
2010-06-02 17:40:41 -07:00
Mathias Agopian
d13f23fca6 am 5220af87: am 770492cb: more clean-up in preparation of bigger changes 2010-06-01 16:08:48 -07:00
Mathias Agopian
daa717000f am 4f0a9114: am cdfd5fe2: Fix a typo in Singleton<> 2010-06-01 16:08:16 -07:00
Mathias Agopian
7e27f05739 more clean-up in preparation of bigger changes
the most important change here is the renaming of
ISurfaceFlingerClient to ISurfaceComposerClient

Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3
2010-05-28 17:19:16 -07:00
Mathias Agopian
b8510b98b5 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.
2010-05-28 15:13:30 -07:00
Mike Lockwood
3d11c77bae Merge "Move CursorWindow class from core/jni to libbinder" 2010-05-28 10:24:29 -07:00
Mike Lockwood
244a7655ae Move CursorWindow class from core/jni to libbinder
To allow use of the native CursorWindow class outside of the core framework jni

Change-Id: I72e8dcb91a2c691130c33cdfd9a25d343da1c592
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-28 10:08:21 -04:00
Mathias Agopian
d4784a3b90 more clean-up of Surfaceflinger's client management
SurfaceComposerClient now only exist on the WindowManager side,
the client side uses the new SurfaceClient class, which only
exposes what a client needs.

also instead of keeping mappings from IBinder to SurfaceComposerClients
we have a SurfaceClient per Surface (referring to the same IBinder), this
is made possible by the fact that SurfaceClient is very light.

Change-Id: I6a1f7015424f07871632a25ed6a502c55abfcfa6
2010-05-27 19:55:43 -07:00
Mathias Agopian
631f358d34 fix [2712278] The preview buffer left some black borders in left and bottom edges
we were incorrectly flagging push_buffer surfaces as invalid

Change-Id: I4dfd4ffbbe8a71f7e23e835db8d71966416c29bb
2010-05-25 17:51:34 -07:00
Mathias Agopian
a138f89c5e added the notion of fixed-size buffers
the new native_window_set_buffers_geometry allows
to specify a size and format for all buffers to be
dequeued. the buffer will be scalled to the window's
size.

Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
2010-05-24 18:26:01 -07:00
Mathias Agopian
a0b3f1d2eb fix a bug when reallocating a window's buffers is needed
we need to mark the buffers that need to be reallocated,
NOT the buffer's indices.

Change-Id: I809e2e1b03b56c4d2ab983c25523dae99aa1da74
2010-05-24 13:47:24 -07:00
Mathias Agopian
f10d7fde03 added native_window_set_buffer_count()
this method can be used to change the number of buffers
associated to a native window. the default is two.

Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
2010-05-21 14:34:32 -07:00
Mathias Agopian
bb641244d7 fix the threading issue for setBuffercount()
this change introduces R/W locks in the right places.
on the server-side, it guarantees that setBufferCount()
is synchronized with "retire" and "resize".
on the client-side, it guarantees that setBufferCount()
is synchronized with "dequeue", "lockbuffer" and "queue"
2010-05-20 18:00:42 -07:00
Mathias Agopian
dcf01e6644 added RWLock C++ wrapper
Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
2010-05-19 15:12:59 -07:00
Mathias Agopian
d6297f7d09 fix some bugs in SharedBufferStack::resize
added buffers should now be labeled properly.

Change-Id: I28aa753fbe89ab89134e7753575319478934c7fa
2010-05-17 17:27:26 -07:00
Mathias Agopian
a1ac870fd1 Merge "SharedBufferStack now can grow up to 16 buffers." into kraken 2010-05-12 17:36:46 -07:00
Mathias Agopian
b5b7f260da SharedBufferStack now can grow up to 16 buffers.
there is a new resize() api, which currently only allows growing.

Change-Id: Ia37b81b73be466d2491ffed7f3a23cd8e113c6fe
2010-05-12 17:28:20 -07:00
Kenny Root
9b7640933e Merge "ZipUtilsRO rewrite based on Dalvik Zip rewrite" into kraken 2010-05-12 14:54:42 -07:00
Kenny Root
d4066a4ac5 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
2010-05-12 05:07:48 -07:00
Jamie Gennis
1853b7d790 Merge "Add incStrong and decStrong methods to android_native_{window,buffer}_t." into kraken 2010-05-11 12:25:31 -07:00
Jamie Gennis
5e67f87430 Add incStrong and decStrong methods to android_native_{window,buffer}_t.
This change adds the methods necessary to use sp<> to handle refcounting
android_native_window_t and android_native_buffer_t.  The new methods forward
the refcounting operations to the corresponding android_native_base_t
functions.

Change-Id: I7de8e262728e439bc1efdf69374a2a9f6f432ced
2010-05-10 17:33:32 -07:00
Dan Egnor
7dd2bb8412 am ca48c88c: am 8a8658a5: Merge "Make static versions of libutils and libbinder." into froyo
Merge commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f' into kraken

* commit 'ca48c88c3d5733c4405a2fc4f7d9bb7fbba3d43f':
  Make static versions of libutils and libbinder.
2010-05-06 17:35:06 -07:00
Dan Egnor
e3c233d1a9 am 8a8658a5: Merge "Make static versions of libutils and libbinder." into froyo
Merge commit '8a8658a5de261c2da72d431940877bd054bc9837' into froyo-plus-aosp

* commit '8a8658a5de261c2da72d431940877bd054bc9837':
  Make static versions of libutils and libbinder.
2010-05-06 17:33:45 -07:00
Dan Egnor
386a332b4f 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
2010-05-06 01:03:31 -07:00
The Android Open Source Project
ad3f4a4561 am f7896449: merge from open-source master
Merge commit 'f78964490d8098387d51444c87bf520ad3f674e2' into kraken

* commit 'f78964490d8098387d51444c87bf520ad3f674e2':
  Add new keycodes for the convenience of Japanese IMEs
  Call register_localized_collators() with the current locale.
  Fixed deserialization problem in DatePicker.
  Fix for bug 2467152 files with spaces fail to open.
  Set alpha value for newly created dim surface.
  telephony: Fix CID when CID is unknown
2010-05-05 16:00:01 -07:00
The Android Open Source Project
30f71ce597 merge from open-source master
Change-Id: Ia9e1f4e049f5870386ea29ddb6e3ef028ea918da
2010-05-05 15:57:42 -07:00
mogimo
ef1c5c314b Add new keycodes for the convenience of Japanese IMEs
Change-Id: Ibd308cef11261147856258595f6ca0137e03e05c
2010-05-05 13:37:21 -07:00
Mathias Agopian
30c4c182ec Merge "Add support for enqueuing buffers in arbitrary order" into kraken 2010-04-30 12:58:11 -07:00
Mathias Agopian
4fcad80654 Merge "cleanup. waitForCondition() now uses polymorphsim instead of templtes" into kraken 2010-04-29 14:17:12 -07:00
Mathias Agopian
a228cc5efa Merge "fix a race condition in undoDequeue(), where 'tail' could be computed incorrectly." into kraken 2010-04-29 14:16:14 -07:00
Dianne Hackborn
c93a781c24 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
2010-04-28 16:51:52 -07:00
Mathias Agopian
c0a9164e9e Add support for enqueuing buffers in arbitrary order
Also added a very simple SharedBufferStack unit test.

Change-Id: I253dbbe98a53c966b78d22d4d6dd59f8aefc8c40
2010-04-28 16:12:54 -07:00
Mathias Agopian
b296533607 cleanup. waitForCondition() now uses polymorphsim instead of templtes
the reason for the above change is that waitForCondition() had become
large over time, mainly to handle error cases, using inlines to
evaluate the condition doesn't buys us much anymore while it increases
code size.

Change-Id: I2595d850832628954b900ab8bb1796c863447bc7
2010-04-28 16:12:54 -07:00
Mathias Agopian
0a8cd0689a fix a race condition in undoDequeue(), where 'tail' could be computed incorrectly.
in the undoDequeue() case, 'tail' was recalculated from 'available' and 'head'
however there was a race between this and retireAndLock(), which could cause
'tail' to be recalculated wrongly.

the interesting thing though is that retireAndLock() shouldn't have any impact
on the value of 'tail', which is client-side only attribute.
we fix the race by saving the value of 'tail' before dequeue() and restore it
in the case of undoDequeue(), since we know it doesn't depend on retireAndLock().

Change-Id: I4bcc4d16b6bc4dd93717ee739c603040b18295a0
2010-04-28 16:12:54 -07:00
Mathias Agopian
245e4d78c5 better fix for [2420565] Surface.lockCanvas() updates the dirty region too often
Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
2010-04-21 22:25:35 -07:00
The Android Open Source Project
a327dcfd79 am f021d12f: merge from open-source master
Merge commit 'f021d12f6f7116e9275cd3553a349ce5cb8aab14' into kraken

* commit 'f021d12f6f7116e9275cd3553a349ce5cb8aab14':
  Allow META* macros outside of the framework
  Fix printing order of phone objects creation
2010-04-21 09:15:15 -07:00
The Android Open Source Project
fc821e5d26 merge from open-source master
Change-Id: I08f1feae65b1dfc3f740d78654c267f2e3ae5e85
2010-04-21 09:10:43 -07:00
Michael Richardson
a3a884d9e2 Allow META* macros outside of the framework
The META* macros are useful outside of the framework
for other systems implementing Binder interfaces, but
they depend upon the android namespace. This includes
the appropriate namespace operations, which should be
sane even in that android namespace.

Change-Id: If600156c65191f51f487d0ee301d9f9f532b263d
2010-04-20 14:14:30 -07:00