Commit Graph

10128 Commits

Author SHA1 Message Date
Bryce Lee
392ac74f37 Merge "Always send configuration to client from resize and relayout." into oc-dr1-dev 2017-06-30 16:17:34 +00:00
Bryce Lee
2050dc66e2 Merge "Add rotation to configuration." into oc-dr1-dev 2017-06-30 16:17:34 +00:00
Bryce Lee
f858b5788e Always send configuration to client from resize and relayout.
Previously, the server side would omit reporting new configurations
during resize and relayout if the current configuration matched the
last reported. However, if the last reported came through a resize,
the client side handling would be enqueued as a Handler message. This
leads to the possibility of the client getting a new window frame but
not a new configuration where this is synchronously handled, such as
ViewRootImpl::performTraversals.

To address this issue, we now always send the current configuration
from the server to the client. The client then identifies changes
against its own record of last reported configuration and updates as
appropriate.

This changelist also adds a call to force window relayout during
updateConfiguration, as it's possible this is called after
performTraversals is called or resize is handled, leading to a stale
window frame.

Bug: 24671393
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: I0d5143dfe80400f6a43ce710750f9fc9d4b93f74
2017-06-30 06:42:50 -07:00
TreeHugger Robot
4bf79089c4 Merge "Add getCurrentImeTouchRegion to the WindowManager API" into oc-dr1-dev 2017-06-30 03:22:45 +00:00
Ricardo Loo
824b41d77a Merge "docs: Updated isAutofillSupported description." into oc-dev
am: a89dfb5439

Change-Id: Ie43f37efa9e268b04dbad09ad04795089de68adf
2017-06-30 00:51:55 +00:00
Ricardo Loo
a89dfb5439 Merge "docs: Updated isAutofillSupported description." into oc-dev 2017-06-30 00:44:50 +00:00
Bryce Lee
c1f2f2a9d3 Add rotation to configuration.
Certain activities are dependent on the rotation of the device to
determine layout. In these cases, orientation does not provide enough
details.

This CL adds the field (hidden) to the configuration.

Change-Id: Idb3ba10cb4de8838737c25e92264e6cee224e264
Fixes: 32839232
Test: go/wm-smoke
2017-06-29 17:40:23 -07:00
Chet Haase
d73f6a985d Merge "Add docs for new padding/margin attributes." into oc-dev
am: 8cdbd6e184

Change-Id: Iacf5e069e0e6a2b38a1566f36f81ab8de693e634
2017-06-30 00:32:26 +00:00
Albert Chaulk
2ccb0b72e3 Add getCurrentImeTouchRegion to the WindowManager API
This is a followup to ag/2370980/ to expose the API more
externally as a WindowManager API. This allows application
access without needing to reflect on IWindowManager.Stub.

We require this to get the current IME touch region to
display it properly in VR contexts.

Test: Manual
Bug: 62194867

Change-Id: Ibbf336e1e473b65d4c76a1492da187d50cfda424
2017-06-29 13:44:19 -04: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
TreeHugger Robot
10a41f9b12 Merge "Protect a11y against multi-threaded UIs" into oc-dr1-dev 2017-06-24 04:44:12 +00:00
Rob Carr
2f666763e9 Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev
am: 70f1565b55

Change-Id: I88d205835ce91ea21d77a15649aad2d3b9c187d7
2017-06-21 02:38:55 +00:00
Rob Carr
70f1565b55 Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev 2017-06-21 01:47:58 +00:00
TreeHugger Robot
8d4ff1b34f Merge "Only enable wide color gamut support on capable devices" into oc-dr1-dev 2017-06-20 23:41:39 +00:00
Bryce Lee
80e1d8eb9a Merge "Limit creating new surface for legacy apps to size changes." into oc-dev
am: d523125679

Change-Id: Ie1c199bbc721f282dc0de788d36481fef9530460
2017-06-20 22:17:39 +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
Romain Guy
e89d0bba66 Only enable wide color gamut support on capable devices
Bug: 62827458
Test: CtsColorModeTests, more tests going in MR1
Change-Id: Idca2804b04ae6bdcbec6bcda6fd74dc6ada89c31
2017-06-20 14:23:28 -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
Jonathan Solnit
e07567cc0b Merge "Check for keyguard occlusion on camera lift" into oc-dr1-dev 2017-06-20 16:24:28 +00:00
Siarhei Vishniakou
305fe47d65 Merge "Revive DeadZone" into oc-dev
am: b278424fa6

Change-Id: I5a06302eaad1e955aaea6ae8d2785c0b12e53cc4
2017-06-19 23:59:46 +00:00
Siarhei Vishniakou
b278424fa6 Merge "Revive DeadZone" into oc-dev 2017-06-19 23:48:00 +00:00
Wale Ogunwale
f4dc128aa2 Merge "Added back removed ctor from DisplayEventReceiver" into oc-dev
am: 113918f309

Change-Id: I655721c29b22da375742628a9e7b8b3075b2dd27
2017-06-19 23:27:57 +00:00
TreeHugger Robot
113918f309 Merge "Added back removed ctor from DisplayEventReceiver" into oc-dev 2017-06-19 23:16:18 +00:00
Vladislav Kaznacheev
2102c3211c Merge "Do not update currently open tooltip." into oc-dev
am: 139dbe5c1c

Change-Id: Ia3fc1f16e71a4a12a0a84704b7ca7a9d2ec33514
2017-06-19 21:12:45 +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
280acdb88b Merge "Introduce HapticFeedbackConstants.TEXT_HANDLE_MOVE" into oc-dr1-dev 2017-06-19 19:44:52 +00:00
Felipe Leme
730924cd65 Merge "Revert "Trim text from autofillvalue when checking for empty."" into oc-dev
am: 215ebb941d

Change-Id: I058b5fd135e4165214116055ccdc04e9d99955b0
2017-06-17 01:04:08 +00:00
Phil Weaver
0da21f56e4 Merge "Separate a11y and autofill view ids" into oc-dev
am: c91290a6e9

Change-Id: Iec71a9ae34f963ef1f0ce7f6bd09b5af5bbba6e6
2017-06-17 00:59:04 +00: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
Casey Burkhardt
5f485cab2b 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
am: 4ab690a50d

Change-Id: Ia86c49759f9dac2c40b5c28609ab283efb41cd02
2017-06-17 00:52:47 +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
14d9e3a529 Merge "Create native Surface object on updateWindow for legacy apps." into oc-dev
am: 1e1c5d7b77

Change-Id: I2f402ea2a6003e5306a7bbcf1d7b8d640672d460
2017-06-16 23:24:34 +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
2de4d6bce4 Merge "Trim text from autofillvalue when checking for empty." into oc-dev
am: b3b13ff62c

Change-Id: I5a96a3f2613aeaad1f3d146b5ce6a208b1180851
2017-06-16 23:00:14 +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
Jonathan Solnit
6e8d70991c Check for keyguard occlusion on camera lift
Instead of just checking if the keyguard is locked, check that it's showing and
not occluded. Also add more logging.

Bug: 62386862
Test: Attempted lift gesture from the following states:
1. Locked
2. Suspended
3. Incoming phone call while locked
4. In phone call while locked
Change-Id: I55e75c695c9f1349ca16791a25029bf33477d7b7
2017-06-16 13:26:08 -07:00
Rob Carr
995f5240c9 Merge "ViewRootImpl: More null checks for performTraversals." into oc-dev
am: 6f87503ed8

Change-Id: I3c951fd2572abbada566494b5954697be098865d
2017-06-16 20:12:17 +00:00
Rob Carr
6f87503ed8 Merge "ViewRootImpl: More null checks for performTraversals." into oc-dev 2017-06-16 19:55:12 +00:00
Phil Weaver
9da5ee9e29 Merge "Stop rounded corners from confusing magnification" into oc-dr1-dev 2017-06-16 19:34:18 +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
94ed3c84d6 Merge "Add a workaround for simulate secondary display" into oc-dev
am: 31443a17e8

Change-Id: Ib248882df61f0d45b7687726c1a57de6c289a9b5
2017-06-14 20:27:09 +00:00