Commit Graph

6041 Commits

Author SHA1 Message Date
Svetoslav
bd6fabe2ae Merge "APIs for an accessibility service to put interaction tracking overlays." into lmp-mr1-dev 2014-10-23 23:17:21 +00:00
Yigit Boyar
fa9ed8ca0a Merge "Added a generic configuration and theme based cache" into lmp-mr1-dev 2014-10-23 21:06:24 +00:00
John Reck
aca6ccf403 Merge "Improve documentation" into lmp-mr1-dev 2014-10-23 21:00:45 +00:00
John Reck
43a5328c83 Improve documentation
Bug: 17440886

Change-Id: I3f5c0dab6e08c0097fe60eb269e7fffe7b48b563
2014-10-23 13:58:34 -07:00
George Mount
523a129ced Merge "Use one method to change bounds in ChangeBounds." into lmp-mr1-dev 2014-10-23 20:52:13 +00:00
George Mount
d359952459 Use one method to change bounds in ChangeBounds.
Bug 17936593

Instead of calling setLeft(), setTop(), setRight(), setBottom()
separately, make one call that does all at the same time.

Change-Id: I986274f3a98b3136e71204501ffc272986ad31dd
2014-10-23 13:08:15 -07:00
Yigit Boyar
d422dc358f Added a generic configuration and theme based cache
For now, only animators use it but we can consider migrating
drawable cache to it as well.

Bug: 17456416
Change-Id: I571b96856805edb171f0fc52e6bff5a365f46b70
2014-10-23 11:46:01 -07:00
Wale Ogunwale
d0aae5a222 Merge "Fix issue #17789629: PopupWindow overlaps with navigation bar." into lmp-mr1-dev 2014-10-22 22:17:19 +00:00
Svetoslav
3a5c721072 APIs for an accessibility service to put interaction tracking overlays.
An accessibility service may register to observe the interactive windows
on the primary display. These windows are the one that has input focus and
ones a sighted user can touch. It is sometimes beneficial for an
accessibility service to overlay a window to intercept user interaction
and based on that introspect and perform an action on the windows that
are on the screen. This is problematic as overlaying a full screen window
that is touchable prevents the accessibility service to introspect the
content under this window.

This change adds a special type of window that only an accessibility service
can place which does not affect what an accessibility service can "see" on
the screen. Hence, even putting such a window full screen the service will
be able to interact with the other interactive windows it covers.

Change-Id: I053ccc3a5c6360a98dc40bdb172b54dab35d8b31
2014-10-21 14:45:53 -07:00
John Reck
bf463af2a5 Merge "Surface:lockHardwareCanvas" into lmp-mr1-dev 2014-10-21 20:59:53 +00:00
John Reck
bb2d0cc7e1 Surface:lockHardwareCanvas
Bug: 17440886

Change-Id: I1f2d98c63ec1a2814c2258cf7e0096139263770a
2014-10-21 13:23:56 -07:00
Wale Ogunwale
393b1c1e88 Fix issue #17789629: PopupWindow overlaps with navigation bar.
The Lollipop release introduced a feature that allowed
apps to extend under the navigation bar. This also means
any popup window that is anchored to the bottom of its
parent window will overlap with the navigation bar if the
parent window is extending underneath the navigation bar.

This change introduces a new window flag
(FLAG_LAYOUT_ATTACHED_IN_DECOR) that allows the app to
specify if the popup window should be attached to the decor
frame of the parent window thereby avoiding an overlap
with the screen decorations.

By default the flag is set on SDK version LOLLIPOP_MR1 or
greater and cleared on lesser SDK versions.

Also, replaced flags FLAG_NEEDS_MENU_KEY and
PRIVATE_FLAG_NEEDS_MENU_KEY_SET with needsMenuKey state
variable to make room for the new
FLAG_LAYOUT_ATTACHED_IN_DECOR flag.

Bug: 17789629
Change-Id: I2150e0c6ac688c966c0e8f7e54d42fd20285bea6
2014-10-21 12:45:53 -07:00
Alan Viverette
e28cd1a276 Merge "Only request layout when removeView() actually removes a view" into lmp-mr1-dev 2014-10-20 19:00:36 +00:00
Adrian Roos
5f978bfa09 Merge "Retire RecentApplicationsDialog" into lmp-mr1-dev 2014-10-20 13:04:09 +00:00
Svetoslav
0b5af04a8b am ebb38bcc: am cd2b54e6: Merge "Accessibility no longer overrides strong encryption." into lmp-dev
* commit 'ebb38bcc03a0f770d371b2ed997570572df7aed1':
  Accessibility no longer overrides strong encryption.
2014-10-17 23:09:55 +00:00
Svetoslav
a6711ff6f0 Accessibility no longer overrides strong encryption.
Updating the accessibility layer behavior to reflect the new
model where accessibility no longer overrides strong encryption.
Now enabling an accessibility service lowers the encryption
level but the user can bump it up in settings if desired.

bug:17881324

Change-Id: Ic60d760c267d3f934040a42e1963b179bd8b9f5f
2014-10-17 14:33:11 -07:00
Alan Viverette
177ec4608e Only request layout when removeView() actually removes a view
BUG: 18035456
Change-Id: Iec82be63ef9fc4d0ff90d93f8f3a65328a5e1eba
2014-10-17 13:34:50 -07:00
Alan Viverette
721fc2adf4 Fix build
Change-Id: Idd7ae84c0d128bd40f0e7a83882e4ed4181e8a4d
2014-10-17 11:36:38 -07:00
Alan Viverette
2f68a204b2 Merge "Check type resolution on declared methods and fields in ViewDebug" into lmp-mr1-dev 2014-10-17 17:18:36 +00:00
Adam Powell
9cefbda11e View measurement optimization
If a view hasn't explicitly requested layout and it's asked to measure
with MeasureSpec.EXACTLY in both dimensions and sizes that match its
current measured size, the measure operation is a no-op.

This helps out a number of ViewGroups that perform initial speculative
measurements with AT_MOST or UNSPECIFIED followed by looping over
child views and measuring EXACTLY to lock in the final measurement
with perhaps some extra leftover space distributed. In practice this
happens a fair bit, especially for views high up in the view
hierarchy. This optimization allows ViewGroup measurement code to be a
little cleaner in not having to keep track of this on its own.

Change-Id: I88ff46a7d37aeda7a4cd16204b68cab0d051b341
2014-10-15 12:20:36 -07:00
Alan Viverette
6f1edae88c Merge "Send VIEW_SELECTED event when View selection state changes" into lmp-mr1-dev 2014-10-14 23:52:23 +00:00
Alan Viverette
99562fbbb4 Check type resolution on declared methods and fields in ViewDebug
BUG: 17375269
Change-Id: I8a74dfab1a1cf11b4240afb011d2729beea307c5
2014-10-14 14:48:52 -07:00
Alan Viverette
be98cdc702 Send VIEW_SELECTED event when View selection state changes
BUG: 11354667
Change-Id: I55d69e0e156c7bd83c14025f313a9d7261b7ccda
2014-10-13 17:58:39 -07:00
Jesse Hall
8d3cf106aa am d4b38fe5: am 647e0df0: Merge "Surface: Leave object in unlocked state when unlockCanvasAndPost fails" into lmp-dev
* commit 'd4b38fe5c06f622b984e7f84f299269efce92e42':
  Surface: Leave object in unlocked state when unlockCanvasAndPost fails
2014-10-13 22:08:31 +00:00
Jesse Hall
d7e559675c Surface: Leave object in unlocked state when unlockCanvasAndPost fails
If nativeUnlockCanvasAndPost() throws, Surface was maintaining a
reference to the native Surface, and assuming it was still locked.
That would cause future lockCanvas() calls to throw without even
trying to lock the native Surface, even though in some cases the
native lock was actually released before the exception was thrown.

Now Surface treats the native object as unlocked even if
nativeUnlockCanvasAndPost() throws, so it will attempt the native lock
on lockCanvas() rather than assuming it would fail.

This change also changes an IllegalStateException to
IllegalArgumentException in unlockCanvasAndPost(). That exception was
added in KitKat, and was never documented or added to the throws
declaration. This was essentially a silent public API change. Quite a
bit of code in the framework (and likely in applications) catches
IAE from this method, but didn't attempt to handle ISE. Although ISE
is more correct here, it's not worth breaking code (and it did -- in
this bug it changed a problem that should have been silently and
perfectly recovered from into a fatal exception in system_server.)

Bug: 17684556
Change-Id: Ia8d3e5d33eaa690d16c7d0f557390c7bb4e1e32e
2014-10-13 11:01:15 -07: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
Adrian Roos
9a64513c7f Retire RecentApplicationsDialog
Bug: 5162991
Change-Id: I429da977502f33e2091496f3a075b2c507a88e1f
2014-10-08 02:59:56 +02: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
438fe5937f Merge "Clear preordered list in translateBoundsAndIntersectionsInWindowCoordinates" into lmp-mr1-dev 2014-10-02 20:02:31 +00:00
Newton Allen
d84ce32bd2 Merge "Fix some documentation typos." into lmp-dev 2014-10-02 16:39:12 +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
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
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
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
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
ccf2fa0031 Missing null check
Bug: 17642023
Change-Id: I874b76e1e184a59dec714191d759c1045b7b9814
2014-09-25 08:33:05 -07: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