Commit Graph

9885 Commits

Author SHA1 Message Date
Cindy Kuang
12d3747c0b docs: replaced "i.e." to fix formatting error
Test: make ds-docs

Bug: 6440865
Change-Id: I428476ddfe55f14df531ea6a1c3e3a09f7a29e7d
2017-08-10 09:59:58 -07:00
Felipe Leme
744976e298 Clarifies autofill lifecycle.
Test: m update-api

Bug: 64125551
Bug: 64114048
Change-Id: I17c5bc2e2e64fa27e877301dbcb983ac8497209e
2017-08-07 17:22:50 -07:00
Felipe Leme
33681a94cf Cherry-picked some Autofill Javadoc improvements from master.
Test: m update-api

Bug: 64125551
Bug: 63669555
Bug: 63985284

Merged-in: Iba4817f682670e9fd6d891ae221e1fa415252e99
Change-Id: I82cbb54a522b2cf1dfb11aacc9735c932aa9af90
2017-07-31 10:18:03 -07:00
TreeHugger Robot
401b8907d0 Merge "SurfaceView: Avoid initializing Surface from an invalid SurfaceControl." into oc-dev 2017-07-07 03:10:12 +00:00
Robert Carr
7c67b7d097 SurfaceView: Avoid initializing Surface from an invalid
SurfaceControl.

In a recent CL we introduced a call to Surface#createFrom, in order to
recreate the Surface object from the underlying SurfaceControl, as a
workaround to emulate when it was parcelled over binder in the past.
However this is causing BufferQueue abandoned errors when stopping and
resuming some applications. To understand them, we need to revisit the
SurfaceView destruction process when handling onStop.

First mWindowStopped will be set to true (SurfaceView#windowStopped),
and we should then enter updateSurface. Our requested visibility will
now be false and so we emit the Surface destroyed callbacks. Notice in
the finally block in mUpdateSurface, we will release mSurface, but we
will NOT null mSurfaceControl. Inline documentation explains why.

In the case that the activity is not actually being destroyed, it's
possible that we may not get a dispatchDetachedFromWindow. This means
that we will not null mSurfaceControl. Now if the activity is
un-stopped and we re-enter updateSurface we encounter a problem
state. "creating" will be set to false since mSurfaceControl != null,
however mSurfaceControl will not point to a valid surface.

Prior to the introduction of the #createFrom call, this unwanted state
didn't cause any problems. Because mSurface was released back in the
finally block as we were stopping we now fall out of the
mSurface.isValid() block in updateSurface. As we reach the finally
block again, we would now set mSurfaceControl=null since the app was
no longer stopped. Later when we reach updateSurface again (which
tends to happen quite often) it will now be null and we will correctly
set creating=true, create a valid SurfaceControl, and move along
happily. However following, the introduction of this
Surface#createFrom call we will now reinitialize the Surface from an
invalid underlying SurfaceControl. This means we will enter the
mSurface.isValid block, but will proceed to emit an invalid Surface to
the client in the callbacks.

We avoid this state by making creating=true even if
SurfaceControl=non-null when the calculated visibility changes from
invisible to visible.

Bug: 63251745
Test: Manual of app from bug and apps from previous related bugs. go/wm-smoke. Additional manual testing of many SV apps.
Change-Id: Icc32a34cac239d65267da705cc23feb23e1ceb67
2017-07-06 15:53:04 -07:00
Ricardo Loo
a89dfb5439 Merge "docs: Updated isAutofillSupported description." into oc-dev 2017-06-30 00:44:50 +00:00
Chet Haase
353d397d17 Add docs for new padding/margin attributes.
The attributes for View, paddingHorizontal and paddingVertical,
were added in the O release and are documented in R.attr. But they
should also be referenced in View itself, alongside the other
padding parameters.

Similarly, the new layout_MarginHorizontal and
layout_marginVertical should be referenced in
ViewGroup.MarginLayoutParams.

Bug: 63128350  Add docs about new padding/margin params
Test: built docs, checked the result
Change-Id: I3021df5ea83c469811b4a6ec6ecd3ab2966ec384
2017-06-29 07:54:19 -07:00
Ricardo Loo
33d226c953 docs: Updated isAutofillSupported description.
The description for `AutofillManager.isAutofillSupported` doesn't make
clear that either the device or the user can make autofill unsupported.

Bug: 62604325
Test: Ran 'make ds-docs -j16' and staged content to
go/dac-stage/reference/android/view/autofill/AutofillManager.html#isAutofillSupported()

Change-Id: I298b9f535e23dc3cb54fabed36642523753c13a5
2017-06-27 14:17:33 -07:00
Rob Carr
70f1565b55 Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev 2017-06-21 01:47:58 +00:00
Robert Carr
ad3a493106 SurfaceView: Fix positioning issue when toggling visibility.
There is an issue (seemingly preexisting) with getPositionInWindow
after toggling view visibility. We see it when showing a view,
hiding it, and then showing it again. At this point we end up
with this call-stack:
   SurfaceView#setVisibility->SurfaceView#updateSurface
   ->View#getPositionInWindow
and getPositionInWindow fills in the wrong values. This newly discovered
bug is tracked as 62839113.

In a second bug, introduced in the SurfaceView refactoring,
we are not appropriately clearing the last RenderThread reported
position when toggling visibility. This means that even after the
setVisibility call when getPositionInWindow begins returning
the correct values, we don't update the position. This CL fixes
that and fixes 62653411 as a result. However we still have a flicker
as we did in N as the initial position is wrong.

Test: Manual from bug, go/wm-smoke
Change-Id: I1037b8dfdb343f9ce8c8616eb9197c6d039ed133
Fixes: 62653411
Bug: 62839113
2017-06-20 14:55:21 -07:00
Bryce Lee
453fc364c3 Limit creating new surface for legacy apps to size changes.
Creating the surface for every change (such as creation and
visibility) can lead to issues swapping buffers. This
changelist limits the action to only when the size changes.

Change-Id: Ic549d244613a93a43a9f4ddf284bbfb0c13300fa
Fixes: 62801621
Test: follow repro steps in bug, verified no crash.
Test: go/wm-smoke
2017-06-20 10:47:55 -07:00
Siarhei Vishniakou
b278424fa6 Merge "Revive DeadZone" into oc-dev 2017-06-19 23:48:00 +00:00
TreeHugger Robot
113918f309 Merge "Added back removed ctor from DisplayEventReceiver" into oc-dev 2017-06-19 23:16:18 +00:00
Siarhei Vishniakou
6ad0e39f33 Revive DeadZone
Override dispatchTouchEvent for the root FrameLayout
of NavigationBar to process ACTION_OUTSIDE MotionEvents
and dispatch directly to DeadZone to keep track of the
most recent outside tap.
Clarified documentation of ACTION_OUTSIDE behaviour.

Bug: 37552674
Test: open IME, tap any key, then quickly tap on top half
of the home button. The home button tap is ignored
and device does not go to homescreen.

Change-Id: Icb5cf6c76959f3514b8b94c09e38cc5434f31b23
2017-06-19 14:06:21 -07:00
TreeHugger Robot
139dbe5c1c Merge "Do not update currently open tooltip." into oc-dev 2017-06-19 21:01:47 +00:00
Wale Ogunwale
71f3099c53 Added back removed ctor from DisplayEventReceiver
...because some app can't help but access hidden APIs...

Test: builds
Change-Id: Ia1d4a71b46a53b44e3ebe5844e446009785a90ac
Fixes: 62719884
2017-06-19 13:53:32 -07:00
TreeHugger Robot
215ebb941d Merge "Revert "Trim text from autofillvalue when checking for empty."" into oc-dev 2017-06-17 00:53:04 +00:00
Phil Weaver
c91290a6e9 Merge "Separate a11y and autofill view ids" into oc-dev 2017-06-17 00:46:05 +00:00
Casey Burkhardt
4ab690a50d Merge "Resolve 3 inconsistencies in accessibility button API - Unify logic for detecting availability of the accessibility button - Ensure the initial visibility state is propagated to A11yMS - Ensure services only receive availability callbacks for changes" into oc-dev 2017-06-17 00:41:06 +00:00
Bryce Lee
1e1c5d7b77 Merge "Create native Surface object on updateWindow for legacy apps." into oc-dev 2017-06-16 23:15:10 +00:00
Felipe Leme
313cf3fb93 Revert "Trim text from autofillvalue when checking for empty."
This reverts commit c5d4e068f2.

Change-Id: I4027cf0f91ebb9032c21efad7025118891188bc6
2017-06-16 22:57:58 +00:00
Phil Weaver
846cda9397 Separate a11y and autofill view ids
Autofill seems to need IDs to be preserved across things
like configuration changes, while accessibility will not
function without views with unique ids. Separating out the
two types of IDs. We can re-combine them once it's clear
that both demands can be satisfied.

Bug: 62301218
Test: Run a11y and autofill CTS, and verify that the play
store app functions with TalkBack after a screen rotation.

Change-Id: I17a99de2874768fc0ade3aa354130dd1f6b4cd7e
2017-06-16 14:36:36 -07:00
Bryce Lee
02949f1415 Create native Surface object on updateWindow for legacy apps.
There are some apps that use the Surface object itself to indicate
changes. As a result, recycling the existing Surface object for
updates can lead to such apps ignoring events such as size changes.

This changelist restores the original behavior for legacy apps, where
the underlying native Surface object is recreated during updates.

Fixes: 62108743
Test: go/wm-smoke
Test: Open affected application, observe expansion to fullscreen when
      nav bar disappears. Rotate to other orientation and observe
      expansion to fullscreen.

Change-Id: I874602b6b8686c6ecb05cf7b1a04ec4b700ad3f9
2017-06-16 14:00:40 -07:00
Felipe Leme
c5d4e068f2 Trim text from autofillvalue when checking for empty.
Test: VirtualContainerActivityTest#testSaveDialogNotShownWhenBackIsPressed
Fixes: 62667931

Change-Id: I7e673eedd39fff7af89c694d0bfc5a495f14ea26
2017-06-16 13:41:37 -07:00
Rob Carr
6f87503ed8 Merge "ViewRootImpl: More null checks for performTraversals." into oc-dev 2017-06-16 19:55:12 +00:00
Vladislav Kaznacheev
dd469d171d Do not update currently open tooltip.
Currently if View.setTooltipText is called while
the tooltip is being shown for that view, it will
update the displayed text. The tooltip then will
resize to wrap around the new text, but not change
its position. This looks confusing if the new text
is significantly shorter or longer.

Removing this functionality until proper
re-positioning is implemented.

Bug: 38491655
Test: android.view.cts.TooltipTest passes
Change-Id: I79689288185888854b992b89e19fe381d3ac50e4
2017-06-16 11:31:23 -07:00
Casey Burkhardt
469a2087d5 Resolve 3 inconsistencies in accessibility button API
- Unify logic for detecting availability of the accessibility button
- Ensure the initial visibility state is propagated to A11yMS
- Ensure services only receive availability callbacks for changes

Test: Manual, created test accessibility services
      targeting specific breakages
Bug: 38345417

Change-Id: I2250b32830cdfc2ecdc1dff7b7130dced2c1db29
2017-06-15 18:39:27 -07:00
Robert Carr
32f37ab023 ViewRootImpl: More null checks for performTraversals.
Let's first understand how mView could become null. Notice
at the beginning of performTraversals, there is a check that
mView != null, and so it is nulled while we are in the function.
mView is package private and there are only two places which assign
to it, ViewRootImpl#setView and ViewRootImpl#doDie. setView is guarded
by mView == null. But mView was not null (per the check at the beginning
of performTraversals) and so mView is being nulled by doDie().

doDie() only has 3 callpoints:
        1. ViewRootImpl#die(). Here though, calling it is guarded by
        !mIsInTraversal. !mIsInTraversal is unconditionally set at the
        beginning of performTraversals, and so this isn't our caller.
        2. ViewRootHandler, handling MSG_DIE. This runs on the same thread
        as performTraversal, and so it can't be our nuller.
        3. WindowManagerGlobal#addView. This must be our nuller.

We see WindowManagerGlobal#addView will call doDie in the case that
we attempt to add a view which we had previously set to be removed
but deferred removal of. Now we can construct a reasonable sequence
for getting here:
    1. requestLayout(). Perform traversals ends up on handler.
    2. removeView(). MSG_DIE ends up on handler, View ends up in mDyingViews
    3. performTraversals is executed by the handler
    4. From a callback initiated by performTraversals (e.g. measure)
       the client calls WindowManagerGlobal#addView on the view which
       was just removed.
    5. We are still in performTraversals so MSG_DIE hasn't been processed
       yet. This means that WindowManagerGlobal will perform the doDie
       immediately nulling mView.
    6. We return to performTraversals and crash.

We can see shortly after the offending call to doDie, a new ViewRoot will be
constructed and so whatever traversal we are doing on the old one doesn't
seem particularly important. It doesn't seem that we can do any better
than letting it fall through without crashing.

Bug: 38421184
Test: go/wm-smoke. Feed to the monkeys.
Change-Id: I55f310a3533175c9df4a82878be5a60fd01b80c1
2017-06-15 12:52:53 -07:00
John Reck
a896306c38 Add a workaround for simulate secondary display
To workaround a deadlock caused by bufferqueue locks
we force RenderThread over to use async mode which
we enable via eglSwapInterval(0)

Bug: 38372997
Test: steps in the bug
Change-Id: Ia305f73abbdd64ab0c25d1f7d32792cc6295a0ce
2017-06-14 10:50:14 -07:00
TreeHugger Robot
42b3610adc Merge "SurfaceView: Fix missing override for SurfaceControl proxy" into oc-dev 2017-06-12 23:38:19 +00:00
Robert Carr
552da0e0cd SurfaceView: Fix missing override for SurfaceControl proxy
I will not pretend classes are interfaces...I will not pretend
classes are interfaces...

Bug: 62444724
Test: cts-tradefed run singleCommand cts -d -o --module CtsViewTestCases --test android.view.cts.SurfaceViewSyncTest#testSurfaceViewBigScale
      go/wm-smoke

Change-Id: Iccca46edcd669430c32f31e9c7d8aba1db254f2d
2017-06-12 11:43:51 -07:00
Felipe Leme
211e760408 Merge "Minor fix on autofill() javadoc." into oc-dev 2017-06-09 22:02:51 +00:00
Siyamed Sinir
bc626c6358 Merge "Force Autofill in FloatingToolbar overflow menu" into oc-dev 2017-06-09 20:58:36 +00:00
Felipe Leme
8db148093c Merge "Closes Autofill UIs when back button is pressed." into oc-dev 2017-06-09 19:48:00 +00:00
Felipe Leme
e4835a2af4 Merge "Ignore dispatchProvideStructureForAutofill() when layout is being updated." into oc-dev 2017-06-09 19:42:24 +00:00
Felipe Leme
fad3a83a93 Minor fix on autofill() javadoc.
Bug: 62465574
Test: N/A

Change-Id: I4a55b4064a8af835e962a77c6ad55a29c1954efd
2017-06-08 18:50:27 -07:00
Felipe Leme
5013f9feb2 Ignore dispatchProvideStructureForAutofill() when layout is being updated.
View already checks if its layout is being updated when calling
notifyEnterOrExitForAutoFillIfNeeded(), but that doesn't prevent apps crashing
when the autofill process was triggered by another view.

Test: existing CtsAutoFillServiceTestCases pass
Fixes: 38198484

change-Id: I8e9435ddc4cf21fb648d39aace93f3af0e1fdf4f
2017-06-08 18:45:11 -07:00
Jorim Jaggi
34a0cdb98e Properly run window animations at vsync-sf (1/2)
- Add new Choreographer instance that runs on vsync-sf
- Use this new Choreographer for WindowAnimator, and remove all
the hacks around it

Test: Open apps and close apps, notice no stutter
Test: Screen zoom animations
Test: go/wm-smoke
Bug: 36631902
Change-Id: I988ae25645effc3ac20efa7cb9b68f23444da0d0
2017-06-08 17:22:43 -07:00
Siyamed Sinir
484c2e2fbe Force Autofill in FloatingToolbar overflow menu
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 62271937
Change-Id: Ib3447281f3bd1abc811a25fc55ad55e34e155bbb
2017-06-08 17:16:26 -07:00
Felipe Leme
5f97880714 Closes Autofill UIs when back button is pressed.
Test: existing CtsAutoFillServiceTestCases pass
Test: LoginActivityTest#testSaveGoesAwayWhenTappingBackButton pass

Fixes: 62272098

Change-Id: Id34767ca32836f040e04790f0f2935ae49d88d71
2017-06-08 13:10:32 -07:00
Felipe Leme
9be8c96918 Merge "Overall improvement on Autofill javadocs for autofillable APIs." into oc-dev 2017-06-08 05:21:08 +00:00
Bryce Lee
f867733d4f Merge "Revert "Coordinate configuration changes and window frame size."" into oc-dev 2017-06-07 23:23:30 +00:00
Bryce Lee
46b01655b3 Revert "Coordinate configuration changes and window frame size."
This reverts commit afb45bba83.

Bug: 32839232
Fixes: 62424393
Change-Id: Ifaa0176e18100ec85b8c81268a26fb16ffe9b5f3
2017-06-07 23:03:09 +00:00
Evan Rosky
8d4b72c68a Merge "Don't report focusableViewAvailable on add" into oc-dev 2017-06-07 01:02:21 +00:00
Felipe Leme
2f6fc72efc Overall improvement on Autofill javadocs for autofillable APIs.
Bug: 37567048
Test: ran 'm -j doc-comment-check-docs' and checked resulting HTML

Change-Id: I7eaf0a521c3777baf0dc0002ae814990fd96a14c
2017-06-06 14:33:56 -07:00
Robert Carr
851e7e4394 SurfaceView: Correct inverted alpha detection condition.
Careless mistake on my part :). Sorry about that.

Test: Try an app with two SV like Netflix verify top SurfaceView doesn't occlude bottom one.
Bug: 62375611
Bug: 62113351
Change-Id: Ia33aabf8b8e276f70365d62b82f113ecd3bee2fa
2017-06-06 14:04:50 -07:00
Evan Rosky
b23e4f4987 Don't report focusableViewAvailable on add
This reverts a part of 2ae1bf568b

RecyclerView relies on the old behavior. Will un-revert this (with
targetSdk check) once we have a solution for RecyclerView

Bug: 38352147
Test: RecyclerView Focus tests now pass
Change-Id: I7b0dfda295cd75e407bbd39a948b5585f8ed6e08
2017-06-06 10:41:26 -07:00
Bryce Lee
afb45bba83 Coordinate configuration changes and window frame size.
Previously, it was possible for the view hierarchy to be measured,
laid out, and drawn around a window frame size that did not match
the current configuration. This stems from new configurations not
always propagating back from WindowSession#relayout, which is
called from ViewRootImpl.

This changelist makes WindowManagerService#relayoutWindow always
return the latest configuration. It also adds rotation to the
configuration.

Fixes: 32839232
Test: go/wm-smoke
Test: Open Camera while rotating phone to landscape. Added
      temporary logs to detect inconsistencies between measurements
      and reported rotation on draw.
Change-Id: I39daca338b4f87eff1a509eb99493f01e710ced1
2017-06-05 20:55:46 -07:00
TreeHugger Robot
71044d6ba1 Merge "Reinstate SurfaceView Background from N" into oc-dev 2017-06-05 23:57:06 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00