1552 Commits

Author SHA1 Message Date
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
Nick Pelly
5ff1c1591f Merge "Workaround for bug 5082381 (EALREADY on ACL collision)." 2011-07-29 09:44:30 -07:00
Derek Sollenberger
c4c458c678 Fix NinePatch decoder when the target is smaller than the source.
If the target is smaller on a given axis than the source then we
just draw a downscaled version of the NinePatch.  If we use the
current path and the source has transparency then areas of the
NinePatch overlap and are blended together resulting in visual
inconsistancy.

bug: 5041053
Change-Id: I0fcc6fb5c214b188a164acf0651aa4ab2f35946d
2011-07-29 10:34:47 -04:00
Nick Pelly
fbbea2e1bf Workaround for bug 5082381 (EALREADY on ACL collision).
If connect() fails with EALREADY, then retry.

Unfortunately we also need to switch to a new FD. This is currently
safe, but its a little fragile to changes in the code (especially
if we ever expose the fd to applications) so it would be great to
fix this issue properly in the kernel sometime and revert this
commit.

Change-Id: I12fb6b7f2b8ca40f425f66b504754048c9460329
2011-07-28 18:11:34 -07:00
Matthew Xie
6903a7de88 Merge "Provide an API to set the friendly name of a remote device." 2011-07-28 17:46:45 -07:00
Wu-cheng Li
f0d6a48c6a Add frame metadata parameter to camera data_callback.
bug:4460717
Change-Id: Ib47d7d7df20af8155a719f3dabefe030893bfebc
2011-07-29 07:14:38 +08:00
Matthew Xie
269e81a563 Provide an API to set the friendly name of a remote device.
BluetoothDevice setName overwrite the locally cached remote name.
The changed name is saved in the local storage so that the change
is preserved over power cycle.
bug 5081605
Change-Id: I486966033828d153bfb1076a99e274c8a7f41636
2011-07-28 15:56:11 -07:00
Jeff Brown
d5d7e164d3 Support wrapping app processes to inject debug instrumentation.
Bug: 4437846

Change-Id: Ib0559e5224b0fa0df074e485787307b6634e8654
2011-07-28 14:00:27 -07:00
Romain Guy
b6f7a27c59 Merge "Reclaim more memory, more often." 2011-07-27 18:53:32 -07:00
Romain Guy
65b345fa22 Reclaim more memory, more often.
Yay.

Change-Id: I04557ad575c307a55088549f48f0e9ad994b7275
2011-07-27 18:51:50 -07:00
Kenny Root
4f35092af5 Merge "Move extract native libraries to JNI code" 2011-07-27 15:54:51 -07:00
Jeff Brown
3d5a703db8 Merge "Report the external display size to the input reader." 2011-07-27 15:54:50 -07:00
Wu-cheng Li
4c2292efbb Add camera face detection API.
API are still hidden.

bug:4460717
Change-Id: I1a515061f141a89bd61c875257712789fb15d2d4
2011-07-27 05:25:35 +08:00
Kenny Root
66269ea6f6 Move extract native libraries to JNI code
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.

Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.

Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
2011-07-26 10:14:58 -07:00
Jean-Michel Trivi
af20eacc21 Merge "Fix bug 4319552 Java to native channel mask translation" 2011-07-26 09:27:53 -07:00