1566 Commits

Author SHA1 Message Date
Jeff Brown
b695741330 Merge "Fix JNI leak in copyStringToBuffer Bug: 5244396" 2011-08-31 16:55:08 -07:00
Jeff Brown
f786b6ca5d Fix JNI leak in copyStringToBuffer
Bug: 5244396

Code was acquiring the char array twice for FIELD_TYPE_INTEGER
or FIELD_TYPE_FLOAT but only releasing it once.

Removed the redundant calls to GetCharArrayElements.

Change-Id: If767d3295d5a663a823e5ca0cd979379a3ccd024
2011-08-31 16:09:24 -07:00
Jeff Brown
9d4bc852ea Merge "Fix input channel leak. Bug: 5156144" 2011-08-31 13:01:16 -07:00
Jeff Brown
cc4f7db698 Fix input channel leak.
Bug: 5156144

Input channels could leak or simply live longer than they should
in some cases.

1. Monitor channels (used by the pointer location overlay) are never
   unregistered, so they would leak.

   Added code to handle failures in the receive callback by closing
   the input channel.

2. The DragState held onto its input window and application handles
   even after the input channel was disposed.

   Added code to null these handles out when they are no longer needed.

3. Input channels previously used as input event targets would stick
   around until the targets were cleared (usually on the next
   event).

   Added code to detect when the input dispatcher is in
   an idle state and to proactively clear the targets then
   to ensure that resources are released promptly.

4. Native input window handles held onto the input channel even
   after the input window was removed from the input dispatcher.
   Consequently, the input channel would not be disposed until
   the input window handle itself was freed.  Since the input
   window handle is held from managed code, this meant that the
   window's input channel could stick around until the next GC.

   Refactored the input window handle to separate the properties
   (info) and identify (handle) state into different objects.
   Then modified the dispatcher to release the properties (info)
   when no longer needed, including the input channel.

7. The pointer location overlay does not actually use its
   standard input channel, only the monitor input channel.

   Added INPUT_FEATURE_NO_INPUT_CHANNEL to allow windows to
   request that they not be provided with an input channel
   at all.

Improved some of the error handling logic to emit the status
code as part of the exception message.

Change-Id: I01988d4391a70c6678c8b0e936ca051af680b1a5
2011-08-30 21:40:28 -07:00
Mathias Agopian
c21843a8b5 Merge "fix Surface positions are not floats" 2011-08-30 19:24:04 -07:00
Mathias Agopian
34cb9f2a96 fix Surface positions are not floats
Added Surface.setPosition(float, float) which allows to set a surface's
position in float.

Bug: 5239859
Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
2011-08-30 18:51:54 -07:00
Christopher Tate
0d4a792e8d Fix JNI for warning about failure to unlink DeathRecipients
We now (a) use the right Class getName() method, and (b) look it
up once at setup time rather than doing that lookup every time we
want to emit the warning.  Verified to work properly and no longer
crash or throw or otherwise complain.

Change-Id: If0767f8845588ba7f34bac21474f4e2ad5c111d6
2011-08-30 14:06:20 -07:00
Irfan Sheriff
335e40c0f1 Merge "Use seperate config file for p2p" 2011-08-29 15:22:58 -07:00
Irfan Sheriff
f42c39b3d1 Use seperate config file for p2p
Keep p2p and sta config seperate to avoid conflicts.

Bug: 5002384
Change-Id: I8f8fc5f984f4f91f9ece4012bf536daa5cc00bba
2011-08-26 14:45:23 -07:00
Christopher Tate
ac5e350e56 Warn if we're tearing down "live" DeathRecipient content [take 2]
If the native-side bookkeeping still has strong references to VM-side
DeathRecipient objects at the time when it's being torn down, that
suggests that the app is doing unwholesome.  Log a warning to that
effect, with the class name of the objects to try to help the developer
figure out what they're mishandling.

Fixes bug 5202777 -- in particular, it no longer logs in the
working-as-intended case following delivery of the death notices,
when we've got the existing list shell but the weak refs have properly
cleared.  Also step down from "error" to "warning" logging as befits
the nature of the actual situation now being described.

This new patch fixes the JNI bug present in the earlier version.

Change-Id: I095862777a8d0e3905cb7f416af658878280041d
2011-08-26 14:34:21 -07:00
Romain Guy
189887e0ae Implement saveLayer*() correctly
When the Rect parameter is null, the layer's bounds must match the
clip rect.

Change-Id: Idbb3973af039bf319e840d1095b7037bf1015f35
2011-08-25 11:45:13 -07:00
Christopher Tate
2611f89ab4 Warn only if we're tearing down "live" DeathRecipient content
If the native-side bookkeeping still has strong references to VM-side
DeathRecipient objects at the time when it's being torn down, that
suggests that the app is doing unwholesome.  Log a warning to that
effect, with the class name of the objects to try to help the developer
figure out what they're mishandling.

Fixes bug 5202777 -- in particular, it no longer logs in the
working-as-intended case following delivery of the death notices,
when we've got the existing list shell but the weak refs have properly
cleared.  Also step down from "error" to "warning" logging as befits
the nature of the actual situation now being described.

Change-Id: Ic393560824800fbd912a6e69692c65be4fcc7544
2011-08-23 16:26:57 -07:00
Jaikumar Ganesh
110be0f1d9 Merge "Listen to the right Bluez signal for Channel deletion." 2011-08-22 10:31:15 -07:00
Jaikumar Ganesh
ae37d06dd0 Listen to the right Bluez signal for Channel deletion.
Health device channel deletion was looking at the
wrong dbus interface.

Reported by: Sungjun<sj222.choi@samsung.com>

Change-Id: I48e7c464fdcdd8bd47dc8cc9cd55b14ba8ea6bbf
2011-08-21 20:24:57 -07:00
Fabrice Di Meglio
067bb3b443 Merge "Update TextLayout logging" 2011-08-19 14:39:15 -07:00
Fabrice Di Meglio
abb0f299fd Update TextLayout logging
- centralize logging into TextLayoutCache
- add offset logging

Change-Id: I52f229b2a8aed121715b37a5a42936875b23f3c9
2011-08-18 17:59:29 -07:00
Christopher Tate
eeb2214213 Merge "Stop leaking DeathRecipient and BinderProxy instances" 2011-08-18 17:19:53 -07:00
Christopher Tate
86284c60b5 Stop leaking DeathRecipient and BinderProxy instances
The native-side death recipient object holds a global reference
to the DVM-side DeathRecipient instance.  This is necessary so
that the DeathRecipient isn't GC'd early in the case when the
caller of linkToDeath() doesn't retain their own reference to
the recipient instance.

However, that global reference was never being released in
association with the delivery of the actual binderDied() event.
In that case, if the death recipient did not explicitly call
unlinkToDeath() themselves, the hard global reference was
maintained and a hard-reference cycle was perpetuated, crossing
the native <-> DVM boundary.  This was visible as a gradual
leakage of DVM-side DeathRecipient and BinderProxy instances.

The one problematic constraint is that it needs to be valid to
call unlinkToDeath() cleanly *after* binderDied() is delivered
to the given recipient; that requires that we have the hard reference
linkage described above.  The fix is to replace the hard global
reference with a weak reference to the DVM-side DeathRecipient
after we deliver binderDied() to that recipient.  In the case
where the caller has retained their own reference to the instance
(i.e. they might still call unlinkToDeath() on it later), the
weak reference stays live and everything works cleanly (and is
reaped explicitly by unlinkToDeath() as usual).  In the case where
the caller has *not* retained the instance to call unlinkToDeath()
themselves, demoting to a weak DeathRecipient reference allows
the DeathRecipient to be GC'd, which in turn frees the DVM-side
BinderProxy it's tied to, and so on around the chain to free
all of the associated allocations.

Fixes bug 5174537

Change-Id: Ia4ad76e667140cc2a1b74508bbba652ab31ab876
2011-08-18 17:06:31 -07:00
Jaikumar Ganesh
5293bfa57a am 294539df: am 3e941347: am 6f6b21b4: am 4733d3a6: Merge "Bluetooth event loop dispatches dbus data on wakeup"
* commit '294539df2c05eb62c417e25b2e1c8a71474b09e6':
  Bluetooth event loop dispatches dbus data on wakeup
2011-08-18 12:13:30 -07:00
Jaikumar Ganesh
294539df2c am 3e941347: am 6f6b21b4: am 4733d3a6: Merge "Bluetooth event loop dispatches dbus data on wakeup"
* commit '3e9413473f87ad17f3767ffbb0c57046c2db29be':
  Bluetooth event loop dispatches dbus data on wakeup
2011-08-18 12:10:02 -07:00
Fabrice Di Meglio
c5f7a851b3 Merge "Fix bug #5174495 Harfbuzz shaping is broken after taking care of Indic" 2011-08-16 17:35:06 -07:00
Fabrice Di Meglio
5960723061 Fix bug #5174495 Harfbuzz shaping is broken after taking care of Indic
- revert back to old working code where the script was setup for Harfbuzz\
depending of the direction of the run

Change-Id: I7ec740732b51ccf05b6744b7f9d2fcb35555478d
2011-08-16 17:14:20 -07:00
Romain Guy
302a9df1d5 Add an API to set the transform on a TextureView's surface texture.
Bug #5156689

Change-Id: I635a625885c9b832a60d44ece0de7613ceb84109
2011-08-16 13:55:02 -07:00
Albert Mojir
f4c6404f50 Bluetooth event loop dispatches dbus data on wakeup
On some occasions when the event loop thread and a binder thread are
both waiting for a message from dbus, both threads are not woken up
when a message is received. This causes applications not receiving
responses or events. This happens because both threads are listening
to same socket and both threads are not guaranteed to wake up when
there is data to read. To fix this we subscribe to callback to wake
the eventloop when an message is added to incoming queue.

To reproduce the issue:
1. Activate BT
2. Make phone Discoverable
3. Clock is ticking down from 120s
4. At 20s tap the setting again
5. Crash due to keyDispatchingTimedOut
6. Not possible to scan for other devices or making your phone discoverable again
7. Restart necessary

Tell tale sign:
07-25 16:37:12.240 E/ActivityManager( 262): ANR in com.android.settings
    (com.android.settings/.bluetooth.BluetoothSettings)
07-25 16:37:12.240 E/ActivityManager( 262): Reason: keyDispatchingTimedOut

Test case to verify this patch:
android.bluetooth.BluetoothStressTest#testDiscoverable

Change-Id: I7696b5722805e85cd0204ce2597e91594cbe6789
2011-08-16 12:26:13 +02:00
Elliott Hughes
be414332a1 Fix android.text.format.Time to use GetBooleanField on its boolean field.
Bug: 5162851
Change-Id: I49b1429e86ffa91fbfb8b4c9d1a0c6d30c72621e
2011-08-14 13:31:03 -07:00
Dianne Hackborn
f43fa5746e Turn off hinting by default for higher density displays.
Also adds an API for apps to control whether hinting is used.

Change-Id: I1a06b06255fbb8d0f02a8ce48c2cd60019088ed3
2011-08-12 18:59:39 -07:00
Ted Bonkenburg
1ee60119c4 Remove ParcelSurfaceTexture and update MediaPlayer
This removes the ParcelSurfaceTexture class since that functionality has been
folded into Surface.java. The change also updates the MediaPlayer to get rid
of setParcelSurfaceTexture() and modifies setTexture() to use the new Surface
functionality in order to simplify the code.

Change-Id: Iafa75ea3188263928128325d8a726786971b4de4
2011-08-11 19:58:25 -07:00
Romain Guy
03f156e96f Merge "Remove unnecessary private API" 2011-08-11 17:51:23 -07:00
Romain Guy
9d865512f1 Remove unnecessary private API
Change-Id: I2ecb367528ec0691c07153a3d163b82a6ca33fdf
2011-08-11 17:37:02 -07:00
Jaikumar Ganesh
aae7a3d1fb Merge "Bluetooth : fix for bluetooth turning on issue.(limit: 64times)" 2011-08-10 10:10:49 -07:00
hyungseoung.yoo
5ec09727f4 Bluetooth : fix for bluetooth turning on issue.(limit: 64times)
Bluetooth fails to turn on after 64 iterations.

When setUpEventLoop is called, Adapter is not ready yet.
However, we have already added the Dbus match rules. These match
rules are not deleted and we hit the dbus limit.

Change-Id: If207d4d33574685520a852b53a641adfbeb45d43
Author: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
2011-08-10 10:03:48 -07:00
Fabrice Di Meglio
5de5b1a91e Fix Harbuzz shaper for being able to do select other scripts than Common or Arabic
- need to take care of diacritics marks that return HB_Script_Inherited for a script

Change-Id: Icbfea46b305e15849b25410fed07d9cd5dfeb818
2011-08-09 14:37:22 -07:00
Fabrice Di Meglio
6ab90ed017 Solidify and optimize Paint text related APIs
- better check parameters consistency
- return calls as soon as possible (when null or empty text)

Change-Id: I46744e517b04e3fba0ec37132d7de400177f214b
2011-08-08 18:52:27 -07:00
Fabrice Di Meglio
f957618265 Merge "Revert "Adapt TextLayoutCache for new Harfbuzz scripts"" 2011-08-08 12:56:05 -07:00
Fabrice Di Meglio
f09e46e938 Revert "Adapt TextLayoutCache for new Harfbuzz scripts"
This reverts commit 7f4ae758ba4724f7c3031d33ad8e749c11d1e059

This CL created a regression:

#5134317 Arabic Keyboard does not appear
2011-08-08 11:31:39 -07:00
Dianne Hackborn
b437e090ec Improved memory use reporting.
Change-Id: I38e53e6228bba92a142bafeedb5af8df4e4e5724
2011-08-05 18:18:05 -07:00
Russell Brenner
adc25267f8 Merge "Adapt TextLayoutCache for new Harfbuzz scripts" 2011-08-04 09:41:53 -07:00
Mathias Agopian
452f035c31 Merge changes I689cb0c0,I09603218
* changes:
  Add a 'release' method to the SurfaceTexture public Java API
  Mark Window-Manager-specific APIs on android.view.Surface as @hide
2011-08-03 18:12:36 -07:00
Mathias Agopian
ec46b4e1ca Add a 'release' method to the SurfaceTexture public Java API
Bug: 5063618
Change-Id: I689cb0c01c14e597ccfb4eb0972e64fa570bd4e8
2011-08-03 17:23:44 -07:00
Kenny Root
1ebd74acf9 Better error codes for missing files
Make sure that files that don't exist aren't returning bogus 'out of
space' error codes.

Add some Javadoc so I can remember what each thing does in an IDE.

Add copyright header to NativeLibraryHelper

Bug: 3375299
Change-Id: Iac46019160921daca65b21d38897e5165063316e
2011-08-03 16:03:42 -07:00
Russell Brenner
7f4ae758ba Adapt TextLayoutCache for new Harfbuzz scripts
The Harfbuzz script setting was wired to HB_Script_Common for left-
to-right text and HB_Script_Arabic for right-to-left. This change
selects from additional scripts using some utility APIs from
Harfbuzz.

Change-Id: I34a6f1e0407c8d122bc968443948e7863d1f91ed
2011-08-03 11:56:27 -07:00
Derek Sollenberger
4f7c380d51 Merge "Reverting until we can find a better way to address this issue without affecting nine-patches with large stretchable areas." 2011-08-02 10:39:43 -07:00
Derek Sollenberger
09a22e33e7 Reverting until we can find a better way to address this issue without affecting nine-patches with large stretchable areas.
Revert "Fix NinePatch decoder when the target is smaller than the source."

This reverts commit c4c458c678567b899aae04631570460c5e729512
2011-08-02 05:17:49 -07:00
Wu-cheng Li
bb1e275c0e Pass camera frame metadata from camera service to Java.
bug:4460717
Change-Id: I2fae6e1dfca6b8f3a5ee5716fc7817f5417bf657
2011-08-02 15:48:41 +08:00
Jeff Brown
2a2ec87b55 Merge "Refactor input reader to add stylus support. Bug: 5064702" 2011-08-01 17:48:21 -07:00
Romain Guy
0965a3244b Allow Canvas.setBitmap() to receive a null Bitmap.
Change-Id: I6096f0b44866e532ccd96a29c816bf34d48c1dc2
2011-08-01 17:39:21 -07:00
Matthew Xie
569980c349 Merge "Change setDevicePropertyNative to no block." 2011-08-01 10:20:30 -07:00
Jeff Brown
be1aa8250c Refactor input reader to add stylus support.
Bug: 5064702

Introduced the concept of an InputListener to further decouple
the InputReader from the InputDispatcher.  The InputListener
exposes just the minimum interface that the InputReader needs
to communicate with the outside world.  The InputReader
passes arguments to the InputListener by reference, which makes
it easy to queue them up.

Consolidated all of the InputReader locks into one simple global
Mutex.  The reason this wasn't done before was due to potential
re-entrance in outbound calls to the InputDispatcher.  To fix this,
the InputReader now queues up all of the events it wants to send
using a QueuedInputListener, then flushes them outside of the
critical section after all of the event processing is finished.
Removing all of the InputMapper locks greatly simplifies the
implementation.

Added tests for new stylus features such as buttons, tool types,
and hovering.

Added some helpers to BitSet32 to handle common code patterns
like finding the first marked bit and clearing it.

Fixed a bug in VelocityTracker where the wrong pointer trace
could get cleared when handling ACTION_POINTER_DOWN.  Oops.

Changed PointerCoords so it no longer stores useless zero
axis values.  Removed editAxisValue because it is not very
useful when all zero value axes are absent and therefore
cannot be edited in place.

Added dispatch of stylus hover events.

Added support for distance and tool types.

Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
2011-07-31 15:38:09 -07:00
Matthew Xie
3fd36737b3 Change setDevicePropertyNative to no block.
Change setDevicePropertyNative to use async dbus call to bluez instead of
blocking call. The old call was dbus_connection_send_with_reply_and_block.
It is replaced by dbus_connection_send_with_reply.

Change-Id: I1a772b33b54c8aad71a6f4d86dcd289354d8155b
2011-07-29 15:08:41 -07:00
Derek Sollenberger
f4fd53b381 Merge "Fix NinePatch decoder when the target is smaller than the source." 2011-07-29 10:41:12 -07:00