Commit Graph

43322 Commits

Author SHA1 Message Date
Anish Athalye
c8f9e62186 Implement line breaking in native code
The main purpose for this change is to prepare for adding support for
alternative line breaking algorithms (such as optimal line breaking).

The existing implementation of line breaking was intertwined with
measurement, so it wasn't structured in a way such that other line
breaking algorithms could be easily added. In addition to this,
algorithms (such as optimal line breaking) are usually fairly complex
and computation-intensive, so it is advantageous to implement them in
native code.

This has several other advantages:

    * Unlike the Java code in the previous version of generate(), this
      implementation separates line breaking from measurement. This
      makes it easier to understand and modify the line breaking process
      without affecting measurement (and vice versa).

    * This native implementation of greedy line breaking is identical to
      the Java version in terms of functionality, and it is similar in
      terms of performance, depending on the use case. The performance
      gains from this change are not significant due to increased JNI
      overhead. However, this change is a step in the right direction in
      terms of increasing performance. Once more code moves to C++,
      there will be fewer JNI crossings per layout call and less data
      will be passed from Java to C++, resulting in better performance.

This change moves line breaking from Java to native C++ code. Inspired
by the "Breaking Paragraphs into Lines" paper by Knuth and Plass (1981),
we express the line breaking problem in terms of 'box', 'glue', and
'penalty' primitives, along with a few others. Our implementation
differs in a couple ways:

    * We do not want to clip text when words are wider than the view, so
      we add a new primitive type to represent break opportunities
      between letters. These breaks are avoided whenever possible, but
      when single words do not fit on lines by themselves, they can be
      broken so the entire word is visible.

    * We have to support tab characters, along with user*specified tab
      stops, so we add a new primitive type for that purpose.

    * We are left*aligning text, and so we are not using shrinking /
      stretching glue.

    * We do not support hypenation, so we do not use penalties that have
      widths.

Change-Id: Ia22d1d1275ef26ff3d7b41ee2658e4db525a0305
2014-08-18 12:25:16 -07:00
Adrian Roos
1bd5a220e7 am 04935e46: am 2ff048ff: am a31e2348: Play "device trusted" sound when onTrustInitiatedByUser fires
* commit '04935e46cbbc298e930e5c10450a4118861a1b77':
  Play "device trusted" sound when onTrustInitiatedByUser fires
2014-08-18 17:21:02 +00:00
Adrian Roos
48986869c3 am 2ff048ff: am a31e2348: Play "device trusted" sound when onTrustInitiatedByUser fires
* commit '2ff048ff5587e029e83e17fdfdecaa3fa0fd70c2':
  Play "device trusted" sound when onTrustInitiatedByUser fires
2014-08-18 17:14:52 +00:00
Adrian Roos
49e057d7ee Play "device trusted" sound when onTrustInitiatedByUser fires
Bug: 16840500
Change-Id: I73fbe5c2cff665ccb637abb9039d57f377d9df53
2014-08-18 16:53:27 +00:00
John Reck
931d0d073c am 41f5d936: am 98270e20: am 976189a1: Merge "Don\'t mangle layer paint\'s alpha" into lmp-dev
* commit '41f5d93635d91e309eb49dbd8973ff8593e66529':
  Don't mangle layer paint's alpha
2014-08-18 16:28:47 +00:00
John Reck
30bb86629a am 98270e20: am 976189a1: Merge "Don\'t mangle layer paint\'s alpha" into lmp-dev
* commit '98270e20063bd6446c088335c957bb5062ba5cf1':
  Don't mangle layer paint's alpha
2014-08-18 16:21:34 +00:00
Jason Monk
45c3597975 resolved conflicts for merge of 8e6b5343 to master
Change-Id: Iece54064b2667b45febd0bffbf602be0fe58ae6d
2014-08-18 11:05:17 -04:00
Jason Monk
d6ea61cd15 am 75391416: am 71793e71: Merge "Fixes to lock task API from API review" into lmp-dev
* commit '75391416fe284946f41cfa39799f7e580975fbbf':
  Fixes to lock task API from API review
2014-08-18 13:51:09 +00:00
Jinsuk Kim
ac33c6cb56 am 28920008: am c68c9dbd: am 47a91229: Merge "CEC: Replace the usage of logical address with id for HdmiDeviceInfo" into lmp-dev
* commit '28920008ff3835c8febcad58f638530ec6253112':
  CEC: Replace the usage of logical address with id for HdmiDeviceInfo
2014-08-18 04:06:25 +00:00
Michael Wright
f3cb197028 am 9ded8208: am 1a63d067: am ab1b372c: Merge "Change \'disable hardware keyboard\' to \'show input method\'" into lmp-dev
* commit '9ded8208c438eca14d3ed8ad16b819f6688f1267':
  Change 'disable hardware keyboard' to 'show input method'
2014-08-18 03:40:37 +00:00
Jinsuk Kim
b347ed75cd am c68c9dbd: am 47a91229: Merge "CEC: Replace the usage of logical address with id for HdmiDeviceInfo" into lmp-dev
* commit 'c68c9dbdd5b1e70a429ff2283348a5609522d8cb':
  CEC: Replace the usage of logical address with id for HdmiDeviceInfo
2014-08-18 02:37:42 +00:00
Michael Wright
9c64c18b10 am 1a63d067: am ab1b372c: Merge "Change \'disable hardware keyboard\' to \'show input method\'" into lmp-dev
* commit '1a63d067582aa909b48832faefac7f97ab4825f1':
  Change 'disable hardware keyboard' to 'show input method'
2014-08-18 02:10:24 +00:00
Robert Greenwalt
2c8a41fba5 am f8f559f5: am 316c9421: am c993be52: Add tcp buffer size conduit to NetworkAgent.
* commit 'f8f559f5234a8ae0596ecce7814e66a1948d3c2e':
  Add tcp buffer size conduit to NetworkAgent.
2014-08-17 23:30:35 +00:00
Robert Greenwalt
bbca13351a am 316c9421: am c993be52: Add tcp buffer size conduit to NetworkAgent.
* commit '316c9421eda732bd510631acd9384b593f37f027':
  Add tcp buffer size conduit to NetworkAgent.
2014-08-17 23:22:32 +00:00
Robert Greenwalt
3f05bf4d78 Add tcp buffer size conduit to NetworkAgent.
bug: 16549611
Change-Id: I7d97dedea2c7c1aed2eccb185645889424508591
2014-08-17 15:14:29 -07:00
Dianne Hackborn
314b29a70c am b8496b22: am 7da20cdf: am 83249fc9: Merge "Make sure we initialize to enable the default voice interaction service." into lmp-dev
* commit 'b8496b223a714b8bc6233f17562d13360063d257':
  Make sure we initialize to enable the default voice interaction service.
2014-08-16 19:17:14 +00:00
Dianne Hackborn
28bb0b8ff3 am 7da20cdf: am 83249fc9: Merge "Make sure we initialize to enable the default voice interaction service." into lmp-dev
* commit '7da20cdf3c36162ab02790dc99a8c7592e86a015':
  Make sure we initialize to enable the default voice interaction service.
2014-08-16 19:09:39 +00:00
Jason Monk
95d9ad0f79 Merge "Fixes to lock task API from API review" into lmp-dev 2014-08-16 04:32:18 +00:00
Dianne Hackborn
90f58b4447 Merge "Make sure we initialize to enable the default voice interaction service." into lmp-dev 2014-08-16 04:29:45 +00:00
Jinsuk Kim
98f4c16a7b Merge "CEC: Replace the usage of logical address with id for HdmiDeviceInfo" into lmp-dev 2014-08-16 04:12:14 +00:00
Santos Cordon
bb958df02e am fe75850a: am ef80aab4: am 5a496deb: Merge "Fixing wrong tag usage" into lmp-dev
* commit 'fe75850adbbcc63cec8f8a68ab903ab3d28ccdbc':
  Fixing wrong tag usage
2014-08-16 04:11:33 +00:00
John Reck
fb5899d6e0 Don't mangle layer paint's alpha
Bug: 15918037

Change-Id: Iecca0908c6e3b77f15807f75a8294d34975533b4
2014-08-18 08:53:36 -07:00
Santos Cordon
4adf4b0882 am ef80aab4: am 5a496deb: Merge "Fixing wrong tag usage" into lmp-dev
* commit 'ef80aab4cd9042171bdd14f2afb89de72d96db06':
  Fixing wrong tag usage
2014-08-16 03:56:27 +00:00
Michael Wright
8e5482f6ed Merge "Change 'disable hardware keyboard' to 'show input method'" into lmp-dev 2014-08-16 03:52:42 +00:00
Michael Wright
665366a305 Change 'disable hardware keyboard' to 'show input method'
Previously it implied that the hardware keyboard would be disabled,
but really the toggle would just enable showing the IME even if a
hardware keyboard was present. Changed the string and swapped the
semantics to be more clear about the behavior.

Bug: 14066881
Change-Id: I9c8a7eb98b5277f1d09cc19fa7402e9b4cf51d92
2014-08-17 17:51:19 -07:00
Alan Viverette
d7cb8dae66 am 926b8ebd: am 95495581: am 4c200997: Merge "Fix date and time picker styling" into lmp-dev
* commit '926b8ebdd8e02d59d306449494eb00218d550c9a':
  Fix date and time picker styling
2014-08-16 03:34:11 +00:00
Jeff Brown
da5966dc57 am dcc0cc99: am dbab7079: am 23c7b927: Add trace tag for power management.
* commit 'dcc0cc99577d795be71880025835ecce78dc33d2':
  Add trace tag for power management.
2014-08-16 03:34:05 +00:00
Alan Viverette
ef88cb4405 am c49542fb: am 3adb9051: am 47eba14f: Merge "Better handling of unresolved theme attributes" into lmp-dev
* commit 'c49542fb4524d24735bc2d6d693c29ef93ee8b44':
  Better handling of unresolved theme attributes
2014-08-16 03:33:50 +00:00
Alan Viverette
a74b02ca87 am b428f3b0: am 1125e88d: am 04ce8195: Merge "Scrapping the view at position zero is still position zero" into lmp-dev
* commit 'b428f3b0122f9edeb9f4efb7389a50a63594a640':
  Scrapping the view at position zero is still position zero
2014-08-16 03:33:43 +00:00
Alan Viverette
7544bb43f0 am 95495581: am 4c200997: Merge "Fix date and time picker styling" into lmp-dev
* commit '954955811273138b9262f8a1e2ae6df78bdf77e0':
  Fix date and time picker styling
2014-08-16 03:14:24 +00:00
Jeff Brown
ae330728bf am dbab7079: am 23c7b927: Add trace tag for power management.
* commit 'dbab7079dc0cde1026c39149f8240260ce09df8a':
  Add trace tag for power management.
2014-08-16 03:14:14 +00:00
Alan Viverette
e40b205ef4 am 3adb9051: am 47eba14f: Merge "Better handling of unresolved theme attributes" into lmp-dev
* commit '3adb9051a29c904f3a09d82b74c41d16cfa84ca3':
  Better handling of unresolved theme attributes
2014-08-16 03:13:06 +00:00
Alan Viverette
5502a547eb am 1125e88d: am 04ce8195: Merge "Scrapping the view at position zero is still position zero" into lmp-dev
* commit '1125e88d3955f900242754691238995b45d00027':
  Scrapping the view at position zero is still position zero
2014-08-16 03:12:58 +00:00
Dianne Hackborn
16ec0808b5 Make sure we initialize to enable the default voice interaction service.
We weren't taking care of the case of an upgrade to L.  The main
change here is that the voice interaction service setting now has
an empty string when the user has explicitly said they don't want
one, so when it is null we will initialize it to its default.

Change-Id: Icdd30b4f09498f8928cea759a64628bd43bc5d0e
2014-08-15 18:34:10 -07:00
Jeff Brown
3edf5272fb Add trace tag for power management.
Instrumented the basic power manager state transitions,
calling into the Power HAL, setting the display power mode,
and setting the backlight.

Bug: 17004602
Change-Id: I4e362162ddfd7292a7eea8b5d029ce3f6593c4a9
2014-08-16 01:21:41 +00:00
Ruben Brunk
4ee1076613 am ad3aaea5: am 8d392ff3: am f1aea7f9: Merge "camera2: Add jpeg metadata for LEGACY shim." into lmp-dev
* commit 'ad3aaea5a4fd0526637e5ebc8863e932b6f36b19':
  camera2: Add jpeg metadata for LEGACY shim.
2014-08-16 00:45:34 +00:00
Ruben Brunk
d927d37af7 am 0db517c8: am 8b90513e: am b62eea57: camera2: Fix shim aspect ratio scaling.
* commit '0db517c8fcc811d8871ce439a5c3a81d80511424':
  camera2: Fix shim aspect ratio scaling.
2014-08-16 00:45:29 +00:00
Adam Lesinski
fe2ee96947 am d6ce3e36: am 345efd9a: am 58157586: Merge "Add FeatureGroup to PackageInfo" into lmp-dev
* commit 'd6ce3e363ea229d4e00946492be2c9d60a2b049b':
  Add FeatureGroup to PackageInfo
2014-08-16 00:44:55 +00:00
Jeff Sharkey
00eb0dc691 am 870e1f60: am 61c28588: am a1af0d42: Merge "PackageInstaller API refactoring." into lmp-dev
* commit '870e1f6039b00a4878a01c59e8b407571f6361ba':
  PackageInstaller API refactoring.
2014-08-16 00:44:50 +00:00
Robert Greenwalt
305fd05e19 am 5be21366: am 26ca16ce: am 90e32866: Merge "Configure MTU based on network MTU parameter" into lmp-dev
* commit '5be213664688e2751ad6d76a40e9cd7c5823bb6a':
  Configure MTU based on network MTU parameter
2014-08-16 00:44:23 +00:00
Jeff Davidson
92cfac2c71 am 640e02a6: am 8450fe3b: am bffe81a7: Merge "Fix default scorer provisioning." into lmp-dev
* commit '640e02a644b45cedc76878a2594d51374f2bc7ed':
  Fix default scorer provisioning.
2014-08-16 00:44:14 +00:00
Adam Lesinski
99db87c1ba am afe71dba: am 5bcfb6b9: am 2fdf2db8: Merge "Fix assumption about DynamicRefTable in aapt" into lmp-dev
* commit 'afe71dba4adb8ad8d07146a1d17211875b42c012':
  Fix assumption about DynamicRefTable in aapt
2014-08-16 00:44:04 +00:00
Sunny Goyal
c340783a50 am b42afabc: am 6ba6c6ce: am c4949481: Merge "Returning null when preview image is not available for AppWidgetProviderInfo" into lmp-dev
* commit 'b42afabcaf88857acbffc88458278393192a164b':
  Returning null when preview image is not available for AppWidgetProviderInfo
2014-08-16 00:43:53 +00:00
Christopher Tate
c71107b170 am a2f65fd4: am 5e6afbc2: am 2c286400: Merge "Tighten restore-at-install behavior" into lmp-dev
* commit 'a2f65fd48d0c018fb2891d6e983472f7bd747f81':
  Tighten restore-at-install behavior
2014-08-16 00:43:48 +00:00
Amith Yamasani
f4146ab007 am 9d579953: am e52fb6f4: am a728a418: Merge "Copy certain settings to the managed profile" into lmp-dev
* commit '9d579953a8b9704f8c43775991be83df7df91b2b':
  Copy certain settings to the managed profile
2014-08-16 00:43:23 +00:00
Julia Reynolds
34b5930fc3 resolved conflicts for merge of 9ef71fb5 to master
Change-Id: I5b03835eddb1d0f5f3d93814732213458d5cd5d2
2014-08-15 20:26:42 -04:00
Ruben Brunk
384681f18b am 8d392ff3: am f1aea7f9: Merge "camera2: Add jpeg metadata for LEGACY shim." into lmp-dev
* commit '8d392ff3b6430b144c7b3d94aed5f0c0154c7440':
  camera2: Add jpeg metadata for LEGACY shim.
2014-08-16 00:22:01 +00:00
Ruben Brunk
ffd87c21ab am 8b90513e: am b62eea57: camera2: Fix shim aspect ratio scaling.
* commit '8b90513e20c7e99731e5e8c05b8705ba8c18b3b4':
  camera2: Fix shim aspect ratio scaling.
2014-08-16 00:21:56 +00:00
Ruben Brunk
a9bc355910 camera2: Fix shim aspect ratio scaling.
Bug: 16494207
Change-Id: I4bd40dee1caaf8c83a0853d48d44cc97151f9b41
2014-08-15 23:51:52 +00:00
Adam Lesinski
ec620de00c am 345efd9a: am 58157586: Merge "Add FeatureGroup to PackageInfo" into lmp-dev
* commit '345efd9a6988601e67d3c0202e433144670b5e62':
  Add FeatureGroup to PackageInfo
2014-08-15 23:16:50 +00:00