Commit Graph

1654 Commits

Author SHA1 Message Date
Pannag Sanketi
292a31a4c2 Minor fix in SurfaceTexture
Change-Id: Ic859715becf3e6d5107bd8beb8c577034d00ec52
2011-06-30 15:41:19 -07:00
Mathias Agopian
e6786c92d7 Merge "SF transactions are now O(1) wrt IPC instead of O(N)." 2011-06-29 16:15:56 -07:00
Mathias Agopian
698c0873cf SF transactions are now O(1) wrt IPC instead of O(N).
Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
2011-06-29 15:05:41 -07:00
Jason Simmons
acfc4829e4 Merge "Add a linear transform library to libutils" 2011-06-29 13:48:39 -07:00
Jeff Brown
771e5828e8 Merge "Improve input event consistency invariants." 2011-06-28 20:17:59 -07:00
Jeff Brown
7832080b5a Improve input event consistency invariants.
Fixed some issues where inconsistent streams of events could
be generated by the dispatcher, particularly when switching from
hovering with one device to hovering with another.

Fixed a bug where the touch pad would fail to generate a new
HOVER_MOVE following a tap event.  As a result, the hover event
stream would not resume until the user touched the touch pad
again.

Change-Id: I444dce84641fb12e56a0af84c931520771d6c493
2011-06-28 20:10:40 -07:00
Jason Simmons
c18d4da5e4 Add a linear transform library to libutils
Change-Id: Icdec5a6bebd9d8f24b3f335f8ec8b09a5810a774
2011-06-28 17:43:30 -07:00
Jamie Gennis
dfcff4b4ef SurfaceTexture: add a CPU -> GL sync test.
This change adds a test to verify that proper synchronization is done
when using SurfaceTexture to use CPU generated images as OpenGL ES
textures in 'synchronous mode'.  Synchronous mode is particularly tricky
because SurfaceTexture will allow the buffer that's currently bound to
the GL texture to be dequeued.  We rely on Gralloc's lock function to
block until this buffer is no longer being used by the OpenGL ES.

Change-Id: I1c4e37f3e9d60ab9a0905a90a1f5060fda8e485c
2011-06-28 13:18:07 -07:00
Jamie Gennis
67b4cff399 Merge changes I9fb59763,I8b2c6e00
* changes:
  SurfaceTexture: consume buffers after err checks
  SurfaceTexture: change onFrameAvailable behavior
2011-06-28 12:55:03 -07:00
Andy McFadden
bae6579eb2 Remove native EventRecurrence parser
Switch over to the new parser.

Bug 4575374

Change-Id: If78d8042fb266182900398f7fc464a048c779966
2011-06-28 07:43:27 -07:00
Mathias Agopian
99b49840d3 PermissionCache caches permission checks
This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
2011-06-27 17:42:15 -07:00
Jamie Gennis
50c4efc2a4 SurfaceTexture: consume buffers after err checks
This change moves the point at which queued buffers get consumed to
after any error checks that could cause updateTexImage to fail.  This
way, if updateTexImage returns an error the buffer remains queued.
2011-06-27 15:45:40 -07:00
Jamie Gennis
3d8063b02e SurfaceTexture: change onFrameAvailable behavior
This change alters the conditions under which the onFrameAvailable
callback gets called by the C++ SurfaceTexture class.  The new behavior
is to call the callback whenever a frame gets queued that will be
visible to the buffer consumer.  This means that buffers queued in
synchronous mode always trigger the callback, as those buffers will
remain pending until they are consumed.  Buffers queued in asynchronous
mode will only trigger the callback if there was not previously an
unconsumed buffer pending.

The new behavior means that a consumer should perform a draw operation
exactly once for every onFrameAvailable call that it recieves.  This
change also modifies SurfaceFlinger and the SurfaceTexture JNI to
support of the new behavior.

Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
2011-06-27 15:45:39 -07:00
Anu Sundararajan
5728a92e29 MemoryHeapBase: Save and binderize the offset
The offset that is used in the creation of the MemoryHeapBase must be saved, so
that it can be used to recreate the Heap when an IMemory object is passed
across process boundary through the binder.

Change-Id: Ie618fb5c0718e6711f55ed9235616fd801e648dc
Signed-off-by: Anu Sundararajan <sanuradha@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-06-27 13:48:51 -07:00
Christopher Tate
8408da0556 Merge "Fix settings restore" 2011-06-24 15:15:51 -07:00
Christopher Tate
cd604a1a6e Fix settings restore
Also correct the debug-mode logging of error locations in backup data.
Bug 4914182

Change-Id: Ie7dda0192afa819e42490b7ffd2d3db6f11968f6
2011-06-24 15:06:48 -07:00
Grace Kloba
14a0e58074 Add allowSynchronousMode to SurfaceTexture constructor.
Change-Id: I54f30a3c16bbe6b813f3bcd1d389da5627531304
2011-06-23 21:21:47 -07:00
Glenn Kasten
58e012d1e3 Add Thread::join
This new API will be used by applications that previously used the
lower-level pthread APIs (including pthread_join).  Centralizing on the
Thread class instead of pthread will permit additional functionality to
be added later in only one location.

Change-Id: I8460169ac9c61ac9f85752405ed54c94651058d7
2011-06-23 12:55:29 -07:00
Glenn Kasten
ce63396eff Thread ID zero for androidSetThreadSchedulingGroup
Already implemented by androidSetThreadPriority but not documented

Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
2011-06-22 17:45:30 -07:00
tedbo
1e7fa9e945 Add method to create a ParcelSurfaceTexture from android.view.Surface.
Change-Id: I05e343ab7e327478f60322af9373574b70c148f5
2011-06-22 16:18:09 -07:00
Jamie Gennis
c8c5152b19 SurfaceTexture: make tests use a large framebuffer.
This change makes the SurfaceTexture GL tests use a large (512x512)
framebuffer.  The tests now use glViewport to render to a region of the
framebuffer with a size matching that of the texture being drawn.  The
Npot test pixel checks must be changed because now the rendered region
is the same size as the texture.

Change-Id: Icc41803189c25e33ba1da7d2470720f0a11f3e4b
2011-06-20 15:42:57 -07:00
Jamie Gennis
b36bb97ae3 Merge "SurfaceTexture: fix a NULL ptr dereference." 2011-06-20 15:34:00 -07:00
Jamie Gennis
1c4414091c SurfaceTexture: fix a NULL ptr dereference.
This change adds a NULL check when searching the slot list in
SurfaceTextureClient for the slot corresponding to a buffer being
queued or canceled.

Bug: 4645023
Change-Id: I806cbc1e34da118ea33a83c4f25ce8193ba1c3ad
2011-06-20 14:16:49 -07:00
Jean-Baptiste Queru
75e3e4936b am e3b05d09: Merge "Tweaks for forward-compatibility"
* commit 'e3b05d09163257b888c86f2a560e10c48f4cf029':
  Tweaks for forward-compatibility
2011-06-20 09:05:07 -07:00
Jean-Baptiste Queru
3f3f5af40e Tweaks for forward-compatibility
Change-Id: Iec525edc186e78d5d865f82dd5b1f56263c22e86
2011-06-18 09:42:04 -07:00
Jamie Gennis
28bca1a772 Merge "SurfaceTexture: enable a test that now passes." 2011-06-17 10:45:15 -07:00
Jamie Gennis
4661a50121 Merge "SurfaceTexture: enable a test that is now passing." 2011-06-17 10:45:01 -07:00
Mathias Agopian
e397ce2880 am 0887b8c2: am 8e18668d: revert surfaceflinger leak fix as it uncovered a crasher on xoom (DO NOT MERGE)
* commit '0887b8c2e583e682cd2c1bc909cb3fdbec704004':
  revert surfaceflinger leak fix as it uncovered a crasher on xoom (DO NOT MERGE)
2011-06-15 22:42:52 -07:00
Mathias Agopian
dbe60ddd85 am d5244e0a: am 52a43990: Revert "revert surfaceflinger leak fix as it uncovered a crasher on xoom"
* commit 'd5244e0a88ed2f843651aa5ffdc71a45c968e0f3':
  Revert "revert surfaceflinger leak fix as it uncovered a crasher on xoom"
2011-06-15 22:12:32 -07:00
Kenny Root
111280a8de Use rand() for MinGW
The version of MinGW we use doesn't have nrand48() which is really lame,
but we need to use libutils in the Windows SDK.

Change-Id: If854c03dbf02bc29e79f49e4539f08c2bf057517
2011-06-15 20:55:49 -07:00
Mathias Agopian
1b2c2a9ea0 revert surfaceflinger leak fix as it uncovered a crasher on xoom (DO NOT MERGE)
This reverts commit 52a43990880b27808bcf562afcc4209d34728e6e.

Change-Id: I1856a48f863b051395b8091ddfd1e01292fa1b1e
2011-06-15 20:45:32 -07:00
Mathias Agopian
63ad28fb53 Revert "revert surfaceflinger leak fix as it uncovered a crasher on xoom"
This reverts commit af6edba59e250adbdfa5b3c3be134f70d8c38a16.

Change-Id: I7793d3ca8a4d20a2b188364f47854328ab5f586d
2011-06-15 20:42:25 -07:00
Mathias Agopian
e776586a08 am 7ecdeb6e: am d20d72d1: Merge "revert surfaceflinger leak fix as it uncovered a crasher on xoom" into honeycomb-mr2
* commit '7ecdeb6e548ff71d4f70b343e30136e89eaa3e33':
  revert surfaceflinger leak fix as it uncovered a crasher on xoom
2011-06-15 20:21:31 -07:00
Mathias Agopian
3790e7997a revert surfaceflinger leak fix as it uncovered a crasher on xoom
Bug: 4600244
Change-Id: Ia68ebf0f243a051ff6a21b3863e3e5d259bbf7ac
2011-06-15 19:31:04 -07:00
Mathias Agopian
35cc0fcd51 am afffa8fa: fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
* commit 'afffa8fa9f82a7343e1158bf921931fd3e3df615':
  fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
2011-06-15 14:13:04 -07:00
Jamie Gennis
07ed1a94bc SurfaceTexture: enable a test that now passes.
This change enables the QueryFormatAfterSettingWorks.

Change-Id: Ic868011a36a6c86c8646880246cd5b6960a13364
2011-06-15 12:44:01 -07:00
Jamie Gennis
d05bb2ed4c SurfaceTexture: enable a test that is now passing.
This change enables the TexturingFromCpuFilledYV12BufferPow2 test.

Change-Id: Ib356ee3d2f8979f34f849fd4090f598295e2e92e
2011-06-15 12:44:01 -07:00
Glenn Kasten
982a69f827 Merge "Bug 4608375" 2011-06-14 17:54:25 -07:00
Jamie Gennis
5dd0c4fd7e SurfaceTexture: increase the test's Surface layer.
This change increases the Surface layer used for displaying the test
results so that the tests will be visible over other windows in the
system.

Change-Id: I47f147f8743ff2a39d57d551811668371202bd31
2011-06-14 13:45:53 -07:00
Jamie Gennis
1876d13e45 SurfaceTexture: add some RGBA_8888 tests.
Change-Id: Id09915c98a00eca1209b7dab32039a06d260908e
2011-06-14 13:45:53 -07:00
Jamie Gennis
8b69defa2f SurfaceTextureClient: minor test refactoring.
Change-Id: Iabc6d27ca35d30d896c6aef65c4f1b5a1eed47b8
2011-06-14 13:45:52 -07:00
Jamie Gennis
135abde4c2 Merge "SurfaceTexture: add a format querying test." 2011-06-14 13:39:05 -07:00
Glenn Kasten
f0c412513f Bug 4608375
Update priority and policy together for audio threads

Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
2011-06-14 10:41:50 -07:00
Mathias Agopian
ddc31c3e2b fix RefBase so it retains binary-compatibility with gingerbread
Bug: 4595257
Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
2011-06-13 18:39:45 -07:00
Mathias Agopian
80728d87c9 Merge changes I9b8e1962,I7bb843ca
* changes:
  Temporarily don't return the current buffer in synchronous mode
  unify SurfaceTexture and Surface
2011-06-13 17:20:53 -07:00
Mathias Agopian
e122079be6 Temporarily don't return the current buffer in synchronous mode
activate synchronous mode by default.
2011-06-13 15:51:35 -07:00
Mathias Agopian
a67932fe68 unify SurfaceTexture and Surface
Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
2011-06-13 15:51:35 -07:00
Jamie Gennis
a6f35dd36e SurfaceTexture: add a format querying test.
This change adds a test to verify that querying the format of a
SurfaceTextureClient immediately after setting it returns the correct
result.  The test is currently disabled because it does not pass.

Change-Id: I5bddb39c5bf96d6104624094383d410ed913e9f3
2011-06-13 15:01:05 -07:00
Jamie Gennis
9fbf761e44 Merge changes Ic9186db2,Id5a7cdff
* changes:
  SurfaceTexture: disable a deadlocking test.
  SurfaceTexture: add a pixel tolerance to the tests.
2011-06-13 14:48:11 -07:00
Mathias Agopian
7794b30589 am 77079399: am a9c9a4ba: fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
* commit '77079399fca3e9c71e2ac06f3da26934e1c278b9':
  fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
2011-06-13 14:15:00 -07:00
Mathias Agopian
76feee7a58 fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Bug: 4595257
Change-Id: I4773cf4fe59b2509db0ed733739eb6961d473b25
2011-06-13 13:58:34 -07:00
Mathias Agopian
867740df05 fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Bug: 4595257
Change-Id: I1db83149107d7dab1f0b7e73c684e0ff82e17e62
2011-06-13 13:44:28 -07:00
Jamie Gennis
2510d9576f SurfaceTexture: disable a deadlocking test.
This change disables the UpdateTexImageAfterFrameFinishedWorks test
because it's currently causing deadlocks on some devices.

Change-Id: Ic9186db207e8d656f3af5d86fa138c7d96393c55
2011-06-13 13:43:51 -07:00
Jamie Gennis
824efa74e7 SurfaceTexture: add a pixel tolerance to the tests.
This change adds a default tolerance of 2 to all the pixel value checks
in the SurfaceTexture tests.

Change-Id: Id5a7cdffdfae16076e2daf4964a3326105b5ae2c
2011-06-13 13:41:01 -07:00
Jamie Gennis
ac642349ba Merge "libutils: add a binary blob cache implementation." 2011-06-13 12:32:46 -07:00
Jamie Gennis
72f6af8630 Merge changes I56779420,I044e44e1,Ic5adfa29,Ied541ab8
* changes:
  SurfaceTexture: add some GL->GL tests.
  SurfaceTexture: fix up a comment.
  SurfaceTexture: add getTransformMatrix tests.
  SurfaceTexture: fix a getTransformMatrix crash.
2011-06-13 11:14:57 -07:00
Jamie Gennis
5451d15ee2 SurfaceTexture: add some GL->GL tests.
This change adds some tests to verify streaming images from one GL
thread to another via SurfaceTexture.  Currently the tests do not
validate the correctness of the streamed images, but rather simply
verify that this streaming does not cause a deadlock.  3 of the 4 tests
are currently disabled because they do cause deadlocks on some devices.

Change-Id: I5677942053190063b97f370dba96c116711bc3bb
2011-06-13 10:50:13 -07:00
Jamie Gennis
5222604809 SurfaceTexture: add getTransformMatrix tests.
This change adds a test verifying that with no transform set on the
SurfaceTextureClient, the SurfaceTexture will return an identity
transform matrix.  It also verifies this same effect in the presence of
an additional call to native_window_set_buffer_count just before the
call to getTransformMatrix.

Bug: 4490420
Change-Id: Ic5adfa29b5696cc2b451433834e3758ef20c5edd
2011-06-13 10:50:13 -07:00
Jamie Gennis
736aa9573b SurfaceTexture: fix a getTransformMatrix crash.
This change moves the computation of the transform matrix out of
getTransformMatrix and instead performs the computation when
updateTexImage gets called.  This is needed in order for
getTransformMatrix to succeed even if the buffers have been freed (e.g.
by changing the buffer count) because the computation depends upon the
properties of the current GraphicBuffer.

Change-Id: Ied541ab8747b7ad604f862717135f9a16a816be9
Bug: 4490420
2011-06-13 10:50:12 -07:00
Glenn Kasten
c4a0feaaf4 Merge "Remove redundant memory barrier" 2011-06-13 10:30:29 -07:00
Glenn Kasten
d9e1bb76fe Remove redundant memory barrier
pthread_create already includes the necessary memory barriers:
 - parent at pthread_create : pthread_mutex_unlock(start_mutex)
 - child at __thread_entry : pthread_mutex_lock(start_mutex)

Add lock around uses of mThread.

Added comments:
 - uses of mThread require lock
 - androidCreateRawThreadEtc returned ID is not safe for direct use from non-parent threads.

Change-Id: I18cb296b41ddaf64cf127b57aab31154319b5970
2011-06-10 17:07:46 -07:00
Dianne Hackborn
66168d4bb4 resolved conflicts for merge of f51ded0f to master
Change-Id: Ida356524a68aeb2b9b0013dfbb6ab4bd11e616e2
2011-06-10 12:45:36 -07:00
Dianne Hackborn
5ea8834ab9 resolved conflicts for merge of e2aa0490 to master
Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
2011-06-09 17:50:36 -07:00
Dianne Hackborn
199512446d am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents." into honeycomb-mr2
* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
  Enforce public resource restriction on bag parents.
2011-06-09 16:06:07 -07:00
Dianne Hackborn
d4bfc93113 Enforce public resource restriction on bag parents.
Need to put some more styles in the SDK to avoid breaking apps.

Also, welcome Android 3.2.

Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
2011-06-09 15:27:39 -07:00
Mathias Agopian
a1bb021469 am 96fcb702: am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2
* commit '96fcb702d75dcfb36c3ebd8fe420c8b29fa67fb7':
  Fix a leak in RefBase
2011-06-09 13:54:54 -07:00
Christopher Tate
a87feb9339 Merge "Fix handling of directory entries" 2011-06-08 20:13:57 -07:00
Christopher Tate
61334a3f83 Fix handling of directory entries
Don't emit tar blocks for directories with an invalid nonzero size.  Also, if
such an entry is encountered during restore, don't actually attempt to treat
it as valid and thus skip over the next actual tar entry.

This patch also adds tracking of the data actually consumed during restore,
and reports a total at the end of stream.

Change-Id: I625173f76df3c007e899209101ff2b587841f184
2011-06-08 20:11:49 -07:00
Dianne Hackborn
b0cc4a8083 am a1396dfe: am 02140891: Merge "Work on issue #4518815: Compatibility mode introduces compatibility regression..." into honeycomb-mr2
* commit 'a1396dfe7ad6ec6953f544be42d69d7804ab0fd4':
  Work on issue #4518815: Compatibility mode introduces compatibility regression...
2011-06-08 20:06:40 -07:00
Dianne Hackborn
ab6bf752b3 Merge "Work on issue #4518815: Compatibility mode introduces compatibility regression..." into honeycomb-mr2 2011-06-08 20:00:50 -07:00
Mathias Agopian
ef1e16fc0b am 19974ecc: Fix a leak in RefBase (DO NOT MERGE)
* commit '19974eccdbd3e4dbd7e3b2cc401db7806d4a17bc':
  Fix a leak in RefBase (DO NOT MERGE)
2011-06-08 19:56:06 -07:00
Mathias Agopian
c2db91c3bf am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2
* commit 'b40e85f90146a654bfe5657187be491147814ea0':
  Fix a leak in RefBase
2011-06-08 19:34:30 -07:00
Dianne Hackborn
acf87675ae Work on issue #4518815: Compatibility mode introduces compatibility regression...
...for Market App iRunner

There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components.  This addresses everything
I could find.

Unfortunately it does *not* fix this particular app.  I am starting to think this
is just an issue in the app.  This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.

Also a few changes here and there to get rid of $#*&^!! debug logs.

Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
2011-06-08 18:45:43 -07:00
Mathias Agopian
3b0a7a739e Fix a leak in RefBase
this bug was introduced recently. it caused RefBase's weakref_impl
structure to be leaked for every RefBase object (about 20 bytes).

Change-Id: Id85e749ba04521199555dd701198edd097c313d4
2011-06-08 16:25:01 -07:00
Mathias Agopian
9a03cecf8b Fix a leak in RefBase (DO NOT MERGE)
this bug was introduced recently. it caused RefBase's weakref_impl
structure to be leaked for every RefBase object (about 20 bytes).

Change-Id: Ia9b155fbfa643ef72cfb8129e96260a3b806a78c
2011-06-08 16:13:39 -07:00
Jeff Brown
5d99f17e82 am 61220e88: am bbbab26e: am 2c180499: Merge "Revert velocity damping. Bug: 4364920" into honeycomb-mr2
* commit '61220e880ac4d9d76b7fd50744439e68e929c697':
  Revert velocity damping. Bug: 4364920
2011-06-07 17:52:30 -07:00
Christopher Tate
9f7bcda136 Fix embedded spaces in tar stream EVEN HARDER
Change-Id: I97ac586ff3541a05d73e1e53f680517c15e6c662
2011-06-07 13:17:17 -07:00
Christopher Tate
72a404d102 Implement shared-storage full backup/restore
Every available shared-storage volume is backed up, tagged with its
ordinal in the set of mounted shared volumes.  This is an approximation
of "internal + the external card".  This lets us restore things to the
same volume [or "equivalent" volume, in the case of a cross-model
restore] as they originated on.

Also fixed a bug in the handling of files/dirs with spaces in
their names.

Change-Id: I380019da8d0bb5b3699bd7c11eeff621a88e78c3
2011-06-07 12:16:27 -07:00
Jeff Brown
b7edd04f7a am bbbab26e: am 2c180499: Merge "Revert velocity damping. Bug: 4364920" into honeycomb-mr2
* commit 'bbbab26ebe9bc789ba9abac757895a6c31de7cc5':
  Revert velocity damping. Bug: 4364920
2011-06-06 20:36:49 -07:00
Jeff Brown
1d3a7130f9 Merge "Revert velocity damping. Bug: 4364920" into honeycomb-mr2 2011-06-06 20:32:18 -07:00
Jeff Brown
7ca7ba2064 Revert velocity damping.
Bug: 4364920

Velocity damping proved to be a bad idea because it would
cause a significant ramp in velocity at the beginning of
a gesture, instead of the desired smooth behavior.  Oh well.

Change-Id: Ie631946f47ef2492bd71fbed1ab44bbb39a875a8
2011-06-06 20:23:54 -07:00
Mathias Agopian
f3d939c5e5 merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
Fix a race that could cause GL commands to be executed from the wrong thread.
  RefBase subclasses can now decide how they want to be destroyed.
  Fix a race in SurfaceFlinger that could cause layers to be leaked forever.
  Fix a race-condtion in SurfaceFlinger that could lead to a crash.

initial cherry-pick:
resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp

Change-Id: I2a335e03fff219e35c18a7b0089b3a11d636576f
2011-06-06 15:14:25 -07:00
Marco Nelissen
0129f1a27f resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp
Change-Id: I1d86ea56b3d1d1b69f6671e5b0df0ca3f0c79643
2011-06-06 09:55:15 -07:00
Jeff Brown
36f49c133e am 56503b8d: am 8186a5f0: am 10c3f367: Merge "Implement pointer acceleration." into honeycomb-mr2
* commit '56503b8ddfe5c82407da32e18061e725f668432d':
  Implement pointer acceleration.
2011-06-03 15:30:33 -07:00
Jeff Brown
576768ca0d am 8186a5f0: am 10c3f367: Merge "Implement pointer acceleration." into honeycomb-mr2
* commit '8186a5f065fac2b82c90cd18d79cd234bc221402':
  Implement pointer acceleration.
2011-06-02 17:33:55 -07:00
Jeff Brown
adab620383 Implement pointer acceleration.
Bug: 4124987
Change-Id: I1f31a28f1594c55302ccabe13fe3ca6d2ff71d50
2011-06-02 14:12:05 -07:00
Christopher Tate
15e113033b Restore from a previous full backup's tarfile
Usage:  adb restore [tarfilename]

Restores app data [and installs the apps if necessary from the backup
file] captured in a previous invocation of 'adb backup'.  The user
must explicitly acknowledge the action on-device before it is allowed
to proceed; this prevents any "invisible" pushes of content from the
host to the device.

Known issues:

* The settings databases and wallpaper are saved/restored, but lots
  of other system state is not yet captured in the full backup.  This
  means that for practical purposes this is usable for 3rd party
  apps at present but not for full-system cloning/imaging.

Change-Id: I0c748b645845e7c9178e30bf142857861a64efd3
2011-06-01 15:09:55 -07:00
Mathias Agopian
b62013f6aa 9-axis sensor fusion with Kalman filter
Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion

Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f
2011-05-27 17:04:55 -07:00
Jeff Brown
98d1f99704 am 8148cc3e: am 86ea1f5f: Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
* commit '8148cc3e47e50c916066e2fed562618b5827188f':
  Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
2011-05-25 14:46:53 -07:00
Jeff Brown
974a08d53e am d5358874: am 5ced76a1: Coalesce input events that arrive faster than 333Hz. (DO NOT MERGE)
* commit 'd5358874e2cc90be3d7d3370ef7342c96c212451':
  Coalesce input events that arrive faster than 333Hz. (DO NOT MERGE)
2011-05-25 14:46:37 -07:00
Jeff Brown
9a2c1ca2dd am af685f3b: am 85a7f99c: Merge "Refactor how timeouts are calculated. (DO NOT MERGE)" into honeycomb-mr2
* commit 'af685f3bb566f297deee1615d55d4f33d5580ba3':
  Refactor how timeouts are calculated. (DO NOT MERGE)
2011-05-25 14:42:20 -07:00
Jeff Brown
689e53cc82 am 16330e24: am 94e838f6: Merge "Improve VelocityTracker numerical stability. (DO NOT MERGE)" into honeycomb-mr2
* commit '16330e249663fed890df0e95fce4016c2971120a':
  Improve VelocityTracker numerical stability. (DO NOT MERGE)
2011-05-25 14:42:06 -07:00
Jeff Brown
446b400910 am 4bd89fb0: am 82e4373e: Merge "Use touch pad gestures to manipulate the pointer. (DO NOT MERGE)" into honeycomb-mr2
* commit '4bd89fb00f319c5d6d4f17b39fd4c0b3dc827ad1':
  Use touch pad gestures to manipulate the pointer. (DO NOT MERGE)
2011-05-25 14:42:01 -07:00
Jeff Brown
d3e6d3e763 Initial checkin of spot presentation for touchpad gestures. (DO NOT MERGE)
Added a new PointerIcon API (hidden for now) for loading
pointer icons.

Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.

Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements.  The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.

Removed the SpotController stub and folded its responsibilities
into PointerController.

Change-Id: Ib647dbd7a57a7f30dd9c6e2c260df51d7bbdd18e
2011-05-25 14:37:17 -07:00
Jeff Brown
fa785531f7 Coalesce input events that arrive faster than 333Hz. (DO NOT MERGE)
Some drivers report individual finger updates one at a time
instead of all at once.  When 10 fingers are down, this can
cause the framework to have to handle 10 times as many events
each with 10 times as much data.  Applications like
PointerLocation would get significantly bogged down by all
of the redundant samples.

This change coalesces samples that are closely spaced in time,
before they are dispatched, as part of the motion event batching
protocol.

Increased the size of the InputChannel shared memory buffer so
that applications can catch up faster if they accumulate a
backlog of samples.

Change-Id: Ibc6abf8af027d9003011ac75caa12941080caba3
2011-05-25 14:37:16 -07:00
Jamie Gennis
8dda6b7bf8 SurfaceTexture: disable a failing test.
The SurfaceTextureSyncModeWaitRetire test was disabled.  It is failing
because of the synchronization hacks that were added to SurfaceTexture
to work around bugs in vendor device drivers.

Change-Id: I09a74538bfe14a04833acb6847471e00826cc7fc
2011-05-25 12:27:33 -07:00
Jamie Gennis
c2c8dfd71b SurfaceTexture: fix an error check in dequeueBuffer.
This change fixes the MIN_UNDEQUEUED_BUFFERS error check in
dequeueBuffer.  The check should only be performed if a buffer has been
queued since the last time the buffer count was changed by the client.
The check must be applied conditionally because video decoders require
all the bufferes to be dequeued and registered before beginning the
decode.

Change-Id: I08d96b380544e395c2fcf0f3983a199bfd695b09
2011-05-25 12:27:33 -07:00
Jamie Gennis
8cd5ba4b7f SurfaceTexture: clean up some comments, tests, etc.
This change fixes up some stale comments, member variable names, log
messages and disables a failing test.

Change-Id: Ic1d3344b18066cf710e4a42838b2417c6b1f2f6c
2011-05-25 12:27:33 -07:00
Simon Wilson
be93983384 am c9cd2387: Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into gingerbread
* commit 'c9cd2387b6938a6fbefc731d2177902266f2a130':
  Fix a race that could cause GL commands to be executed from the wrong thread.
  RefBase subclasses can now decide how they want to be destroyed.
  Fix a race in SurfaceFlinger that could cause layers to be leaked forever.
  Fix a race-condtion in SurfaceFlinger that could lead to a crash.
2011-05-24 17:29:12 -07:00
Jeff Brown
1eb42cf6db Refactor how timeouts are calculated. (DO NOT MERGE)
Added a timeout mechanism to EventHub and InputReader so that
InputMappers can request timeouts to perform delayed processing of
input when needed.

Change-Id: I89c1171c9326c6e413042e3ee13aa9f7f1fc0454
2011-05-23 17:20:42 -07:00
Jeff Brown
c5982b7bee Improve VelocityTracker numerical stability. (DO NOT MERGE)
Replaced VelocityTracker with a faster and more accurate
native implementation.  This avoids the duplicate maintenance
overhead of having two implementations.

The new algorithm requires that the sample duration be at least
10ms in order to contribute to the velocity calculation.  This
ensures that the velocity is not severely overestimated when
samples arrive in bursts.

The new algorithm computes the exponentially weighted moving
average using weights based on the relative duration of successive
sample periods.

The new algorithm is also more careful about how it handles
individual pointers going down or up and their effects on the
collected movement traces.  The intent is to preserve the last
known velocity of pointers as they go up while also ensuring
that other motion samples do not count twice in that case.

Bug: 4086785
Change-Id: I95054102397c4b6a9076dc6a0fc841b4beec7920
2011-05-23 17:19:59 -07:00
Jeff Brown
247da72a5b Use touch pad gestures to manipulate the pointer. (DO NOT MERGE)
1. Single finger tap performs a click.
2. Single finger movement moves the pointer (hovers).
3. Button press plus movement performs click or drag.
   While dragging, the pointer follows the finger that is moving
   fastest.  This is important if there are additional fingers
   down on the touch pad for the purpose of applying force
   to an integrated button underneath.
4. Two fingers near each other moving in the same direction
   are coalesced as a swipe gesture under the pointer.
5. Two or more fingers moving in arbitrary directions are
   transformed into touches in the vicinity of the pointer.
   This makes scale/zoom and rotate gestures possible.

Added a native VelocityTracker implementation to enable intelligent
switching of the active pointer during drags.

Change-Id: I7b7ddacc724fb1306e1590dbaebb740d3130d7cd
2011-05-23 17:19:38 -07:00
Mathias Agopian
3d6881f394 RefBase subclasses can now decide how they want to be destroyed.
This adds a destroy() virtual on RefBase which
sublasses can implement. destroy() is called
in lieu of the destructor whenthe last strong
ref goes away.

Bug: 4483050
Change-Id: I8cbf6044a6fd3f01043a45592b5a60fa1e5fade2
2011-05-23 16:13:48 -07:00
Mathias Agopian
d31099f021 Merge "Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default" 2011-05-20 13:15:20 -07:00
Dianne Hackborn
79ba9b5e39 resolved conflicts for merge of 06a8ceac to master
Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
2011-05-19 21:44:52 -07:00
Mathias Agopian
8561698c9b Call RefBase::destroy() when OBJECT_LIFETIME_* is not the default
Change-Id: Ifb2069e095dba57b7d97e9f2d942fd85fa975f58
2011-05-19 21:01:04 -07:00
Mathias Agopian
0eda070fda Merge "RefBase subclasses can now decide how they want to be destroyed." 2011-05-19 19:41:37 -07:00
Mathias Agopian
20aeb1caa4 RefBase subclasses can now decide how they want to be destroyed.
This adds a destroy() virtual on RefBase which
sublasses can implement. destroy() is called
in lieu of the destructor whenthe last strong
ref goes away.
2011-05-19 19:40:01 -07:00
Dianne Hackborn
7583282db6 am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.
* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
  Add new "-swNNNdp" resource qualifier.
2011-05-19 19:34:21 -07:00
Dianne Hackborn
22585947ff Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
2011-05-19 18:23:29 -07:00
MÃ¥rten Kongstad
963664b6b7 Continue idmap generation even if name lookup fails.
In resources.arsc files, a resource is represented by a specification
block and one or more value blocks. In rare cases, a resource name
is also given a new resource ID, a specification block and no values
blocks. This commit ensures idmap generation does not fail if such an
entry is encountered.

Change-Id: I32302a0b07a7a320b7eeb31886931be3bb7b7e9a
2011-05-19 16:02:35 +02:00
Mathias Agopian
b27aabc09d Merge "Disable error report temporarily to enable inline video" 2011-05-18 14:43:53 -07:00
Teng-Hui Zhu
d7e291fecd Disable error report temporarily to enable inline video
bug:4435022

Change-Id: I06f05a4781ad432ab71db93f0815eb89cd2e7a69
2011-05-18 14:37:51 -07:00
Jamie Gennis
58c8dd2aa9 libutils: add a binary blob cache implementation.
This change adds an implementation of a cache that stores key/value
pairs of unstructured binary blobs.

Change-Id: Idd01fdabedfa3aed6d359a6efb0592967af52651
2011-05-17 16:58:37 -07:00
Christopher Tate
21a357e114 Merge "Full backup tweaks" 2011-05-13 15:41:32 -07:00
Christopher Tate
b41c5a5ae7 Full backup tweaks
* provide placeholder UI showing backup/restore start/stop/timeout
* don't kill the progress UI in mid stream
* tidy up the pax extended header data writing a little

Change-Id: Ife0cb78e3facb541d8327f1d5ca5fe77faa6cbca
2011-05-13 15:38:02 -07:00
Jeff Brown
282cdfb6f4 Merge "Add initial API for stylus and mouse buttons." 2011-05-13 12:14:27 -07:00
Jeff Brown
e959ed2533 Add initial API for stylus and mouse buttons.
Added the concept of pointer properties in a MotionEvent.
This is currently used to track the pointer tool type to enable
applications to distinguish finger touches from a stylus.

Button states are also reported to application as part of touch events.

There are no new actions for detecting changes in button states.
The application should instead query the button state from the
MotionEvent and take appropriate action as needed.

A good time to check the button state is on ACTION_DOWN.

As a side-effect, applications that do not support multiple buttons
will treat primary, secondary and tertiary buttons identically
for all touch events.

The back button on the mouse is mapped to KEYCODE_BACK
and the forward button is mapped to KEYCODE_FORWARD.

Added basic plumbing for the secondary mouse button to invoke
the context menu, particularly in lists.

Added clamp and split methods on MotionEvent to take care of
common filtering operations so we don't have them scattered
in multiple places across the framework.

Bug: 4260011
Change-Id: Ie992b4d4e00c8f2e76b961da0a902145b27f6d83
2011-05-13 12:11:17 -07:00
Dianne Hackborn
89178d4de2 am 46a282f3: am 0ed2e845: Merge "DO NOT MERGE. Integrate add new screen width/height in "dp" configs." into honeycomb-mr2
* commit '46a282f323bc05606e4fe1eba795bd9ac7c99819':
  DO NOT MERGE.  Integrate add new screen width/height in "dp" configs.
2011-05-13 11:21:26 -07:00
Dianne Hackborn
88c0d696cc DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
You can now specify resource configuration variants "wNNNdp"
and "hNNNdp".  These are the minimum screen width/height in "dp"
units.  This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes.  Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted.  To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
2011-05-12 18:39:51 -07:00
Christopher Tate
ffd242ed55 Use pax extended tar format to support long filenames etc.
'tar' supports only 100-character paths; 'ustar' supports only
155+100 character prefix + paths; neither supports files larger
than about 8 gigabytes.  We now use the POSIX.1-2001 'pax'
extended tar format for those files in the backup stream that
are too large or have too-long paths for the 'ustar' format.

Change-Id: I2f256823091deaec9b1ccea685d2344753c6cb67
2011-05-12 18:07:57 -07:00
Mathias Agopian
cf46eb9817 fix onFrameAvailable
Change-Id: I391fe9f6684ac9fd4f91416ce18b583f7087d966
2011-05-11 18:01:51 -07:00
Mathias Agopian
68c7794183 Add SurfaceTexture logging
Change-Id: If1b74be5230813fb76429935d88b9d4a7c41700c
2011-05-11 18:01:51 -07:00
Mathias Agopian
8072711307 Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Change-Id: I8382e346ddaa2c4c8ff56ac3ffd7f0109572f188
2011-05-11 18:01:51 -07:00
Mathias Agopian
7a5b22c4e3 new tests for SurfaceTexture synchronous mode
Change-Id: Icfdaa625238246f8d0224efe28fdf2c1c24203f8
2011-05-11 18:01:51 -07:00
Mathias Agopian
b3e518c820 Add the concept of synchronous dequeueBuffer in SurfaceTexture
Change-Id: Ic94cbab092953243a0746e04bbe1b2eb0cc930ef
2011-05-11 18:01:51 -07:00
Mathias Agopian
eafabcdc16 unify SurfaceTexture and Surface
Change-Id: I49da2f5d8408e4cd7e148cfb777bb4ff68cd8f37
2011-05-11 18:01:51 -07:00
Mathias Agopian
c04f153353 Fix a bug where setgeometry couldn't be undone
This change the binder protocol between SurfaceTextureClient
and SurfaceTexture. dequeueBuffer() now takes the requested
parameters for the buffer. SurfaceTexture decides if the
buffer needs to be reallocated and does the allocation
if needed. In that case it returns BUFFER_NEEDS_REALLOCATION
to tell SurfaceTextureClient that it needs to call
requestBuffer (which all parameters have been removed) to
acquire a pointer to the buffer.

dequeueBuffer and requestBuffer could be folded into a single
IPC call, but we chose to optimize the case where buffers are
not created and avoid some complexity in the marshalling code.

Change-Id: I097a7f6f40a3491e10f3f3742eab33999286c304
2011-05-11 18:01:51 -07:00
Conley Owens
25bc410b31 am 041aa34e: am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap file descriptors."
* commit '041aa34e089d7b194a5d93c682c3af3d3116d3f3':
  Add missing clean-up of idmap file descriptors.
2011-05-11 13:10:56 -07:00
Christopher Tate
d78797f6e6 Full local backup infrastructure
This is the basic infrastructure for pulling a full(*) backup of the
device's data over an adb(**) connection to the local device.  The
basic process consists of these interacting pieces:

1. The framework's BackupManagerService, which coordinates the
   collection of app data and routing to the destination.

2. A new framework-provided BackupAgent implementation called
   FullBackupAgent, which is instantiated in the target applications'
   processes in turn, and knows how to emit a datastream that contains
   all of the app's saved data files.

3. A new shell-level program called "bu" that is used to bridge from
   adb to the framework's Backup Manager.

4. adb itself, which now knows how to use 'bu' to kick off a backup
   operation and pull the resulting data stream to the desktop host.

5. A system-provided application that verifies with the user that
   an attempted backup/restore operation is in fact expected and to
   be allowed.

The full agent implementation is not used during normal operation of
the delta-based app-customized remote backup process.  Instead it's
used during user-confirmed *full* backup of applications and all their
data to a local destination, e.g. via the adb connection.

The output format is 'tar'.  This makes it very easy for the end
user to examine the resulting dataset, e.g. for purpose of extracting
files for debug purposes; as well as making it easy to contemplate
adding things like a direct gzip stage to the data pipeline during
backup/restore.  It also makes it convenient to construct and maintain
synthetic backup datasets for testing purposes.

Within the tar format, certain artificial conventions are used.
All files are stored within top-level directories according to
their semantic origin:

apps/pkgname/a/  : Application .apk file itself
apps/pkgname/obb/: The application's associated .obb containers
apps/pkgname/f/  : The subtree rooted at the getFilesDir() location
apps/pkgname/db/ : The subtree rooted at the getDatabasePath() parent
apps/pkgname/sp/ : The subtree rooted at the getSharedPrefsFile() parent
apps/pkgname/r/  : Files stored relative to the root of the app's file tree
apps/pkgname/c/  : Reserved for the app's getCacheDir() tree; not stored.

For each package, the first entry in the tar stream is a file called
"_manifest", nominally rooted at apps/pkgname.  This file contains some
metadata about the package whose data is stored in the archive.

The contents of shared storage can optionally be included in the tar
stream. It is placed in the synthetic location:

shared/...

uid/gid are ignored; app uids are assigned at install time, and the
app's data is handled from within its own execution environment, so
will automatically have the app's correct uid.

Forward-locked .apk files are never backed up.  System-partition
.apk files are not backed up unless they have been overridden by a
post-factory upgrade, in which case the current .apk *is* backed up --
i.e. the .apk that matches the on-disk data.  The manifest preceding
each application's portion of the tar stream provides version numbers
and signature blocks for version checking, as well as an indication
of whether the restore logic should expect to install the .apk before
extracting the data.

System packages can designate their own full backup agents.  This is
to manage things like the settings provider which (a) cannot be shut
down on the fly in order to do a clean snapshot of their file trees,
and (b) manage data that is not only irrelevant but actively hostile
to non-identical devices -- CDMA telephony settings would seriously
mess up a GSM device if emplaced there blind, for example.

When a full backup or restore is initiated from adb, the system will
present a confirmation UI that the user must explicitly respond to
within a short [~ 30 seconds] timeout.  This is to avoid the
possibility of malicious desktop-side software secretly grabbing a copy
of all the user's data for nefarious purposes.

(*) The backup is not strictly a full mirror.  In particular, the
    settings database is not cloned; it is handled the same way that
    it is in cloud backup/restore.  This is because some settings
    are actively destructive if cloned onto a different (or
    especially a different-model) device: telephony settings and
    AndroidID are good examples of this.

(**) On the framework side it doesn't care that it's adb; it just
    sends the tar stream to a file descriptor.  This can easily be
    retargeted around whatever transport we might decide to use
    in the future.

KNOWN ISSUES:

* the security UI is desperately ugly; no proper designs have yet
  been done for it
* restore is not yet implemented
* shared storage backup is not yet implemented
* symlinks aren't yet handled, though some infrastructure for
  dealing with them has been put in place.

Change-Id: Ia8347611e23b398af36ea22c36dff0a276b1ce91
2011-05-10 17:52:51 -07:00
Conley Owens
74cfbe1239 am 87d86044: am bcd029b6: Merge "Add missing clean-up of idmap file descriptors."
* commit '87d86044c0f15ae2ffc0350271c76ff874fb413b':
  Add missing clean-up of idmap file descriptors.
2011-05-10 16:19:29 -07:00
Dianne Hackborn
db05e228a4 resolved conflicts for merge of 05be6d6f to master
Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
2011-05-09 19:00:59 -07:00
Dianne Hackborn
d97f6b4ef9 am 4907d1d5: am 0c6cbf41: Merge "Better compat mode part one: start scaling windows." into honeycomb-mr2
* commit '4907d1d5e2c7d244b07579b8c52153df69754e85':
  Better compat mode part one: start scaling windows.
2011-05-09 17:10:34 -07:00
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
MÃ¥rten Kongstad
3e17850f1c Add missing clean-up of idmap file descriptors.
Change-Id: I9bdc9a4b7962f1a8dce77f4b213c8b9dc26e4b0f
2011-05-05 15:38:14 +02:00
Iliyan Malchev
697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
Iliyan Malchev
41abd67302 frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method

Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:40 -07:00
Conley Owens
ae9331ec90 Merge "Implement support for ALT and SHIFT modifiers" 2011-04-29 09:59:55 -07:00
Conley Owens
5324becece Merge "modify the device to enable to get the state as slide-open/slide-close." 2011-04-29 09:59:42 -07:00
Jamie Gennis
39a01c6694 Merge "libgui: enable tests in the 'tests' build." 2011-04-28 15:03:56 -07:00
Mathias Agopian
cc57d6f883 Fix uninitialized variable in SurfaceTexture
Change-Id: Ie77cdad481fc0522ff5ea3b7e14ce94e07150793
2011-04-27 18:58:46 -07:00
Mathias Agopian
0ea7d61fa1 Merge "Report errors when eglCreateImageKHR fails" 2011-04-26 18:05:23 -07:00
Jamie Gennis
7fcb077c55 libgui: enable tests in the 'tests' build.
This change makes the libgui makefile recurse into the tests directory
so that the tests get built by a top-level make when
TARGET_BUILD_VARIANT=tests.

Change-Id: I6f623cc4b86dfeb00b9d21823316dbd9def23110
2011-04-26 17:26:37 -07:00
Mathias Agopian
3cd5a11708 Report errors when eglCreateImageKHR fails
Change-Id: Ica39b72ac2505675e619ef4994bd67b98bf6e7da
2011-04-26 15:03:27 -07:00
Kenny Root
7e002d9a3f am fbb0e9f9: am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'fbb0e9f9846e185ba8ded63d754c4e61b1499b90':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 12:46:04 -07:00
Kenny Root
f3faf0bc3d am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'bb93dad9250c0ee8330ab37bbdcd2eb8bfc0f930':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:45:46 -07:00
Kenny Root
b5e7f05190 am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit '13ce221e4316f7956ba072e774a7b97646e5d99b':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:32:22 -07:00
Jamie Gennis
1b528fb9d8 EGL: Allow creating a SurfaceTexture EGLSurface.
This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.

Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
2011-04-25 16:41:11 -07:00
Jamie Gennis
fc850124b3 libgui: Fix the tests so they build.
Change-Id: I7205b0819e5801ac549109ff562c3ab1b113d176
2011-04-25 16:40:05 -07:00
Josh Stone
e6b21626a5 libutils: Fix an improper const-cast in RefBase
Under Fedora 15 Beta, gcc 4.6.0 warns:

  frameworks/base/libs/utils/RefBase.cpp: In member function
    ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
  frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing
    ‘const android::RefBase::weakref_impl’ as ‘this’ argument of
    ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’
    discards qualifiers [-fpermissive]

trackMe is not a const function, so don't use const in the static_cast
to a weakref_impl pointer.

Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c
2011-04-22 11:13:35 -07:00
Mathias Agopian
f79f84f8be Merge "Get rid of the "pid" parameter from createSurface" 2011-04-21 17:14:18 -07:00
Evgeniy Stepanov
d547432f98 Make sure binder ioctl structs don't contain uninitialized values.
Change-Id: I8a678f91262417bb120e65e32c244ce1512b46c2
2011-04-21 14:37:15 +04:00
Mathias Agopian
0ef4e15a6c Get rid of the "pid" parameter from createSurface
Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
2011-04-20 14:26:11 -07:00
Jeff Brown
96dfedc55c Merge "Initial checkin of spot presentation for touchpad gestures." 2011-04-19 15:37:32 -07:00
Jeff Brown
4815f2a6ad Initial checkin of spot presentation for touchpad gestures.
Added a new PointerIcon API (hidden for now) for loading
pointer icons.

Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.

Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements.  The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.

Removed the SpotController stub and folded its responsibilities
into PointerController.

Change-Id: I5126b1e69d95252fda7f2a684c9287e239a57163
2011-04-19 15:35:51 -07:00
Mathias Agopian
7e3d7f341a Merge "changes to SurfaceTexture needed for unification with SF" 2011-04-18 19:51:26 -07:00
Andreas Huber
6e9eb7453f Merge "Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)" 2011-04-18 08:12:36 -07:00
Mathias Agopian
a36a302e92 Merge "Fix a GraphicBuffer leak in SurfaceTexture" 2011-04-15 18:15:13 -07:00
Dianne Hackborn
97e2bcd760 Rewrite battery history storage.
We now write battery history directly into a buffer, instead of
creating objects.  This allows for more efficient storage; later
it can be even better because we can only write deltas.

The old code is still there temporarily for validation.

Change-Id: I9707d4d8ff30855be8ebdc93bc078911040d8e0b
2011-04-14 10:57:22 -07:00
Andreas Huber
51faf46e29 Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)
As far as I can tell "parcel" isn't actually modified by the implementation.

Change-Id: Ib806eefdc13c97b932773e1dc9ca3a4aad4422b2
2011-04-13 10:21:56 -07:00
Kenny Root
81bc567745 resolved conflicts for merge of 18490fb9 to master
Change-Id: I6c68e6fb0f9c1182a955689bbffc161a8f30bd37
2011-04-12 12:51:08 -07:00
Kenny Root
f6bbefd581 resolved conflicts for merge of 87b3c0dc to honeycomb-plus-aosp
Change-Id: Ia1a0024aabf531438203eb9fea3a10dd15eabe53
2011-04-12 10:27:15 -07:00
Mathias Agopian
7a042bf324 changes to SurfaceTexture needed for unification with SF
- implement connect/disconnect
- implement missing query
- handle texture_2d in addition to texture_external_oes

Change-Id: I971a70821f00f22b01f5337de4a7d451177fec4d
2011-04-11 21:19:55 -07:00
Kenny Root
8a1a615176 am 08d9d9a4: Merge "Runtime resource overlay, iteration 1."
* commit '08d9d9a46250c4fad66e9b637e8898a3524c4286':
  Runtime resource overlay, iteration 1.
2011-04-11 15:33:19 -07:00
Mathias Agopian
4cb18881b5 Fix a GraphicBuffer leak in SurfaceTexture
This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.

In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.

this allows the public facing API to not expose the previous hack.

Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
2011-04-08 19:28:04 -07:00
Jeff Brown
76a8686e2b Merge "Coalesce input events that arrive faster than 333Hz." 2011-04-07 13:18:38 -07:00
Jeff Brown
4e394b18ba Coalesce input events that arrive faster than 333Hz.
Some drivers report individual finger updates one at a time
instead of all at once.  When 10 fingers are down, this can
cause the framework to have to handle 10 times as many events
each with 10 times as much data.  Applications like
PointerLocation would get significantly bogged down by all
of the redundant samples.

This change coalesces samples that are closely spaced in time,
before they are dispatched, as part of the motion event batching
protocol.

Increased the size of the InputChannel shared memory buffer so
that applications can catch up faster if they accumulate a
backlog of samples.

Added logging code to help measure input dispatch and drawing
latency issues in the view hierarchy.  See ViewDebug.DEBUG_LATENCY.

Change-Id: Ia5898f781f19901d2225c529a910c32bdf4f504f
2011-04-07 13:11:16 -07:00
Mathias Agopian
b561dd29b5 Merge "remove more unused references to ISurface" 2011-04-06 12:22:29 -07:00
Dianne Hackborn
592e3fc150 Add new resource configurations for screen width/height in "dp".
You can now specify resource configuration variants "wNNNdp"
and "hNNNdp".  These are the minimum screen width/height in "dp"
units.  This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes.  Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted.  To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
2011-04-06 11:00:37 -07:00
Mathias Agopian
47d8730a24 remove more unused references to ISurface
Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
2011-04-05 20:11:55 -07:00
Jeff Brown
884f344137 Merge "Fix dispatcher crash when input monitoring enabled. Also ensure that we actually log assertion failures." 2011-04-01 16:33:40 -07:00
Jeff Brown
23e0c8c1a1 Fix dispatcher crash when input monitoring enabled.
Also ensure that we actually log assertion failures.

Bug: 4203092
Change-Id: I5c14bc41b2255f876858121f5572e2de75cabcc3
2011-04-01 16:15:13 -07:00
Mathias Agopian
a5c75c0162 SurfaceTexture can now force the client to request a buffer
SurfaceTexture now has the concept of default size a new method,
setDefaultBufferSize() to set it. When the default size is
changed, dequeueBuffer() will return a value telling the
client that it must ask for a new buffer.

The above only applies if the client has not
overriden the buffer size with setGeometry.

Change-Id: I520dc40363054b7e37fdb67d6a2e7bce70326e81
2011-04-01 14:43:35 -07:00
MÃ¥rten Kongstad
5f29c87ef2 Runtime resource overlay, iteration 1.
Runtime resource overlay allows unmodified applications to appear
as if they had been compiled with additional resources defined. See
libs/utils/README for more information.

This commit is the first iteration of runtime resource overlay. It
provides the actual overlay modifications and loading of trusted overlay
packages (ie residing in /vendor) targeting framework-res.apk.

This commit loads exactly one overlay package. The overlay,
if present, must target framework-res.apk and be located at
/vendor/overlay/framework/framework-res.apk.

Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
2011-04-01 14:12:10 +02:00
nao
28bcfd4e9d modify the device to enable to get the state as slide-open/slide-close.
This modify is for the devices which have a slidable H/W keyboard with backlight.

For example of current issues:
 - Backlight of H/W keyboard doesn't turn on when the device starts up with slide-open.
 - Home screen doesn't display with proper orientation when the device starts up with slide-open.

Change-Id: I6a6a18d0b09d0ba484ca992c9fb34f24de9bf21b
2011-03-31 11:53:15 +09:00
Mathias Agopian
d87f162026 merge libsurfaceflinger_client into libgui
this is the first step in unifying surfacetexture and surface.
for this reason the header files were not moved, as most of them
will eventually go away.

NOTE: currently we keep libsurfaceflinger_client.so as an empty
library to workaround prebuilt binaries wrongly linking against
it.

Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
2011-03-25 18:42:40 -07:00
Carl Shapiro
3bafffb1bd Include strings.h for the strcasecmp prototype.
Change-Id: I0659ce2186547274e58f8b2027e16d3e45189353
2011-03-21 20:26:25 -07:00
Jeff Brown
f98f1364f8 Merge "Refactor how timeouts are calculated." 2011-03-17 20:16:42 -07:00
Jeff Brown
c0a5e8df03 Refactor how timeouts are calculated.
Added a timeout mechanism to EventHub and InputReader so that
InputMappers can request timeouts to perform delayed processing of
input when needed.

Change-Id: Iec2045baaf4e67690b15eef3c09a58d5cac76897
2011-03-17 17:29:09 -07:00
Eino-Ville Talvala
edc5ac145b Merge "Add support for timestamps into SurfaceTexture." 2011-03-17 15:52:34 -07:00
Eino-Ville Talvala
1d01a12e71 Add support for timestamps into SurfaceTexture.
API addition: The timestamps are represented as nanoseconds from some
arbitrary time point. Like the SurfaceTexture transform matrix, the
timestamp retrieved by getTimestamp is for the last frame sent to the
GL texture using updateTexImage().

Camera HAL change: Expect vendors to set these timestamps using
native_window_set_buffers_timestamp().  For now, they are
autogenerated by SurfaceTextureClient if set_buffers_timestamp() is
never called, but such timing is likely not accurate enough to pass a
CTS test.

bug:3300707

Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
2011-03-17 13:10:03 -07:00
Mathias Agopian
939fee8819 am e22aa623: am 25594e19: am f40e638e: fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
* commit 'e22aa62362a3007ee59ac62d4b5969e216987995':
  fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
2011-03-17 00:13:49 -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
Jeff Brown
e3d4a68f2d Merge "Improve VelocityTracker numerical stability." 2011-03-15 20:01:16 -07:00
Jeff Brown
1593354388 Improve VelocityTracker numerical stability.
Replaced VelocityTracker with a faster and more accurate
native implementation.  This avoids the duplicate maintenance
overhead of having two implementations.

The new algorithm requires that the sample duration be at least
10ms in order to contribute to the velocity calculation.  This
ensures that the velocity is not severely overestimated when
samples arrive in bursts.

The new algorithm computes the exponentially weighted moving
average using weights based on the relative duration of successive
sample periods.

The new algorithm is also more careful about how it handles
individual pointers going down or up and their effects on the
collected movement traces.  The intent is to preserve the last
known velocity of pointers as they go up while also ensuring
that other motion samples do not count twice in that case.

Bug: 4086785
Change-Id: I2632321232c64d6b8faacdb929e33f60e64dcdd3
2011-03-15 19:59:47 -07:00
Jamie Gennis
9db01a7c1c am 0ea44ac0: am 00f47af8: Merge "SurfaceTexture: disallow unsupported uses." into honeycomb-mr1
* commit '0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1':
  SurfaceTexture: disallow unsupported uses.
2011-03-15 13:01:27 -07:00
Jamie Gennis
3f13cf1be5 am c570ee21: am 41a894ad: am 75597105: Merge "SurfaceTextureClient: Add ISurfaceTexture getter." into honeycomb-mr1
* commit 'c570ee21e2c2b9802c9d1f58dba024e884b225e6':
  SurfaceTextureClient: Add ISurfaceTexture getter.
2011-03-15 10:45:01 -07:00
Jamie Gennis
cefc876234 am ceb7cb14: am 02805a40: Merge "ANativeWindow: add query for the concrete type." into honeycomb-mr1
* commit 'ceb7cb1460484eda1a3cb9cd271d7caf3a3dcbd1':
  ANativeWindow: add query for the concrete type.
2011-03-15 10:42:06 -07:00
Jamie Gennis
5c0c93a8c4 SurfaceTexture: disallow unsupported uses.
This change makes the ANativeWindow_lock NDK function error out if it is
passed an ANativeWindow with a concrete type that is not Surface.  It
also makes eglCreateWindowSurface fail if it is passed a
SurfaceTextureClient as its 'window' argument.

Bug: 4087277
Change-Id: Ie68c50c52d88f72d8a387f6c094908044c83a88c
2011-03-15 10:37:37 -07:00
Jamie Gennis
96e0873907 am adf565f0: am 1a0452b7: am 122dd099: Merge "SurfaceTexture: fix transform matrix computation." into honeycomb-mr1
* commit 'adf565f02676a8f41b572d23123695e732ffd321':
  SurfaceTexture: fix transform matrix computation.
2011-03-14 17:51:48 -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
Jamie Gennis
827ebdbbff Merge "SurfaceTexture: fix transform matrix computation." into honeycomb-mr1 2011-03-14 17:42:48 -07:00
Jeff Brown
fa773aa745 Use touch pad gestures to manipulate the pointer.
1. Single finger tap performs a click.
2. Single finger movement moves the pointer (hovers).
3. Button press plus movement performs click or drag.
   While dragging, the pointer follows the finger that is moving
   fastest.  This is important if there are additional fingers
   down on the touch pad for the purpose of applying force
   to an integrated button underneath.
4. Two fingers near each other moving in the same direction
   are coalesced as a swipe gesture under the pointer.
5. Two or more fingers moving in arbitrary directions are
   transformed into touches in the vicinity of the pointer.
   This makes scale/zoom and rotate gestures possible.

Added a native VelocityTracker implementation to enable intelligent
switching of the active pointer during drags.

Change-Id: I5ada57e7f2bdb9b0a791843eb354a8c706b365dc
2011-03-14 14:12:03 -07:00
Jamie Gennis
d99c088f35 SurfaceTexture: fix transform matrix computation.
This change fixes the transform matrix computation in SurfaceTexture
when a crop rectangle is specified by the image producer.  It also adds
a test for this case as well as a basic test for the uncropped case.

Bug: 4070775
Change-Id: I1481c9ce9d08fe7f2bff86d3afdeab7d4002b157
2011-03-14 11:30:16 -07:00
Jamie Gennis
c2cc1b3f97 Merge "SurfaceFlinger: Respect the PROTECTED gralloc bit." into honeycomb-mr1 2011-03-10 18:06:32 -08:00
Jamie Gennis
7a4d0dfd43 SurfaceFlinger: Respect the PROTECTED gralloc bit.
This change makes SurfaceFlinger treat layers for which the active
buffer has the GRALLOC_USAGE_PROTECTED bit set as if they have the
'secure' flag set.

Change-Id: Ic60b6513a63e4bb92ec6ce9fd12fd39b4ba5f674
Bug: 4081304
2011-03-10 16:25:48 -08: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
Mathias Agopian
18570db84e am 33029221: Merge "revert the surface purgatory list and dependent changes." into gingerbread
* commit '33029221619f14577bd0d0e7c2f815abc8f1b8ea':
  revert the surface purgatory list and dependent changes.
2011-03-09 17:11:10 -08:00
Mathias Agopian
f7662afb76 revert the surface purgatory list and dependent changes.
6d0f6cb Revert "Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only"
6154412 Revert "partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)"
37c2a37 fix [3408713] Dialog window invisible sometimes

It looks like there is a surface leak, it's unclear where it is.
Without those reverts, this would cause a leak of the associated buffers
which is far more problematic. this change might hide the surface leak.

Bug: 4078032
Change-Id: Iedcda3ffcdd2f69d41047b5c3134c1e867ff90d7
2011-03-09 17:00:41 -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
Johan Redestig
bbd0dc8607 Implement support for ALT and SHIFT modifiers
The spec for keymaps and keboard input at
http://source.android.com/porting/keymaps_keyboard_input.html
mentions the stand alone ALT and SHIFT modifiers:

SHIFT: While pressed, the shift key modifier is set
ALT: While pressed, the alt key modifier is set

This commit implements support for these.

Change-Id: I5854ef3df541740cc3443b474a9c41183eb7561c
Ex: key 305   BACK  ALT
2011-03-08 16:27:46 +01: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
e572319eaf am e23c235c: Merge "Only set KeyEvent long press flag when repeat count equals 1." into gingerbread
* commit 'e23c235c662c3028cfb080c6ed60d7defcdd0b69':
  Only set KeyEvent long press flag when repeat count equals 1.
2011-03-03 15:03:26 -08:00
Jeff Brown
ec7fb80775 Only set KeyEvent long press flag when repeat count equals 1.
This fixes a Gingerbread regression.

Bug: 3507021
Change-Id: Ia6030665b6a406332adc0ee0d8ee3cb735338c8e
2011-03-02 20:49:06 -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
Jamie Gennis
ea72db3737 Merge "Add the MIN_UNDEQUEUED_BUFFERS query to ANW." 2011-03-01 14:38:20 -08:00
Mathias Agopian
26f429d60e Merge "surfaceflinger_client: Don't dereference NULL ptrs." 2011-02-28 12:50:25 -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
Jamie Gennis
bd9cbc3b55 surfaceflinger_client: Don't dereference NULL ptrs.
This change adds a null pointer check before dereferencing buffers in
a Surface list of known GraphicBuffer objects.  If not all the buffers
have been dequeued before this list can legitimately contain NULL
entries.

Change-Id: I0e105b53a3f6f9a5404716b7bf150c793ff648a6
2011-02-27 18:43:17 -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
Mathias Agopian
da26c6662d Merge "Fix some issues with RefBase debugging." 2011-02-24 16:23:51 -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
25943a83f2 Add new hover move action and scroll wheel plumbing.
Added support for tracking the mouse position even when the mouse button
is not pressed.  To avoid confusing existing applications, mouse movements
are reported using the new ACTION_HOVER_MOVE action when the mouse button
is not pressed.

Added some more plumbing for the scroll wheel axes.  The values are
reported to Views but they are not yet handled by the framework.

Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
2011-02-19 06:14:21 -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
a1e5401add Merge "Add support for arbitrary axes in MotionEvents." 2011-02-16 20:00:21 -08:00
Kenny Root
af1cf07134 Clean up use of HAVE_ANDROID_OS
HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0"
for non-targets. Changing them to #ifdef should be safe and matches
all the other uses of HAVE_ANDROID_OS throughout the system.

Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
2011-02-16 10:56:32 -08:00
Mathias Agopian
7266fb76c9 allow root to call into surfaceflinger
this is useful for running standalone tests
with standalone SurfaceFlinger.

Change-Id: I08d054f6214affa3a777a82765f4e0bd256ba26d
2011-02-15 19:27:47 -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
Jamie Gennis
e839fdad46 am c7839751: am c2efcd2c: Merge "Initialize the SurfaceTexture transform fields." into honeycomb
* commit 'c7839751aa1de52e0c3aab7dd1518b0fc8f2ee0a':
  Initialize the SurfaceTexture transform fields.
2011-02-07 13:47:02 -08:00
Jamie Gennis
6647e201e3 am c2efcd2c: Merge "Initialize the SurfaceTexture transform fields." into honeycomb
* commit 'c2efcd2ceadab33b42d938e3771c994816e9a4b0':
  Initialize the SurfaceTexture transform fields.
2011-02-04 15:05:28 -08:00
Jamie Gennis
f73935bb0d Initialize the SurfaceTexture transform fields.
Change-Id: I2c25f15949253a1dbe493fef440e5ef118c40e71
related-bug: 3426067
2011-02-04 13:46:38 -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
0eb8851e8c Clear GL errors before updating a SurfaceTexture.
Change-Id: Ibdac657ae9e9ccae53c63abed9caf1f1513915c2
2011-01-31 15:35:29 -08:00
Jean-Baptiste Queru
d45c61dfcf am 1314bdb2: am e88fa50b: Merge from open-source gingerbread
* commit '1314bdb2b22ae3613c3e08ae278dbc70f90b965c':
  fix failing thread object run
2011-01-30 16:32:44 -08:00
Jean-Baptiste Queru
9bfc45e3c3 am e88fa50b: Merge from open-source gingerbread
* commit 'e88fa50be8d6709ef58b7aeb01c5efa059bcac2e':
  fix failing thread object run
2011-01-30 16:19:59 -08:00
Jean-Baptiste Queru
02bac86968 Merge from open-source gingerbread
Change-Id: I56f2ed37187796807fbf0de15274a85164f9432c
2011-01-30 15:30:03 -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
Jamie Gennis
da04384f18 Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb 2011-01-30 15:00:44 -08:00
The Android Open Source Project
b36560f33e Mass merge from gingerbread - do not merge
Change-Id: I45dc3596bf4211d8f91c64f2d1d00588878df629
2011-01-30 12:40:38 -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
Jamie Gennis
e8c431b142 am 2a8f8d57: Merge "Quiet the SurfaceFlingerClient dequeueBuffer error." into honeycomb
* commit '2a8f8d57d23a171eaa367faa143f45fdd2f9cc1c':
  Quiet the SurfaceFlingerClient dequeueBuffer error.
2011-01-28 14:15:44 -08:00
Jamie Gennis
155c93ad47 Merge "Quiet the SurfaceFlingerClient dequeueBuffer error." into honeycomb 2011-01-28 14:12:57 -08:00
Jamie Gennis
749172269a Quiet the SurfaceFlingerClient dequeueBuffer error.
This is a temporary WAR for the case where dequeueBuffer is called when
all the buffers owned by a SurfaceTexture are not available - either
they're the current texture buffer or the next one.  Currently, an error
is returned in that case, and this change just prevents that error from
being logged.  In the future this will be fixed to not return an error
in that case.

Bug: 3356050
Change-Id: Ic6cc304881a63ce134cfd0bcb4265e3e3fa94b6a
2011-01-28 12:08:18 -08:00
Dianne Hackborn
311559851f am 256a09b2: Merge "Fix issue #3392073: At times soft keyboard comes up in..." into honeycomb
* commit '256a09b2fa5cc06775818428de771c7957403452':
  Fix issue #3392073: At times soft keyboard comes up in...
2011-01-27 22:50:56 -08:00
Dianne Hackborn
11e0746577 Fix issue #3392073: At times soft keyboard comes up in...
...gallery while attaching picture to gmail message

In various places we could block switching the IME target incorrectly.

Change-Id: I7e647fb35f4ea6f2e39eb7efd911420ea9ee64fa
2011-01-27 21:56:33 -08:00
Mathias Agopian
830423f797 am 72abf01a: Merge "Fix the ISurfaceComposer onTransact switch." into gingerbread
* commit '72abf01a8b6958ac1f86d36302a8462c4f51fd9d':
  Fix the ISurfaceComposer onTransact switch.
2011-01-27 11:24:33 -08:00
Ritu Srivastava
5ee1a0c5ee fix failing thread object run
A previously exited Thread object refuses to run again, if the
thread-id of the caller, conincides with the thread-id it previously
used in the worker thread. Hence reset the previously used worker
thread-id to -1 when it exits.

 Signed-off-by: Ritu Srivastava <rsrivast@sta.samsung.com>

Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2

Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
2011-01-25 21:48:54 -08:00
Mathias Agopian
275e627ef6 am 239fd805: Merge "fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)" into gingerbread
* commit '239fd805ef7c0e4116b0a89e20caaf287e91f017':
  fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)
2011-01-25 14:46:40 -08:00