1227 Commits

Author SHA1 Message Date
Eino-Ville Talvala
c5f94d8a47 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
Jeff Brown
843e29d375 Merge "Improve VelocityTracker numerical stability." 2011-03-15 20:01:16 -07:00
Jeff Brown
2ed2462aa2 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
Mike Lockwood
aa155b4bee am 6a20784e: am afd1c014: Merge "SqliteDatabase: Fix local reference leak in custom_function_callback()" into honeycomb-mr1
* commit '6a20784e461b0c0b24ccd04acf9509565aec3e70':
  SqliteDatabase: Fix local reference leak in custom_function_callback()
2011-03-15 13:49:09 -07:00
Mike Lockwood
6a20784e46 am afd1c014: Merge "SqliteDatabase: Fix local reference leak in custom_function_callback()" into honeycomb-mr1
* commit 'afd1c0143dfa63bd133e3a4163cc9cc4216e3514':
  SqliteDatabase: Fix local reference leak in custom_function_callback()
2011-03-15 13:42:35 -07:00
Mike Lockwood
b0f72de87d SqliteDatabase: Fix local reference leak in custom_function_callback()
Caused a local reference table overflow, only when deleting a large number
of files in a single SQL transaction in the media provider.

Bug: 4093346

Change-Id: I10078a5d7537c2e577763d88e909e34321945a59
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-15 14:38:28 -04:00
Dianne Hackborn
491d1fef99 am f58f041b: am cffde30f: am 44220a56: Merge "Add some debug code to try to track down issue 3183612" into gingerbread
* commit 'f58f041beb8a00db201eb3c8eb801dc1b702253d':
  Add some debug code to try to track down issue 3183612
2011-03-15 11:06:14 -07:00
Dianne Hackborn
f58f041beb am cffde30f: am 44220a56: Merge "Add some debug code to try to track down issue 3183612" into gingerbread
* commit 'cffde30fc10ecdfca53877fbee61525028eb47ba':
  Add some debug code to try to track down issue 3183612
2011-03-15 11:03:42 -07:00
Dianne Hackborn
cffde30fc1 am 44220a56: Merge "Add some debug code to try to track down issue 3183612" into gingerbread
* commit '44220a56026ead4583a9db96ced5f1113d4b4f07':
  Add some debug code to try to track down issue 3183612
2011-03-15 10:52:27 -07:00
Romain Guy
8329db39f2 am b245e31f: am ee7ace06: Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1
* commit 'b245e31fa8dd1ad6a59ccf858154f3c7b92e0eb8':
  Fix rendering artifact in edge fades. Bug #4092053
2011-03-14 18:21:21 -07:00
Romain Guy
ee7ace065f Merge "Fix rendering artifact in edge fades. Bug #4092053" into honeycomb-mr1 2011-03-14 18:16:39 -07:00
Romain Guy
7b5b6abf85 Fix rendering artifact in edge fades.
Bug #4092053

The problem always existed but was made visible by partial invalidation.
When saving a layer, the renderer would try to postpone glClear()
operations until the next drawing command. This however does not work
since the clip might have changed. The fix is rather simple and
simply gets rid of this "optimization" (that turned out to be
usless anyway given how View issues saveLayer() calls.)

This change also fixes an issue with gradients (color stops where
not properly computed when using a null stops array) and optimizes
display lists rendering (quickly rejects larger portions of the
tree to avoid executing unnecessary code.)

Change-Id: I0f5b5f6e1220d41a09cc2fa84c212b0b4afd9c46
2011-03-14 18:05:08 -07:00
Dianne Hackborn
cf3004a46e Add some debug code to try to track down issue 3183612
java.lang.SecurityException: Neither user 1209 nor current process
has android.permission.WAKE_LOCK.

Change-Id: I3e84f8795941744e697824a5e5b2e651f565b253
2011-03-14 14:24:04 -07:00
Brad Fitzpatrick
6f3a75e13b Merge "Throw errors on failures to set system properties." 2011-03-14 09:27:58 -07:00
Glenn Kasten
977d1fbf47 am dd264f21: am 76470914: Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1
* commit 'dd264f21e6e9952b3d2ef53ea8a8a9e918e5ce96':
  Bug 3515073 Add ANativeWindow_fromSurfaceTexture
2011-03-11 16:36:42 -08:00
Glenn Kasten
7647091436 Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1 2011-03-11 16:31:55 -08:00
Mike Lockwood
b46ecb3526 am 75c95e9a: am 0eb7b697: Merge changes Ib63ab95a,I585b0610,Ia84da0b5 into honeycomb-mr1
* commit '75c95e9a6d5a91b660af62f72b5a3bac0f5c3811':
  UsbManager: Hide APIs not needed for USB host or accessory support.
  Remove MtpClient class from framework and public API
  UsbDevice: Move IO related methods to new UsbDeviceConnection class
2011-03-11 11:53:13 -08:00
Mike Lockwood
acc29cc91b UsbDevice: Move IO related methods to new UsbDeviceConnection class
UsbDevice is now just an immutable parcelable object like UsbInterface and
UsbEndpoint.
All IO related functionality is now contained in UsbDeviceConnection
and UsbRequest.

Bug: 4067029

Change-Id: Ia84da0b512a697acc940eee0c3566711c62e1a68
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-11 10:24:21 -05:00
Ken Sumrall
c25e6de94d am 9246e4ed: am c7fcc507: Merge "Teach the framework to use the new android_reboot() function." into honeycomb-mr1
* commit '9246e4edbab5f24dc06df34992493c64c50fd380':
  Teach the framework to use the new android_reboot() function.
2011-03-10 19:29:52 -08:00
Ken Sumrall
c7fcc5076f Merge "Teach the framework to use the new android_reboot() function." into honeycomb-mr1 2011-03-10 19:24:42 -08:00
Brad Fitzpatrick
06f367437c Throw errors on failures to set system properties.
Let's turn this on for awhile in master and see what happens
watching the crash reports.

I'd rather not silently ignore errors if possible.

Change-Id: Ia87cf4448df3a5b3f03c1df5c1fd59a204d02036
2011-03-10 16:04:59 -08:00
TK MUN
c01fd043a9 am 4bdab175: DO NOT MERGE WiMAX support
* commit '4bdab1751f0db3b2f03e8c58ef5c11a543dfa3c7':
  DO NOT MERGE WiMAX support
2011-03-09 22:54:44 -08:00
TK MUN
4bdab1751f DO NOT MERGE WiMAX support
- In Connectivity service, start WiMAX service
- 4G icon display in StatusBarPolicy
- Add DHCP renew
- Add radio for WiMAX

Change-Id: Iffff012b270d80e84ec8fbd4486921a8adb847dd
Signed-off-by: TK MUN <tk.mun@samsung.com>
2011-03-09 22:37:08 -08:00
Ken Sumrall
0da47dae49 Teach the framework to use the new android_reboot() function.
The new android_reboot() function is a nicer way to reboot.
It can optionally sync(2) and remount as read-only writable
filesystems.  This fixes bug 3350709.

Change-Id: I792fa3f726f8d685a696f52cf760e731567ed8d4
2011-03-09 17:37:52 -08:00
Wei-Ta Chen
1f507be1c1 am a2048056: am 2498b4b8: Merge "Fix 3510563: memory leak in BitmapRegionDecoder." into honeycomb-mr1
* commit 'a204805627eddeac0a1777c69ce62d31d339d4cd':
  Fix 3510563: memory leak in BitmapRegionDecoder.
2011-03-09 16:27:25 -08:00
Wei-Ta Chen
2498b4b8c6 Merge "Fix 3510563: memory leak in BitmapRegionDecoder." into honeycomb-mr1 2011-03-09 16:21:53 -08:00
Eric Laurent
18632db49a am 2dc78477: am cc34967f: Merge "Fix issue 3439872: video chat and bluetooth SCO" into honeycomb-mr1
* commit '2dc78477364bd4accb9a603baaafca9a5523dcec':
  Fix issue 3439872: video chat and bluetooth SCO
2011-03-09 11:00:22 -08:00
Carl Shapiro
9b8c5f6143 Merge "Remove unused JNI global references." 2011-03-08 19:49:47 -08:00
Eric Laurent
421ddc014b Fix issue 3439872: video chat and bluetooth SCO
This change fixes the stability problems experienced when using
a bluetooth headset supporting both A2DP and SCO. Problems occur
when starting the video chat at which time the A2DP output is being
stopped to start SCO. At that time, active AudioTracks are invalidated
by AudioFlinger so that a new AudioTrack binder interface can be
recreated by the client process on the new mixer thread with correct parameters.
The problem was that the process to restore the binder interface was not
protected against concurrent requests which caused 2 binder interfaces
to be created sometimes. This could lead to permanent client deadlock
if one of the client threads was waiting for a condition of the first
created binder interface while the second one was created (as the AudioFlinger
would only signal conditions on the last one created).
This concurrent request situation is more likely to happen when a client
uses the JAVA AudioTrack as the JNI implementation uses simultaneously the
native AudioTrack callback and write push mechanisms. By doing so, the code
that checks if the binder interface should be restored (in obtainBuffer()) is
much more likely to be called concurrently from two different threads.

The fix consists in protecting the critical binder interface restore phase
with a flag in the AudioTrack control block. The first thread acting upon the binder
interface restore request will raise the flag and the second thread will just wait for
a condition to be signaled when the restore process is complete.

Also protected all accesses to the AudioTrack control block by a mutex to prevent
access while the track is being destroyed and restored. If a mutex cannot be held
(e.g because we call a callback function), acquire a strong reference on the IAudioTrack
to prevent its destruction while the cblk is being accessed.

Modified AudioTrack JNI to use GetByteArrayElements() instead of
GetPrimitiveArrayCritical() when writing audio buffers. Entering a critical section would
cause the JNI to abort if a mediaserver crash occurs during a write due to the AudioSystem
callback being called during the critical section when media server process restarts.
Anyway with current JNI implementation, either versions do not copy data most of the times
and the criticial version does not guaranty no data copy.

The same modifications have been made to AudioRecord.

Change-Id: Idc5aa711a04c3eee180cdd03f44fe17f3c4dcb52
2011-03-08 16:33:15 -08:00
Chih-Chung Chang
b1a04d5456 Fix 3510563: memory leak in BitmapRegionDecoder.
Change-Id: If639d5974204f18fdfd119b9fc7a762977c66f26
2011-03-08 18:47:23 +08:00
Romain Guy
f7098ce95d am d00353fe: am bc8a8e8c: Merge "Add support for partial invalidates in WebView Bug #3461349" into honeycomb-mr1
* commit 'd00353fe3191571a6773ef2d11921cfcff260bc4':
  Add support for partial invalidates in WebView Bug #3461349
2011-03-07 22:45:52 -08:00
Romain Guy
5f4b02064d am f018560c: am 25b81110: Merge "Fix EGL JNI bugs Bug #3461349" into honeycomb-mr1
* commit 'f018560cb57e47c3e4bc542e4c596c4d3be3d4c4':
  Fix EGL JNI bugs Bug #3461349
2011-03-07 18:16:05 -08:00
Romain Guy
cabfcc1364 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
Romain Guy
9b7146db6d Fix EGL JNI bugs
Bug #3461349

Before this change, eglGetCurrent*() could not be used to compare
contexts, displays and surfaces at the Dalvik level.

Change-Id: I442037dae37bc357b64810ab10c779b5754e9153
2011-03-07 18:05:04 -08:00
Carl Shapiro
17cc33a357 Remove unused JNI global references.
Change-Id: Ie4886ab66538e293832c3bc3d6023e34304a2d21
2011-03-05 20:53:16 -08:00
Mike Cleron
7e0907ce3e am 646528c6: am 54bb9869: Merge "Don\'t fail unlinking death recipients on dead binders" into honeycomb-mr1
* commit '646528c6cff69433d58d01728ada12fd2a50cf84':
  Don't fail unlinking death recipients on dead binders
2011-03-04 18:02:41 -08:00
Christopher Tate
79dd31f73d Don't fail unlinking death recipients on dead binders
It's legal to call unlinkToDeath() *after* receiving binderDied(),
as long as the recipient being unlinked was in fact linked
previously.  Don't throw an exception in this case.  (The
exception was going unhandled in the system process, bringing
down the runtime.  That's bad.)

The change here is a bit subtle.  In the new implementation, the
lifetime of a JavaDeathRecipient -- the fundamental bridge between
IBinder objects and the Dalvik/JNI world -- is tied to the
lifetime of the Dalvik-side BinderProxy object it's associated
with.  That means it's inappropriate for the JavaDeathRecipient
to disappear [for purposes of being referenced from the Dalvik
side] just because the IBinder has sent out its obituaries, and
instead the JavaDeathRecipient objects are kept around until
the Dalvik-side client code actually drops its reference to the
BinderProxy.

This boils down to a one-line change:  we no longer unpin the
JavaDeathRecipients and free them immediately in response to
binderDied().

The rest of the CL is #ifdefed-out debugging that is invaluable
when bugs crop up.

Bug 3513703

Change-Id: I743fa49669c9252f71dcabfd8dcf42ed729b70a5
2011-03-04 17:45:00 -08:00
Glenn Kasten
846db33313 Bug 3515073 Add ANativeWindow_fromSurfaceTexture
This is similar to ANativeWindow_fromSurface.

Change-Id: Iaadc06a5d0d50685c34876aa89488c16e7cfaa65
2011-03-04 16:39:29 -08:00
Leon Scroggins
13492c848f Add ifdef to prevent header being added multiple times.
Change-Id: I92bb0667bea98e43fca20dceb4fff20e446c03cf
2011-03-04 13:54:35 -05:00
Carl Shapiro
332abc3055 Merge "Fix a compare of JNI references to use IsSameObject." 2011-03-03 17:17:43 -08:00
Carl Shapiro
375aa0b09b Fix a compare of JNI references to use IsSameObject.
Change-Id: I9932761271034ff5031730874daf7c147b6b008a
2011-03-03 17:00:38 -08:00
Carl Shapiro
d54952b451 Merge "Establish a global reference before saving a class into a global." 2011-03-03 14:44:50 -08:00
Carl Shapiro
c1318babb4 Establish a global reference before saving a class into a global.
A local reference is obtained to the string class for the purpose of
using it later in another routine to create string object arrays.
However, the local reference is invalid by the time it is next used.
Making the string class reference a global reference eliminates the
problem.

Change-Id: I8a04642e0ed3060f2fff2cb63996559f004aacff
2011-03-03 14:22:28 -08:00
Carl Shapiro
6c3fd82107 Merge "Eliminate an assignment of a local reference to a global variable." 2011-03-03 14:13:09 -08:00
Carl Shapiro
b16f769277 Eliminate an assignment of a local reference to a global variable.
Change-Id: I8850685698d228658387afe6145e42ade0458e74
2011-03-03 14:04:59 -08:00
Fabrice Di Meglio
1eb1293732 Merge "Add TextLayout Cache" 2011-03-03 12:21:15 -08:00
Leon Scroggins
b80cb0c5d4 Merge "Move NinePatchPeeker into its own file." 2011-03-03 09:13:22 -08:00
Leon Scroggins
a06d86ab81 Move NinePatchPeeker into its own file.
This way it can be used by other clients that want to draw
ninepatches.  Ultimately the goal is to allow ninepatch
drawing from native code for WebView.  Bug:3009375

Change-Id: Id13cef17ed7655a07e9f055586b686cf1e4af392
2011-03-03 11:40:39 -05:00
Jeff Brown
56194ebec6 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
Fabrice Di Meglio
d313c665e6 Add TextLayout Cache
- use GenerationCache for caching
- move GenerationCache.h from libs/hwui/utils to include/utils
- add #define for cache activation / deactivation

Change-Id: Ifaf519f0b5e33b087a453e4aa6430162d8438f20
2011-03-02 13:29:20 -08:00