1581 Commits

Author SHA1 Message Date
Fabrice Di Meglio
e0d558ac92 Merge "Fix potential leak in TextLayouCache" 2011-09-19 11:41:01 -07:00
Fabrice Di Meglio
54dc642cc1 Make TextLayoutCache no more dependent on ICU
- move ICU call to TextLayout

Change-Id: Id5a21e7b69e484536cfb5b86fbb0c112fb661dfa
2011-09-18 15:38:08 -07:00
Fabrice Di Meglio
e74fef3b55 Fix potential leak in TextLayouCache
- need a copy constructor for the key as the GenerationCache we are using
is actually a KeyedVector<K, sp<Entry<K, V> > >
- use the getText() API to access the text in the cache key

Change-Id: I5b60ebc062b62308ed7ac1284cfe2a9f28e2b8b1
2011-09-18 14:30:21 -07:00
Fabrice Di Meglio
9c418dbc56 Revert "Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits"
This reverts commit d686d76814f18061e06995df0d5de9feb9f70a7e
2011-09-18 12:54:38 -07:00
Fabrice Di Meglio
d686d76814 Fix bug #5332081 TextLayoutCache needs to be able to have more cache hits
- makes TextLayoutCache not carring about start/count. Basically he will cache the result for
the full string and gives back the "chunk" corresponding to start/count
- changed the TextLayoutCacheValue API to take start/count parameters
- added the Harfbuzz LogClusters in TextLayoutCacheValue as it is needed for extracting the start/count "chunk"
- fix potential issue of cache key leaking

Change-Id: I9276f9bec744e8de36349acfba8429f7c6f83394
2011-09-16 13:47:34 -07:00
JP Abgrall
98a4f7e7e1 NetworkManagement SocketTagger: Migrate QTagUid support to JNI.
* Instead of javaland trying to write commands to
   /proc/net/xt_qtaguid/ctrl
use the libcutils/qtaguid.c support via JNI.
* Get rid of tagToKernel() handled by qtaguid library.

Requires libcutils changes from c/132538/

Change-Id: I9de5b3fa4a596c56835024c6d376769a0eea7db1
2011-09-15 02:29:03 -07:00
Jeff Brown
93578af23e Merge "Velocity Tracker II: The Revenge of Velocity Tracker Bug: 5265529" 2011-09-14 21:27:25 -07:00
Dianne Hackborn
ec537457cd Fix issue #5155678: Portrait > Landscape full-screen transition...
...mode cuts off screen rendering

The code for limiting application window sizes to not include the
navigation bar was dead.  Now it is back.

Change-Id: Ic0bde56e3300fd0d9d225e19d8de2766d07e8780
2011-09-14 19:19:55 -07:00
Jeff Brown
b59ab9f41f Velocity Tracker II: The Revenge of Velocity Tracker
Bug: 5265529

Rewrote the velocity tracker to fit a polynomial curve
to pointer movements using least squares linear regression.
The velocity is simply the first derivative of this polynomial.

Clients can also obtain an Estimator that describes the
complete terms of the estimating polynomial including
the coefficient of determination which provides a measure
of the quality of the fit (confidence).

Enhanced PointerLocation to display the movement curve predicted
by the estimator in addition to the velocity vector.

By default, the algorithm computes a 2nd degree (quadratic)
polynomial based on a 100ms recent history horizon.

Change-Id: Id377bef44117fce68fee2c41f90134ce3224d3a1
2011-09-14 19:16:37 -07:00
Fabrice Di Meglio
4444573060 Merge "Fix some TextLayoutCache issues" 2011-09-14 11:05:04 -07:00
Fabrice Di Meglio
51f383d65f Fix some TextLayoutCache issues
- wrong ContextCount was passed
- better logs

Change-Id: Ie78ba70f98f3cf017c168ab8848cc080fc175f31
2011-09-13 15:57:58 -07:00
Matthew Xie
62f7c9737f Fix a compile error when debug is turned on
logv uses a variable that is declared after its use

Change-Id: Id5c09698e4a0a91befa3ce2f60ce02ec28733889
2011-09-12 18:25:31 -07:00
Jaikumar Ganesh
b5d2d4526c Add error codes for channel disconnection / connection.
Channel connection / disconnection was handled as boolean,
doesn't capture all the values. Also make it asynchronous
instead of the dbus call being synchronous.

Change-Id: If30177b9f93b7c83f162fbbc1233edf3e46dbfea
2011-09-08 15:26:53 -07:00
Jaikumar Ganesh
eb9d34630f Make Bluetooth Health APIs public.
Fix a few bugs:
  a) Pass a integer token to identify the channel.
  b) Close fds in case of errors.

Change-Id: I2046787be5008769435f2f72a5bd67c19b749da0
2011-09-08 15:17:17 -07:00
Fabrice Di Meglio
163268b3a8 Fix bug #5274332 TextLayoutCache is having multiple instances
- also fix the missing LOG_TAG define

Change-Id: I25e96d1ba372e84768604f18702e0724fdecefb0
2011-09-07 18:25:58 -07:00
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