Commit Graph

682 Commits

Author SHA1 Message Date
Dianne Hackborn
16fe3c2c1f Better compat mode part one: start scaling windows.
First step of improving app screen size compatibility mode.  When
running in compat mode, an application's windows are scaled up on
the screen rather than being small with 1:1 pixels.

Currently we scale the application to fill the entire screen, so
don't use an even pixel scaling.  Though this may have some
negative impact on the appearance (it looks okay to me), it has a
big benefit of allowing us to now treat these apps as normal
full-screens apps and do the normal transition animations as you
move in and out and around in them.

This introduces fun stuff in the input system to take care of
modifying pointer coordinates to account for the app window
surface scaling.  The input dispatcher is told about the scale
that is being applied to each window and, when there is one,
adjusts pointer events appropriately as they are being sent
to the transport.

Also modified is CompatibilityInfo, which has been greatly
simplified to not be so insane and incomprehendible.  It is
now simple -- when constructed it determines if the given app
is compatible with the current screen size and density, and
that is that.

There are new APIs on ActivityManagerService to put applications
that we would traditionally consider compatible with larger screens
in compatibility mode.  This is the start of a facility to have
a UI affordance for a user to switch apps in and out of
compatibility.

To test switching of modes, there is a new variation of the "am"
command to do this: am screen-compat [on|off] [package]

This mode switching has the fundamentals of restarting activities
when it is changed, though the state still needs to be persisted
and the overall mode switch cleaned up.

For the few small apps I have tested, things mostly seem to be
working well.  I know of one problem with the text selection
handles being drawn at the wrong position because at some point
the window offset is being scaled incorrectly.  There are
probably other similar issues around the interaction between
two windows because the different window coordinate spaces are
done in a hacky way instead of being formally integrated into
the window manager layout process.

Change-Id: Ie038e3746b448135117bd860859d74e360938557
2011-05-09 17:03:24 -07:00
Mathias Agopian
d0b55c011a fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
a memory corruption happned when the buffer pool was resized
(like when playing a video or using camera) and there was
no current active buffer. In this case, the faulty code
would index into an array at position -1 which corrupted
24 bytes of data.

also improved region validation code (ifdef'ed out by default)

Bug: 4093196
Change-Id: I915c581d131148959d720e00e3892e9186ab733d
2011-03-17 00:04:42 -07:00
Romain Guy
a08152f43c Modify the GL renderer's functor to pass the clip to WebView
Change-Id: If5efe399ca58f3000b2883e24e9f3736a2025184
2011-03-16 15:31:33 -07:00
Glenn Kasten
ad4c66d8bb Merge "Bug 4016329 do full string comparisons" into honeycomb-mr1 2011-03-15 13:44:58 -07:00
Glenn Kasten
bb959f5b10 Bug 4016329 do full string comparisons
Use full string comparisons instead of partial for
  file extension and MIME type.
Do case-insensitive comparison of MIME type and file extensions.
Fix error in comment for String8::getPathExtension.
Remove dead code -- StringTokenizer is unused.

Change-Id: I322be6235abbdaab5f7eafa48926dbb2cf46dc29
2011-03-14 17:59:51 -07:00
Jamie Gennis
bae774eb20 SurfaceTextureClient: Add ISurfaceTexture getter.
This change adds a getter method to SurfaceTextureClient to get the
ISurfaceTexture object with which the SurfaceTextureClient is
communicating.

Bug: 4086509
Change-Id: Ifec621e0fe5392a5be56b2348fdc54067cbebcdd
2011-03-14 17:47:11 -07:00
Jamie Gennis
391bbe2246 ANativeWindow: add query for the concrete type.
This change adds a query to the ANativeWindow interface for getting the
concrete type of the ANativeWindow.

Bug: 4086509
Change-Id: I64aa86d72fbca3b52a98e1fc35608737781a3178
2011-03-14 17:47:11 -07:00
Jeff Brown
46689da7ee Input improvements and bug fixes.
Associate each motion axis with the source from which it comes.
It is possible for multiple sources of the same device to define
the same axis.  This fixes new API that was introduced in MR1.
(Bug: 4066146)

Fixed a bug that might cause a segfault when using a trackball.

Only fade out the mouse pointer when touching the touch screen,
ignore other touch pads.

Changed the plural "sources" to "source" in several places in
the InputReader where we intend to refer to a particular source
rather than to a combination of sources.

Improved the batching code to support batching events from different
sources of the same device in parallel.  (Bug: 3391564)

Change-Id: I0189e18e464338f126f7bf94370b928e1b1695f2
2011-03-09 18:30:28 -08:00
Jamie Gennis
ec8a5ef78d Merge "ANativeWindow: add queues-to-window-composer check." into honeycomb-mr1 2011-03-09 14:47:56 -08:00
Jamie Gennis
134f042286 ANativeWindow: add queues-to-window-composer check.
This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
2011-03-08 16:49:51 -08:00
Romain Guy
8a2a2f4689 Merge "Add support for partial invalidates in WebView Bug #3461349" into honeycomb-mr1 2011-03-07 22:40:27 -08:00
Romain Guy
9fb2277f39 Add support for partial invalidates in WebView
Bug #3461349

This change also fixes two bugs that prevented partial invalidates
from working with other views. Both bugs were in our EGL implementation:
they were preventing the caller from comparing the current context/surface
with another context/surface. This was causing HardwareRenderer to always
redraw the entire screen.

Change-Id: I33e096b304d4a0b7e6c8f92930f71d2ece9bebf5
2011-03-07 18:09:03 -08:00
Jeff Brown
e89d1041dd Joystick tweaks. (DO NOT MERGE)
Ensure that the joystick can always reach -1.0, 0.0 and 1.0 positions
even when noise filtering is applied.  (Bug: 3514510)

Add support for a few more standard axes.

Add additional mapping modes for axes.
Some axes are inverted from standard interpretation
or are actually intended to be split into two distict axes
such as left/right trigger controls or accelerator/brake.

Add key layout file for a G25 racing wheel and XBox 360 controller
to tweak behavior.  They work fine without them but the axis mappings
are not ideal.

Change-Id: I0fddd90309af4dc14d35f34fe99ed6e521c0b7c7
2011-03-04 19:12:41 -08:00
Jeff Brown
d5ed285606 Wake screen from external HID peripherals.
Added some plumbing to enable the policy to intercept motion
events when the screen is off to handle wakeup if needed.

Added a basic concept of an external device to limit the scope
of the wakeup policy to external devices only.  The wakeup policy
for internal devices should be based on explicit rules such as
policy flags in key layout files.

Moved isTouchEvent to native.

Ensure the dispatcher sends the right event type to userActivity
for non-touch pointer events like HOVER_MOVE and SCROLL.

Bug: 3193114
Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
2011-03-02 19:57:07 -08:00
Jeff Brown
80f3e7cc15 Fade out the mouse pointer after inactivity or other events.
Fades out the mouse pointer:
- after 15 seconds of inactivity normally
- after 3 seconds of inactivity in lights out mode
- after a non-modifier key down
- after a touch down

Extended the native Looper to support enqueuing time delayed
messages.  This is used by the PointerController to control
pointer fade timing.

Change-Id: I87792fea7dbe2d9376c78cf354fe3189a484d9da
2011-03-02 15:37:57 -08:00
Mathias Agopian
17290c5583 Merge "Add support for up to 32 buffers per Surface" 2011-03-01 20:08:07 -08:00
Jamie Gennis
ea72db3737 Merge "Add the MIN_UNDEQUEUED_BUFFERS query to ANW." 2011-03-01 14:38:20 -08:00
Mathias Agopian
acd116daea Add support for up to 32 buffers per Surface
Bug: 3488016

Change-Id: Ie5536ad77d42a4d0e8270e0fd87ecb73471bcbbc
2011-03-01 14:09:06 -08:00
Christopher Tate
b1586e69a1 Merge "Binder linkage no longer depends on JNI objrefs as persistent tokens" 2011-02-28 12:50:09 -08:00
Jamie Gennis
9d4d6c101d Add the MIN_UNDEQUEUED_BUFFERS query to ANW.
This change adds a new query to ANativeWindow for getting the minimum
number of buffers that must be left un-dequeued during the steady-state
operation of the ANativeWindow.

Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551
Related-Bug: 3356050
2011-02-28 12:24:40 -08:00
Christopher Tate
71f64dd876 Binder linkage no longer depends on JNI objrefs as persistent tokens
There are two areas that have changed to eliminate the assumption that
local jobject references are both canonical and persistent:

1. JavaBBinderHolder no longer holds onto and reuses it parent object
reference per se.  Since the underlying JavaBBinder object holds a
real global ref, this was redundant anyway.  Now, for purposes of its
transient need to perform JNI operations, it simply uses the current
jobject ref(s) passed during method invocation, and no longer attempts
to hold these refs beyond the scope of a single invocation.

2. Binder obituaries no longer assume that a jobject reference to a
recipient will always compare == as a 32-bit value with any future
reference to the same object.  The implementation now asks Dalvik
whether object references match.

This amended patch fixes the earlier bug around races between
remote binder death cleanup and local explicit unregistration of
VM-side death recipients.

Bug 2090115

Change-Id: I70bd788a80ea953632b1f466f385ab6b78ef2913
2011-02-28 11:37:20 -08:00
Mathias Agopian
32bebb0a58 Fix sp<> conversion operator / constructor
some of the conversion operators were not using the proper
pointer type when calling incStrong/decStrong, usually it
has no bad consequences, but for some implementation
of the ref-counted object it could lead to recording the wrong
owner id.

Change-Id: If574b9069b8a4cf6e0911a992c8f095aba799995
2011-02-25 16:20:52 -08:00
Christopher Tate
9f5b53d4b0 Revert "Binder linkage no longer depends on JNI objrefs as persistent tokens"
This reverts commit c2d55dd89743c8a38deb809f3cdf1ad2d1dbac2b.
2011-02-25 15:18:53 -08:00
Mathias Agopian
d4e5832b69 Merge "Fix a wp<> bug where the owner ID would be wrong" 2011-02-24 18:27:40 -08:00
Mathias Agopian
d005004f14 Fix a wp<> bug where the owner ID would be wrong
this was introduced recently. we make sure to use
the correct owner id (the sp) instead of the wp.

Change-Id: I78fdc6ec0c2d3e687278b70442d74d1924b512a2
2011-02-24 18:12:34 -08:00
Mathias Agopian
da26c6662d Merge "Fix some issues with RefBase debugging." 2011-02-24 16:23:51 -08:00
Christopher Tate
5a5ca785e2 Merge "Binder linkage no longer depends on JNI objrefs as persistent tokens" 2011-02-24 13:22:19 -08:00
Christopher Tate
c811e7a775 Binder linkage no longer depends on JNI objrefs as persistent tokens
There are two areas that have changed to eliminate the assumption that
local jobject references are both canonical and persistent:

1. JavaBBinderHolder no longer holds onto and reuses it parent object
reference per se.  Since the underlying JavaBBinder object holds a
real global ref, this was redundant anyway.  Now, for purposes of its
transient need to perform JNI operations, it simply uses the current
jobject ref(s) passed during method invocation, and no longer attempts
to hold these refs beyond the scope of a single invocation.

2. Binder obituaries no longer assume that a jobject reference to a
recipient will always compare == as a 32-bit value with any future
reference to the same object.  The implementation now asks Dalvik
whether object references match.

Bug 2090115

Change-Id: If62edd554d0a9fbb2d2977b0cbf8ad7cc8e2e68d
2011-02-24 13:15:09 -08:00
Glenn Kasten
3477a8cff2 Merge "Bug 3362814 Fix SMP race in access to mRequestExit" 2011-02-24 10:01:31 -08:00
Mathias Agopian
f14a1046e7 Fix some issues with RefBase debugging.
First slipt sp<> out of RefBase into StrongPointer.h so it can be reused
more easily and to make it clear that it doesn't require RefBase.

Note: the rest of the change only affects the system when DEBUG_REFS is enabled.

The main problem we fix here is that the owner id associated with each
reference could get out of date when a sp<> or wp<> was moved, for
instance when they're used in a Vector< >.

We fix this issue by calling into RefBase::moveReferences from
a template specialization for sp<TYPE> and wp<TYPE> of the
type helpers. RefBase::moveReferences() has then a chance to
update the owner ids.

There is a little bit of trickery to implement this generically in
RefBase, where we need to use a templatized functor that can turn
a sp<TYPE>* casted to a void* into a RefBase*.

Introduced a new debug option DEBUG_REFS_FATAL_SANITY_CHECKS
currently set to 0 by default as there seem to be an issue
with sp<ANativeWindow> which trips the sanity checks.

Change-Id: I4825b21c8ec47d4a0ef35d760760ae0c9cdfbd7f
2011-02-23 22:21:41 -08:00
Glenn Kasten
7e453a51a5 Bug 3362814 Fix SMP race in access to mRequestExit
Also fix an unlikely SMP race in access to mHoldSelf on entry to _threadLoop.

Change-Id: I6cbc0b94739c7dd5e77e8a5ba0da22cdc0b1a4db
2011-02-23 17:49:59 -08:00
Mathias Agopian
a08ef4932f Remove RefBase.h dependency on TextOutput.h
Change-Id: I72cd6b98ef82b4868fe1c8ec87862cf43fb4ee73
2011-02-22 18:08:58 -08:00
Jeff Brown
3ea4de826d Add new axes for joysticks and mouse wheels.
Added API on InputDevice to query the set of axes available.
Added API on KeyEvent and MotionEvent to convert keycodes and axes
to symbolic name strings for diagnostic purposes.
Added API on KeyEvent to query if a given key code is a gamepad button.
Added a new "axis" element to key layout files to specify the
mapping between raw absolute axis values and motion axis ids.
Expanded the axis bitfield to 64bits to allow for future growth.
Modified the Makefile for keyboard prebuilts to run the keymap
validation tool during the build.
Added layouts for two game controllers.
Added default actions for game pad button keys.
Added more tests.
Fixed a bunch of bugs.

Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
2011-02-19 05:23:10 -08:00
Jeff Brown
b2d4435dfa Fix a regression with MotionEvent parceling.
Also added some more unit tests.

Change-Id: I413654294d1a998eec056884e6df5eaa50f3daf4
2011-02-17 13:01:34 -08:00
Jeff Brown
3e3414636c Add support for arbitrary axes in MotionEvents.
This change makes it possible to extend the set of axes that
are reported in MotionEvents by defining new axis constants.

The MotionEvent object is now backed by its C++ counterpart
to avoid having to maintain multiple representations of the
same data.

Change-Id: Ibe93c90d4b390d43c176cce48d558d20869ee608
2011-02-15 19:14:37 -08:00
Mathias Agopian
51625d69a0 am c6c3e77d: am b66b7a2c: Merge "fix [3408713] Dialog window invisible sometimes" into honeycomb
* commit 'c6c3e77d4d5cd8de3b1a56bdffdfd42774849512':
  fix [3408713] Dialog window invisible sometimes
2011-02-10 15:46:15 -08:00
Mathias Agopian
a878ce287d am b66b7a2c: Merge "fix [3408713] Dialog window invisible sometimes" into honeycomb
* commit 'b66b7a2c183a1423ea629d4f73ed95f9b87d54b7':
  fix [3408713] Dialog window invisible sometimes
2011-02-10 15:08:33 -08:00
Mathias Agopian
7802bbd20f fix [3408713] Dialog window invisible sometimes
weak pointer comparison operators were implemented wrong,
they were using the internal "unsafe" pointer. We could end up
with two "equal" weak pointer pointing to different objects.

this caused KeyedVector keyed by weak pointer to work incorrectly, in
turn causing a window that just got added to a list to be immediately
removed.

Change-Id: Ib191010c39aafa9229109e4211f6c3b2b2f9696d
2011-02-09 18:38:55 -08:00
Jamie Gennis
08b4ea31a8 am 421d94c2: am ecb4b3f0: Merge "Pass the IGraphicBufferAlloc to SurfaceTextureClient." into honeycomb
* commit '421d94c20321e1de528416b279bf148baba47b39':
  Pass the IGraphicBufferAlloc to SurfaceTextureClient.
2011-02-02 16:21:24 -08:00
Jamie Gennis
d7a3ebe031 am ecb4b3f0: Merge "Pass the IGraphicBufferAlloc to SurfaceTextureClient." into honeycomb
* commit 'ecb4b3f02340e21eefabbea78559e85ec7ee0089':
  Pass the IGraphicBufferAlloc to SurfaceTextureClient.
2011-02-02 15:56:20 -08:00
Jamie Gennis
1b20cde313 Pass the IGraphicBufferAlloc to SurfaceTextureClient.
This change passes a reference to the IGraphicBufferAlloc binder object
to SurfaceTextureClient objects.  When STC objects are created they
query their associated ISurfaceTexture object for the
IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers.
Having the SurfaceTextureClient hold this reference prevents the
GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers
before the SurfaceTextureClient is done with them.

Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c
related-bug: 3362519
2011-02-02 15:31:47 -08:00
Jamie Gennis
79676ac8e6 am 09443aeb: am 62884505: Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb
* commit '09443aeb6470d66f5bc1938b70d74b3e2f9bbbb9':
  Reset ANativeWindow crop on buffer geometry changes.
2011-01-30 15:05:42 -08:00
Jamie Gennis
c043fa28b9 am 62884505: Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb
* commit '628845056282a0c5b1a212ce5aeeaac092b91ec8':
  Reset ANativeWindow crop on buffer geometry changes.
2011-01-30 15:03:03 -08:00
Dianne Hackborn
36373fcf15 am 371de969: am a1f5e82f: am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit '371de9695508073fbbde8181eb230e99cb045206':
  Normalize output from aapt d
2011-01-29 23:10:33 -08:00
Dianne Hackborn
402960177f am a1f5e82f: am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit 'a1f5e82f37c77af7b1d630b5bca715d1742f1234':
  Normalize output from aapt d
2011-01-29 23:07:48 -08:00
Dianne Hackborn
a8eea2f3d9 am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit 'a30063d80c08434ac3c7316f338c6d54110449ab':
  Normalize output from aapt d
2011-01-29 23:04:50 -08:00
Dianne Hackborn
73431999ab Merge "Normalize output from aapt d" 2011-01-29 22:53:20 -08:00
Jamie Gennis
68f9127e88 Reset ANativeWindow crop on buffer geometry changes.
This changes the ANativeWindow API and the two implementations to reset
the window's crop rectangle to be uncropped when the window's buffer
geometry is changed.

Bug: 3359604
Change-Id: I64283dc8382ae687787ec0bebe6a5d5b4a0dcd6b
2011-01-28 18:21:54 -08:00
Glenn Kasten
16f0453fee Protected surface API
To be used by DRM framework, implemented by display HAL

Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
2011-01-28 08:04:00 -08:00
Jeff Brown
ae1d9d7412 am 12b2dc90: am b1e0a870: Merge "Fix crashes caused by some input devices." into honeycomb
* commit '12b2dc90883ef4f930a17907acdef3677b0598a5':
  Fix crashes caused by some input devices.
2011-01-25 18:22:50 -08:00