Commit Graph

14457 Commits

Author SHA1 Message Date
Evan Rosky
bddd280556 Merge "Add a window dump for uiautomator" into rvc-dev 2020-05-15 18:15:36 +00:00
TreeHugger Robot
5bf3f80f20 Merge "Add tracing for Inset animations" into rvc-dev 2020-05-14 22:16:23 +00:00
Tiger Huang
8fd8a538b8 Merge "Do not dispatch system UI visibility during traversal" into rvc-dev 2020-05-14 17:25:56 +00:00
Matt Casey
d8aa60aa0d Merge "Allow WindowManager.TYPE_SCREENSHOT to be focusable" into rvc-dev 2020-05-14 16:37:58 +00:00
Jorim Jaggi
cb28ae6d17 Add tracing for Inset animations
So we can understand better what's going on.

Bug: 156367695
Test: Systrace
Change-Id: Ic9dc2c963f70a3bb787121d33476b84bd3dc5798
2020-05-14 17:46:32 +02:00
TreeHugger Robot
d99569f88a Merge "Revert "Finish input when the screen state is off"" into rvc-dev 2020-05-14 14:21:39 +00:00
TreeHugger Robot
0e58daf022 Merge "Pass window type to the InputWindowHandle of embedded window" into rvc-dev 2020-05-14 08:32:00 +00:00
arthurhung
d3f17d7df7 Pass window type to the InputWindowHandle of embedded window
A windowless SurfaceControl could grant input via
IWindowSession.grantInputChannel, but other window may receive the
obscured events because of the type value of input window is always 0.

The obscured or partially obscured flag indicates that the window
received this motion event is wholly or partially obscured by another
visible window above it.

We have to filter out the trusted overlap so the motion event could
properly dispatch to the view if it is a security sensitive application.

Bug: 156063505
Test: enter split window mode and check the motion event
Change-Id: I10f63ea131a70ee8cc7d5c4b3e5ca4e5f06fdbad
2020-05-14 11:59:23 +08:00
TreeHugger Robot
3a6ec37a71 Merge "Remove divider view when exiting splitscreen" into rvc-dev 2020-05-14 02:25:24 +00:00
Ming-Shin Lu
2c6e80be12 Revert "Finish input when the screen state is off"
This reverts commit 0df8812486.

The original CL is trying to reduce the dependency of PownerManager to
finish input when screen off by using display state.

However, it doesn't fully fix the original Bug 26851566 since we only
finish input connection but didn't callback onFinishInput callback for
IME client.

Also, for some scenarios, the window / view focus may not change
during screen turns off / on:
  - Focusing timing when disable keyguard, then quickly screen off / on.
  - Using P-sensor to turning screen off / on.

When the above scenario happens, makes input connection cannot re-start
and soft-keyboard can't be shown.
(The recovery is manually focus on next window or activity.)

As the above reason, we need to re-consider the lifecycle of
input connection, window / view focus when not only screen state but also
device inactive state when always-on-display.

Fix: 156045961
Fix: 154605805
Bug: 26851566
Bug: 156215187
Test: atest CtsInputMethodTestCases
Change-Id: If06daf71160aa44a4254ac125561974ecbdef4f2
2020-05-14 08:29:18 +08:00
TreeHugger Robot
bff3812e82 Merge "SurfaceView: positionLost locking fix" into rvc-dev 2020-05-13 22:04:58 +00:00
TreeHugger Robot
730fb0d97d Merge "Fix inline suggestion ref counting to not over-count" into rvc-dev 2020-05-13 20:58:15 +00:00
Feng Cao
723ba2e82b Fix inline suggestion ref counting to not over-count
* Imagine this event sequence:
  1) the IME tries to re-attach an inline suggestion view to the
  window (e.g. because IME layout changes), it calls into the system
  server which causes recreating the backing view because it was
  destroyed earlier due to 0 ref-count (this happens under the hood
  without IME knowing it happens, so the view is still attached to
  the window).
  2) the IME receives a new inline suggestion pointing to the same
  backing view (perhaps due to filtering kicks in).
  3) the recreation from step 1 finishes, but now it will callback
  to the new inline suggestion, therefore the old view doesn't receive
  the new SurfacePackage. See RemoteInlineSuggestionUi for why.
  4) the view in step 1 is detached from window, since it never
  receives a SurfacePackage from the remote view, its detach shouldn't
  cause a reference count down on the remote view.

Test: atest android.autofillservice.cts.inline (sanity test)
Bug: 154683107

Change-Id: I2e6814ef3889de603f6e170efcb795b69ec9febe
2020-05-13 11:55:58 -07:00
Robert Carr
ebaaca1a46 SurfaceView: positionLost locking fix
positionLost can be called from CanvasContext::destroyHardwareResources
which runs asynchronously to the UI thread. This means we could be
simultaneously executing releaseSurfaces on the UI thread. We need
to expand the scope of mSurfaceControl lock in positionLost. While
we are here we add a block comment explaining the previously
undocumented locking strategy.

Bug: 156264048
Test: Existing tests pass
Change-Id: I9cdb6a0f7aeffd878f1755f240e8896f0fb8bf01
2020-05-13 18:29:59 +00:00
Matt Casey
834c0f8ea4 Allow WindowManager.TYPE_SCREENSHOT to be focusable
Pre-R, the screenshot window was used just for screenshot animation. In
R, the window is also hosting tappable screenshot actions, which require
focus.

This change modifies TYPE_SCREENSHOT to no longer force it to be
unfocusable.

Test: Verify that screenshot window UI elements can work with talkback
    and accessibility scanner.
Bug: 153517161
Bug: 152583784
Change-Id: If81d9f94dff801c3483a2d834e692b4c77d80d7b
2020-05-13 14:01:41 -04:00
TreeHugger Robot
8ae0cfe36b Merge "Increase content capture buffer size to 500 Anecdotally this should cover typical messaging first screens whereas 100 events seems to be small." into rvc-dev 2020-05-13 01:57:06 +00:00
Julian Odell
82c92bcf3c Increase content capture buffer size to 500
Anecdotally this should cover typical messaging first screens
     whereas 100 events seems to be small.

Test: make -j
Test: Manually start WhatsApp - check for lost events
Bug: 154777879
Change-Id: I3090584ec03714656948045189e0e0c068740c82
2020-05-12 23:02:55 +00:00
TreeHugger Robot
f30c225fcb Merge "Add OWNERS for display, haptics, input and power" into rvc-dev 2020-05-12 20:17:39 +00:00
Michael Wright
2e7e81c950 Add OWNERS for display, haptics, input and power
Bug: 156349083
Test: N/A
Change-Id: Ia8afccfc2e470095ae3d52c827c0ac78b7c120ae
2020-05-12 19:11:13 +01:00
lpeter
8e815316dd Fix cts fail for android.autofillservice.cts.augmented
In the test we trigger the manual autofill request programmatically,
because the focus isn't on the field, we will not get the callback
from IME.
It would be better not to ask IME for inline request if the request
is manual and the view is not focused because it's a simpler/safer
approach and manual request without focus should be rare.

Bug: 154661868
Test: atest CtsAutoFillServiceTestCases
Change-Id: I783b2542094cdea547ebd58ce89f30d9cd421708
2020-05-12 13:47:54 +00:00
Riddle Hsu
8e726a2ef7 Merge changes from topic "b147213487" into rvc-dev
* changes:
  Send fixed rotation adjustments to the associated client
  Add support to override display adjustments by token
  Add fixed rotation display adjustments
2020-05-12 09:05:17 +00:00
TreeHugger Robot
db5201d3ab Merge "Provide a fixed transform hint if the layer is in a fixed orientation 2/2" into rvc-dev 2020-05-11 23:51:56 +00:00
Rob Carr
85c13cf111 Merge "BLASTBufferQueue: Fix two conditions leading to freeze." into rvc-dev 2020-05-11 21:46:19 +00:00
Josh Tsuji
6282ff9bc2 Merge "Add TYPE_TRUSTED_APPLICATION_OVERLAY." into rvc-dev 2020-05-11 20:24:34 +00:00
Vishnu Nair
eb53e52395 Provide a fixed transform hint if the layer is in a fixed orientation 2/2
The transform hint is used to prevent allocating a buffer of a
different size when a layer is rotated. The producer can choose to
consume the hint and allocate the buffer with the same size.

Provide the graphic producer a transform hint if the layer and its
children are in an orientation different from the display's
orientation. The caller is responsible for clearing this transform
hint if the layer is no longer in a fixed orientation.

Bug: 152919661
Test: atest VulkanPreTransformTest
Test: confirm with winscope trace, buffers are allocated taking into
account the transform hint in fixed orientation scenarios
Test: go/wm-smoke

Change-Id: I2ccc21ed8af015716e6cdfde1e3cec67c99f3339
2020-05-11 13:19:59 -07:00
Riddle Hsu
d490c57905 Send fixed rotation adjustments to the associated client
So the real information of display can be adjusted according
to the adjustments for the application started with fixed
rotation transform.

The enabling adjustments may be sent in different ways:
- Launch activity
  The information is bundled with LaunchActivityItem.
- Resume activity or update non-activity window
  Send a standalone FixedRotationAdjustmentsItem.

The disabling adjustments (null) are always sent by
FixedRotationAdjustmentsItem.

Bug: 147213487
Test: AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
      TransactionParcelTests#testFixedRotationAdjustments

Change-Id: I5238888a5c8352db83fc12749f4de2bfabf46026
2020-05-11 22:17:03 +08:00
Charles Chen
5681f3e796 Merge "Add WindowMetricsHelper" into rvc-dev 2020-05-11 10:17:37 +00:00
TreeHugger Robot
488cd2c4ff Merge "Fix consumer closed input channel cause an error occurred (1/2)" into rvc-dev 2020-05-11 05:56:35 +00:00
Riddle Hsu
ca70b01302 Add fixed rotation display adjustments
If an activity is launched with fixed rotation transform,
its window layout and configuration will be rotated. But
if it gets real information from the display, the values
(getRotation, getRealSize, getRealMetric, getCutout) are
inconsistent with the actual appearance.

This change provides the basic information to adjust the
returned values.

Bug: 147213487
Test: atest DisplayAdjustmentsTests#testFixedRotationAdjustments
Change-Id: I864d5759f41209d5f93c4a9011b720675c25e765
2020-05-11 13:30:14 +08:00
TreeHugger Robot
47059f7654 Merge "Make sure AmbiguousGestureMultiplier could start from 1" into rvc-dev 2020-05-11 03:08:31 +00:00
Vishnu Nair
4880a30fe0 Remove divider view when exiting splitscreen
Remove and re add divider view as needed so we do not allocate memory
while split screen is not active. Also release surface reference from
server when we are done with the SurfaceControl so we don't have to rely
on GC to remove the last reference.

Fixes: 150190730
Test: test split screen manually, check for offscreen or onscreen
divider layers in winscope

Change-Id: I1a6a1c1d4346aafeae85aaf61ec4df23722e75ab
2020-05-08 18:10:47 +00:00
Tiger Huang
d8bb9b4dd8 Merge "Prevent unnecessary updateRequestedState" into rvc-dev 2020-05-08 13:37:42 +00:00
Joanne Chung
cdbd09bbcf Merge "Prevent crash when AutofillManager.isEnabled() is called" into rvc-dev 2020-05-08 10:14:55 +00:00
Joanne Chung
ee55616ad3 Prevent crash when AutofillManager.isEnabled() is called
If we cannot get flag information from the AutofillManagerService
after the timeout, we should not crash the process, we need to
handle the enabled information properly.

Also fix NPE because of null component name while calling
AutofillManagerServiceImpl.isWhitelistedForAugmentedAutofillLocked().

Bug: 151273845
Test: atest CtsAutoFillServiceTestCases
Test: manual. Copy the text from Messenger and paste on search bar,
no crash occurred and can paste text correctly.

Change-Id: I8d7ca35226052944fd68fef60a013a65a7fb57c1
2020-05-08 16:48:52 +08:00
arthurhung
3a057251ac Make sure AmbiguousGestureMultiplier could start from 1
If a motion event classified CLASSIFICATION_AMBIGUOUS_GESTURE, it would
multiplied the AmbiguousGestureMultiplier from configuration for the
touch slop, we have to make sure this value should be start from 1 or
the touch slop could be zero and click action may fail.

Bug: 155160957
Test: manual
Change-Id: I61e1262b4f3de61214297b678956cc14fa2f24ef
2020-05-08 13:45:05 +08:00
Joshua Tsuji
94d4c34b16 Add TYPE_TRUSTED_APPLICATION_OVERLAY.
Also, make Bubbles a TYPE_TRUSTED_APPLICATION_OVERLAY!

Test: make a permission dialog appear while bubbles appear (wait for any HUNs to go away)
Fixes: 149320322
Change-Id: Ib4b93635929cf996753a21717383c327256477b3
2020-05-07 11:48:27 -04:00
Jorim Jaggi
b3c02592e1 Merge "Cancel existing animations when detaching View" into rvc-dev 2020-05-07 11:36:11 +00:00
Tiger Huang
eb5a5920b7 Do not dispatch system UI visibility during traversal
Otherwise, mRecomputeGlobalAttributes set within the callbacks might be
cleared in the traversal.

This CL also prevents dispatching non-existing insets sources to the
client. For example, if a display doesn't have a navigation bar, the
insets state dispatched by window manager won't contain the navigation
bar source. So that WindowInsets.isVisible(ITYPE_NAVIGATION_BAR) returns
false on such display.

Fix: 155787445
Fix: 155796402
Test: atest WindowInsetsControllerTests InsetsAnimationControlImplTest
Change-Id: I3104191b34c08e14ffb31d7228c832a84629a97b
2020-05-07 18:29:52 +08:00
Tiger Huang
fbfc3abfde Prevent unnecessary updateRequestedState
If the client didn't change any insets, we don't need to update the
requested state while receiving controls. The requested state at the
server side can still be up-to-date for free.

This CL also sends the requested state to window manager if the local
state is not the same as the dispatched state.

Fix: 155752039
Test: atest InsetsControllerTest
Change-Id: I676a88d3ef823d8717d03e80261e6e7a5f7e8c5f
2020-05-07 14:01:38 +08:00
Feng Cao
254545cae5 Merge "Support re-attaching the inline suggestion view to window" into rvc-dev 2020-05-07 05:23:15 +00:00
arthurhung
03d65a7274 Fix consumer closed input channel cause an error occurred (1/2)
An input channel specifies the file descriptors used to send input
events to a window in another process. And All of the file descriptors
open in the calling process shall be closed when process terminated.

The server side could receive the socket broken event when the process
terminated, we should do the unregister channel before close the file
descriptor or do it automatically without error if there is no valid
window.

- Change the order that remove window before dispose the receiver.
- Unregister input channel when windowless window removed.

Bug: 133782251
Test: open app and exit by back key or recent apps, check if any
      error log occurs.
Change-Id: I59d0084c2c771544e7ee226ce53c574f60c6b988
2020-05-07 11:11:13 +08:00
Feng Cao
b46851c964 Support re-attaching the inline suggestion view to window
* Before this change, when the inline suggestion view is detached from
  the IME window (e.g. due to layout change), the remote view content
  will not show again even after the view is reattached to the window
  on the IME side. This patch fixes it by requesting the remote view
  owner (the ext services) for a new SurfacePackage when the view is
  re-attached to the window (see javadoc of SurfaceControlViewHost for
  why this works).
* This patch also fixes the issue where the SurfaceControlViewHost was
  never released in the ext services. This is done by notifying the
  ext services (through system server) when the view is detached from
  the IME window, and then the system server will release the
  SurfaceControlViewHost if after N(=500) ms the view is not re-attached
  to a window.
* After the SurfaceControlViewHost is released, if the view is
  re-attached to the window later, a new SurfaceControlViewHost will be
  created to back the same InlineContentView.
* The current code structure also lays a foundation for a subsequent
  change to allow reusing the same remote view for inline suggestions
  during filtering.

Test: atest CtsAutofillServiceTestCases (sanity test)

Bug: 153615023
Bug: 154683107

Change-Id: Idc587e1e82a96b792c351796464821b7aad7cd89
2020-05-06 19:30:39 -07:00
Taran Singh
e974c347fd Merge "Revert "Keeps the served view of the window when focus to the ne..."" into rvc-dev 2020-05-06 21:06:34 +00:00
Taran Singh
0dbd6c4bd6 Revert "Keeps the served view of the window when focus to the ne..."
Revert "Refine FocusHandlingTest"

Revert submission 11182377-fix_b_152373385

Reason for revert: Fix b/155781821
Reverted Changes:
If20cdb43e:Keeps the served view of the window when focus to ...
I50402165b:Refine FocusHandlingTest
Bug: 152373385
Bug: 155781821

Change-Id: I44469caf5a5ceaf247c4e6b0694da9da1f3c0eb1
2020-05-06 20:37:09 +00:00
Robert Carr
fb8ccaa1bc BLASTBufferQueue: Fix two conditions leading to freeze.
If we ask the BLASTBufferQueue to redirect a buffer in to a transaction
but then lose the buffer the app will of course eventually ANR as it
is stuck on EGLSwapBuffers. Here we fix two cases where this could have
happened:
	1. Currently if we are blast syncing and report draw is true
	we send the buffer to the WM. This is from an earlier version of
	the code and is not correct. The WM now explicitly notifies us
	if it wants to receive the buffer, and so we avoid sending it if
	it hasn't asked.
	2. We should pause the renderer in addition to fencing it
	otherwise a render thread animation frame could sneak in. We are
	right on the verge of kicking off a new frame so this shouldn't
	have much impact besides ensuring overlapping frames don't
	confuse our transaction logic.

Bug: 155300507
Test: Existing tests pass.
Change-Id: I816d806da6c09ae12734de8909c0e61af433f93f
2020-05-06 12:25:25 -07:00
Jorim Jaggi
31e5254daf Cancel existing animations when detaching View
Test: WindowInsetsAnimationSynchronicityTests#testShowAndHide_renderSynchronouslyBetweenImeWindowAndAppContent * 100 times
Fixes: 155602643
Change-Id: I6f736357f5a67c01a29b2c531026a3a76c321003
2020-05-06 20:36:08 +02:00
Tony Huang
e13e2229ce Merge "Aviod divider surface memory allocated after boot" into rvc-dev 2020-05-06 04:39:14 +00:00
Yuncheol Heo
d1cfb337cf Merge "Revert "Notify the visibility change to update color views without control."" into rvc-dev 2020-05-05 22:56:42 +00:00
Yuncheol Heo
11df7e13a8 Revert "Notify the visibility change to update color views without control."
This reverts commit 02d3a8ad07.

Reason for revert: the original change caused the infinite message loop.
Bug: 155794233

Change-Id: I3d72541cd51cd8b16ce4f44124d486b4615b09da
2020-05-05 22:56:27 +00:00
Tony Huang
0f8981d9b1 Aviod divider surface memory allocated after boot
The divider surface buffer will be allocated even if the user does
not enter split mode. Avoid it by only copy surface when it show and
release it when it hidden.

Bug: 150190730
Test: reboot and check adb shell dumpsys SurfaceFlinger
Change-Id: Id70a2626b2a921cff6243d992c6b053e329ef92b
2020-05-05 18:52:14 +08:00