Commit Graph

6063 Commits

Author SHA1 Message Date
Svetoslav
d7c3816f84 am f874a06b: am e78aa531: am 9ab1b1bb: am c43caf52: Merge "Fix child view ordering for accessibility." into lmp-dev
* commit 'f874a06b952bafefb1ab2df8634b18ca30731eaf':
  Fix child view ordering for accessibility.
2014-10-10 17:15:08 +00:00
Adam Powell
f0eba02485 am 0f61804f: am 7cb761fe: Merge "Document that MarginLayoutParams margins should be positive." into lmp-mr1-dev
* commit '0f61804f18988dd547d3d56aef40a13aa59d3ce6':
  Document that MarginLayoutParams margins should be positive.
2014-10-10 17:00:35 +00:00
Adam Powell
de640f0210 am 02091f07: am 19a9e6c2: Merge "Throw a more descriptive exception when adding null to a ViewGroup" into lmp-mr1-dev
* commit '02091f071ad2b4754c9f4c7a66738d0d661c0c0e':
  Throw a more descriptive exception when adding null to a ViewGroup
2014-10-10 17:00:30 +00:00
Dianne Hackborn
75a6e82bcc am 36ae48a8: am d83e9e42: am 0761b1b5: am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev
* commit '36ae48a850bade17d485cb49dd40a3f11f667ad4':
  Put in real "code" (aka marketing) name.
2014-10-10 04:26:40 +00:00
Svetoslav
e78aa53123 am 9ab1b1bb: am c43caf52: Merge "Fix child view ordering for accessibility." into lmp-dev
* commit '9ab1b1bbe62aa0424214bb5bbcfd707cb8ac8199':
  Fix child view ordering for accessibility.
2014-10-10 00:32:15 +00:00
Svetoslav
88e447b576 Fix child view ordering for accessibility.
When reporting views to accessibility services we are ordering the
children in a parent based on their location on the screen. The
initial implementation worked pretty well in practive but violated
the transitivity property leading to rare crashes in apps. The current
implementation does not violate transitivity but does not produce
good ordering.

Given the lack of time and to minumize risk this change uses the
old strategy which works most of the time and if that fails we
fall back to the current strategy. Coming up with a correct strategy
that produces good results requires more time.

bug:17887986

Change-Id: I1c233ecdf318befc315e793696ac48bd6c652ab6
2014-10-09 16:40:47 -07:00
Adam Powell
7cb761fe8c Merge "Document that MarginLayoutParams margins should be positive." into lmp-mr1-dev 2014-10-09 20:08:41 +00:00
Adam Powell
a7a735fb2a Document that MarginLayoutParams margins should be positive.
Negative margins can cause all sorts of other problematic assumptions,
subtle errors and unexpected behavior. While they technically work
developers should steer clear of them.

Change-Id: Ia1f7d9a33e25444ebdc3c32679ae1179210558e1
2014-10-09 12:54:52 -07:00
Adam Powell
45a9da5076 Throw a more descriptive exception when adding null to a ViewGroup
Help developers during debugging bad calls to addView by throwing an
IllegalArgumentException earlier rather than implicitly tossing NPE
the first time the child view is accessed.

Change-Id: I4a554635815a5d0b415f637b93592fb45973f26d
2014-10-09 09:47:03 -07:00
Dianne Hackborn
d83e9e4280 am 0761b1b5: am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev
* commit '0761b1b5ebb453a411e3289c1c972dbfddcee880':
  Put in real "code" (aka marketing) name.
2014-10-09 13:03:21 +00:00
Dianne Hackborn
955d8d69ea Put in real "code" (aka marketing) name.
Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
2014-10-07 20:17:19 -07:00
John Reck
6e4140c6e2 am c4694796: am 6a2296d8: am 9da6e743: am d988a45d: Merge "Cleanup DeferredLayerUpdater" into lmp-dev
* commit 'c4694796a952014d07e6d083749d2f8b7d06afee':
  Cleanup DeferredLayerUpdater
2014-10-04 15:45:20 +00:00
John Reck
6a2296d856 am 9da6e743: am d988a45d: Merge "Cleanup DeferredLayerUpdater" into lmp-dev
* commit '9da6e7435945e34d05e0c8c5c9a324218480c6ff':
  Cleanup DeferredLayerUpdater
2014-10-03 23:57:30 +00:00
John Reck
749906b468 Cleanup DeferredLayerUpdater
Bug: 17765082

DeferredLayerUpdater had fallen behind RT updates. Re-snap to
latest expectations, ensuring to call requireGlContext() prior
to detachSurfaceTexture to avoid leaking SurfaceTextures

Change-Id: Ic65fb9831e5284f658866da8da9ad5af1d227699
2014-10-03 15:02:19 -07:00
Chris Craik
204b30191a am 9977d890: am 438fe593: Merge "Clear preordered list in translateBoundsAndIntersectionsInWindowCoordinates" into lmp-mr1-dev
* commit '9977d890e2e063a8e6bcd3d78005e5d0822cf7db':
  Clear preordered list in translateBoundsAndIntersectionsInWindowCoordinates
2014-10-02 20:12:55 +00:00
Chris Craik
438fe5937f Merge "Clear preordered list in translateBoundsAndIntersectionsInWindowCoordinates" into lmp-mr1-dev 2014-10-02 20:02:31 +00:00
Newton Allen
df2b8a1cb9 am 58f75627: am 94f5155d: am c68aad9f: am d84ce32b: Merge "Fix some documentation typos." into lmp-dev
* commit '58f75627d195082e263f6d6d8e3c46c6d0970e63':
  Fix some documentation typos.
2014-10-02 19:43:39 +00:00
Newton Allen
d84ce32bd2 Merge "Fix some documentation typos." into lmp-dev 2014-10-02 16:39:12 +00:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
John Reck
2b16483ae6 am 3b2f6701: am d644facf: am f408656a: am 8786a962: Merge "Re-allow suppressing onDetachedFromWindow" into lmp-dev
* commit '3b2f670187fde9079a1f9eaee92415b6a886611f':
  Re-allow suppressing onDetachedFromWindow
2014-10-02 12:38:26 +00:00
John Reck
77e4a5250f Re-allow suppressing onDetachedFromWindow
Bug: 17578553

Games seem to be doing this to prevent destruction of their
GL contexts, and they assume it works even if it doesn't. However,
GLSurfaceView is clunky here, so while the app is doing something
questionable we don't really offer a better way. For now revert
back to kitkat behavior.

Change-Id: Icfa9e496279b9cfa47f9bc7f6848d9313caed0d5
2014-10-01 10:38:07 -07:00
Adam Powell
3ea97a8de6 am ac40e790: am ced21e4e: am c754382b: am fe426d06: Merge "Inset the non-overlay contextual action bar without a status guard" into lmp-dev
* commit 'ac40e79029b99ef46f68c510ef19e81363f25bab':
  Inset the non-overlay contextual action bar without a status guard
2014-10-01 17:10:25 +00:00
Svetoslav
047ab3b2e5 am cf0a3373: am 344ffbc6: am 567c9788: am 44d4eeaa: Merge "Use default encryption password if an accessibility service is enabled." into lmp-dev
* commit 'cf0a337352a228302d44f9582673c7acdba329ca':
  Use default encryption password if an accessibility service is enabled.
2014-10-01 17:10:00 +00:00
George Mount
c416fb8c62 am 8cc88125: am 6d7a0cd5: am 3dc0a918: am 8afceda1: Merge "Clear preordered list after use." into lmp-dev
* commit '8cc881257c6e8e9448a05e25688861536ea55971':
  Clear preordered list after use.
2014-10-01 17:09:09 +00:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Adam Powell
46cbf7e190 Inset the non-overlay contextual action bar without a status guard
When the status guard is not available, (e.g. when the window is not
drawing system bars) do not consume the insets when an action mode is
active.

Bug 17691453

Change-Id: I459622eaf161a96152fb9ac5f60bb9508aa4de89
2014-09-30 13:31:51 -07:00
Svetoslav
44d4eeaa48 Merge "Use default encryption password if an accessibility service is enabled." into lmp-dev 2014-09-30 20:01:04 +00:00
Svetoslav
16e4a1aade Use default encryption password if an accessibility service is enabled.
When device is encrypted the user has to authenticate in order to decrypt
the data partition which is required for running accessibility services
and Text-To-Speech. In order to address this issue we are falling back
to use the default password if there is an enabled accessibility service
and the user has secure lock. This will enable the user to authenticate
when accessibility layer is completely functional.

bug:17671790

Change-Id: Iafffe7bcd234008cf91ffb5011b21b803dca227a
2014-09-30 13:00:11 -07:00
Chris Craik
57c79c8a49 Clear preordered list in translateBoundsAndIntersectionsInWindowCoordinates
bug:17697944
Change-Id: I1c2296707df5fc29bfc85385d766217afc1063cf
2014-09-30 12:54:31 -07:00
George Mount
c5ac3546dc am 3cc3fbf3: am 2d0d041f: am 3bcfbdd9: am 8120652b: Order GhostViews so that they display in their ghosted view\'s order.
* commit '3cc3fbf3aa090919506b1ef726b54fa18fc5e72a':
  Order GhostViews so that they display in their ghosted view's order.
2014-09-30 14:57:23 +00:00
Svetoslav
31677f947f am 6b0394fb: am 77e41f5e: am b009016f: am ed2fdc6e: Accessibility node provider getting invalid virtual view id.
* commit '6b0394fb958b86f2ef9372c20511950c634524d0':
  Accessibility node provider getting invalid virtual view id.
2014-09-30 14:57:10 +00:00
Newton Allen
8f8a11b7fa Fix some documentation typos.
Change-Id: I747a0ade5c7b9c45d4465bf327952338bbc1cfaa
(cherry picked from commit 4465d1a03e)
2014-09-30 02:52:26 +00:00
George Mount
50ac6cb982 Clear preordered list after use.
Bug 17671834
Bug 17697944

Change-Id: I0ba46f32661869db0c925b00342211ea543e2f88
2014-09-29 17:10:24 -07:00
George Mount
8120652bb1 Order GhostViews so that they display in their ghosted view's order.
Bug 17671834

GhostViews can be added in arbitrary order since they are added
depending on how they are insterted into the TransitionValues
maps. This CL does two things: it ensures that GhostViews are always
pulled to the top of the Overlay and inserts GhostViews into
the Overlay in the order that their ghosted views are drawn.

Change-Id: I9f68105126834cc8f30a6cfe5d58fc3c51465afd
2014-09-28 21:13:38 +00:00
Svetoslav
ed2fdc6ef5 Accessibility node provider getting invalid virtual view id.
If the virtual child id is not specified we should ask the node
provider to create a node info for the hosting view bu passing
the special host node id.

bug:17664111

Change-Id: Iaf1387acdfe33b50b50729d293adcdf82340a648
2014-09-28 20:05:23 +00:00
Svetoslav
bd8db7b102 am daeee005: am 16f3a714: am 5cdfd3ac: am 7c20fcc8: Merge "Accessibility node provider getting invalid virtual view id." into lmp-dev
* commit 'daeee0053554a7ce81e1586e52521d4ca13bbc94':
  Accessibility node provider getting invalid virtual view id.
2014-09-26 23:18:06 +00:00
Svetoslav
b3ba1d4e71 Accessibility node provider getting invalid virtual view id.
If the virtual child id is not specified we should ask the node
provider to create a node info for the hosting view bu passing
the special host node id.

bug:17664111

Change-Id: I9c2d3195ad813eed7ea4108fe0d7ccb9cc32a1a0
2014-09-26 15:23:36 -07:00
Svetoslav
143a6fafff am c9a230f4: am bcc4f1bc: am b14c7e04: am 9ec435dc: Merge "Using wrong virtual view id When prefetching accessibility nodes." into lmp-dev
* commit 'c9a230f4d23e9e8b98b354f7758443701bee9bbc':
  Using wrong virtual view id When prefetching accessibility nodes.
2014-09-26 05:04:25 +00:00
Svetoslav
c569d35945 Using wrong virtual view id When prefetching accessibility nodes.
When getting an accessibility node info we also prefetch its predecessors,
siblings and descendants up to fifty. If a view has a node provider, i.e.
virtual descendants, and the id of the virtual descendant is not specified
we use a speacial constant to refer that the provider should create a node
for its hosting view. The bug was that we were not using the correct constant
when calling into the provider.

bug:17664111

Change-Id: I4f6b2333e1e7e3e2bb6b164c0752613417c60d16
2014-09-25 18:46:33 -07:00
John Reck
9bb49fe22d am 4f6fa843: am 4dd90969: am 2994cc57: am e5831979: Missing null check
* commit '4f6fa8433493221fc55a25aa9e958f4b188fe5a5':
  Missing null check
2014-09-25 17:06:22 +00:00
John Reck
ccf2fa0031 Missing null check
Bug: 17642023
Change-Id: I874b76e1e184a59dec714191d759c1045b7b9814
2014-09-25 08:33:05 -07:00
Svetoslav
5948a3c967 am 0444464b: am 8b5f8df1: am 3ee4d02c: am 176b1955: Merge "Ignore not visible views computing click point for accessibility." into lmp-dev
* commit '0444464b18cd9dcb070e5a5e12192a000b07b0a4':
  Ignore not visible  views computing click point for accessibility.
2014-09-24 16:20:45 +00:00
Svetoslav
e7482460af Ignore not visible views computing click point for accessibility.
In accessibility mode we compute a location to where to send down and up
events to click a view (triggered by a double tap). This solves the problem
of interacting with views that are partially covered by other interactive
views. The logic that computes the click point was not ignoring siblings
that are not visible. As a result a blind user cannot interact with some
views.

bug:17632224

Change-Id: I93e637ee6702e4ba3e79faa736205430e2196d01
2014-09-23 18:48:28 -07:00
Jeff Brown
578628741b am 87c18cc6: am 2d8fd798: am c91bd121: am 3f51958b: Merge "Fix window manager policy state when waking from doze." into lmp-dev
* commit '87c18cc6d01fa553bc72e7d2b66f15f58863113a':
  Fix window manager policy state when waking from doze.
2014-09-23 17:23:04 +00:00
Jeff Brown
3ee549ca24 Fix window manager policy state when waking from doze.
Once upon a time when the world was fresh and new, the heavens
had an easy rhythm.  Day and night.  Night and day.  In the day,
the pixel fairies would cavort and play in the bright gardens
with narry a mark of shadow or gloom.  In the night, they would
rest peacefully, dreaming no dreams and knowing no fear.

Then one night a fairy dreamed the first dream.  At first
the dream was peaceful, full of colors and delight, hopes and
memories.  Then all at once, jarringly, it awoke in bright
daylight.  The pixel fairy knew fear, for the world had changed
and it was unprepared.

Time passed and the pixel fairies grew accustomed to their
fate, day and night, night and day, sometimes dreaming, until
there came a night when a fairy did not sleep.  It roamed
the land in a dreamless doze, lost and afraid amid a grim haze
of grey and darkness.  The fairy despaired.  It wanted no
part of this place.  It pretended for a time to be awake but
the bright daylight would not come.  It pretended for a time to
be dreaming but the colors and memories would not come.
That is when the fairy wished for oblivion.  Then just as
suddenly, it awoke in the daylight.  It fell to the ground,
stunned as if it had forgotten how to walk in the too bright
daylight.

Though the world again grew softer and kinder in time, the pixel
fairies were never the same.  For the night is dark and full
of terrors.

---

It used to be easy.  Screen on and screen off could explain almost
everything about the state of the device but it's different now with
ambient display.  We need to be able to wait for all windows to be
drawn even in the case where the device is still nominally asleep.
In truth, the window manager policy which drives a lot of these
interactions is a thicket of outdated assumptions.

Added a new method to tell the window manager policy when the screen
is being turned off so that it can correctly account for changes
to the interactive state (wakeUp and goingToSleep) and screen state
(screenTurningOn and screenTurnedOff).  Now we can independently
poke keyguard during interactive state changes and we can apply
screen on blocking during screen state changes.

Moved the code which manages screen on blocking (which is what
ensures the UI has fully drawn before revealing screen contents)
from the power manager to the display manager since the display
manager is in a better position to accurately track the state of
the screen, particularly when the screen is being turned off.

Fixed a bunch of synchronization issues.  Previously some work
had been moved to a handler without considering what might
happen if it became reordered relative to other work happening
elsewhere.  Documented the desired behavior in the code to
prevent this from happening again.

There's still a bunch of stuff in here that isn't quite right,
particularly the assumption that there's only one screen, but
it's good enough for now.  Hopefully there aren't too many bugs.

Bug: 17605802
Change-Id: Ic7319e09948c8a3cda014d7e169c964a3ad86f14
2014-09-23 09:38:05 -07:00
John Reck
5315ce4bf1 am fa19b7aa: am 8434cfaf: am ae26f177: am 668e566e: Merge "Aggressively trim memory for system_process" into lmp-dev
* commit 'fa19b7aa01e26d5a24e05b1bb963f9bd8d079bf7':
  Aggressively trim memory for system_process
2014-09-23 15:49:41 +00:00
John Reck
73840ea367 Aggressively trim memory for system_process
Bug: 16978006

Don't HWUI-accelerate KeyguardScrim
Aggressively trim memory as soon as a ViewRootImpl
dies or has its visibility changed.

Change-Id: Ie1b7c9d30653456bd2e9f309128174f972999368
2014-09-22 16:01:56 -07:00
Svetoslav
41f5dbe776 am 20178a82: am 35c764cf: am 562f38ee: am 23e6a244: Merge "Fix memory leak in accessibility cache." into lmp-dev
* commit '20178a82310253e12555c783e0e3efde8b0500ac':
  Fix memory leak in accessibility cache.
2014-09-22 19:44:35 +00:00
Svetoslav
650d7d9dd2 Merge "Fix memory leak in accessibility cache." into lmp-dev 2014-09-21 17:53:45 +00:00
Yigit Boyar
cb0721ff8f am 1ea86977: am 6477ca14: am 397c6004: am 646e0428: Merge "Find activity from context in menu inflator for click events" into lmp-dev
* commit '1ea86977bf9d9106728c5344ee1e5f054b8973e5':
  Find activity from context in menu inflator for click events
2014-09-20 02:44:20 +00:00