Commit Graph

14494 Commits

Author SHA1 Message Date
TreeHugger Robot
cc4f13e0ab Merge "Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView" into rvc-dev 2020-06-02 20:54:18 +00:00
Rob Carr
28fdf609dc Merge "SurfaceView: Lock mDeferredDestroySurfaceControl" into rvc-dev 2020-06-02 19:27:08 +00:00
Robert Carr
6ce9ffb2cd SurfaceView: Lock mDeferredDestroySurfaceControl
Since mDeferredDestroySurfaceControl is the same underlying
object as mSurfaceControl we also need to hold the mSurfaceControlLock
when writing to it.

Bug: 157657896
Test: Existing tests pass
Change-Id: Ie0da3ed5d94c7aae2593423fa2767dbc902da4c8
2020-06-02 18:11:51 +00:00
TreeHugger Robot
46c51b716d Merge "Exception if receive move withouth down" into rvc-dev 2020-06-02 17:40:24 +00:00
Joanne Chung
fbc89efee3 Fix AugmentedAutofillService onFillRequest() wrong focused AutofillId for WebView
When AutofillManagerService try to trigger AugmentedAutofill, it uses
AutofillId.withoutSession() to get the AutollId without session. It
will return invalid "parentId:NO_ID" if the virtual AutofillId is
created with FLAG_IS_VIRTUAL_INT. The virtual AutofillId flag should
be FLAG_IS_VIRTUAL_INT or FLAG_IS_VIRTUAL_LONG, we should get
mVirtualIntId for FLAG_IS_VIRTUAL_INT or mVirtualLongId for
FLAG_IS_VIRTUAL_LONG.

Bug: 156408900
Test: atest android.autofillservice.cts.augmented
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Long_withoutSession
Test: atest android.view.autofill.AutofillIdTest#\
testVirtual_Int_withoutSession
Test: Manual. Write a simple cts test for webview and check the
focused AutofillId is correct while switching between the field.

Change-Id: I7ebb4d7cfb6d6f383724b798dae69269ae3a27be
2020-06-03 01:06:24 +08:00
arthurhung
a0a20dc23b Exception if receive move withouth down
Throw an IllegalStateException if recevie touch move without down,
that could give an explicit feedback about GestureDetector may not
receive the full touch stream.

Bug: 149578486
Test: manual
Change-Id: I644ec1bebbca66dd0f0c219b63a6478b1290d1e1
2020-06-02 10:27:11 +08:00
TreeHugger Robot
1b2dfb04c8 Merge "Remove additional sf transaction when constructing a leash" into rvc-dev 2020-06-01 23:41:12 +00:00
Evan Rosky
82352f9db8 Merge "Use boundsChangeTransaction to improve split-screen enter/exit" into rvc-dev 2020-06-01 22:55:20 +00:00
Steven Thomas
061dec3e8d Merge "Clarify FRAME_RATE_COMPATIBILITY_* params" into rvc-dev 2020-06-01 20:44:30 +00:00
Evan Rosky
3613854d1b Use boundsChangeTransaction to improve split-screen enter/exit
Uses applySyncTransaction to synchronize all the surface
updates during split-screen enter/exit.

In Divider, all syncTransactions are serialized and runnables
can be posted to operate on the returned transactions so
they happen all at once.

This also required adding a "merge" functionality on
WindowContainerTransactions to handle racing between rotation
and other in-flight sync transactions (because they are
serialized, sometimes they got delayed).

Bug: 153579514
Test: Enter/exit split-screen and observe no flickers
Change-Id: I57df13489247f3c4fb3ca59efa26867a872e447f
2020-06-01 11:33:27 -07:00
Ahaan Ugale
4d8efece25 Merge changes from topic "Data Share Sender Crash" into rvc-dev
* changes:
  Handle sender's crash in Data Share API
  Add finish() method to DataShare Read and Write Adapters
2020-05-29 23:32:48 +00:00
Vishnu Nair
06cff30935 Remove additional sf transaction when constructing a leash
The leash needs to be visible on creation otherwise when reparenting
the leash, the leashed layer may be hidden for a moment. This is because
Transaction#show can be deferred but Transaction#reparent cannot.

This change adds a layer flag to allow creating effect layers without
a color fill so we can avoid an additional sf transaction.

Fixes: 157646690
Test: go/wm-smoke
Test: atest SurfaceFlinger_test
Change-Id: I3d8a4f4820d7b8fb05daab697c25cff8def612c1
2020-05-29 21:59:24 +00:00
Yara Hassan
dc699fb8ce Add finish() method to DataShare Read and Write Adapters
The finish() method is used to clear hard references after
the data copy has ended. This fixes a bug where the references are cleared before onError() is attempted to be called.

Test: CTS tests in followup CL
Bug: 157136368
Fixes: 157136368
Change-Id: If924fe388762831af90579e6b00bdf223230e203
2020-05-29 14:35:13 -07:00
Ahaan Ugale
974c3114dc AF Inline: Notify the registered AutofillCallback, also fix filtering.
This is missing notifications on the suggestions being hidden/shown
while filtering, but that is a bit harder to solve as we have to pipe
this state back from AutofillInlineSessionController. (although, I'm not
certain we even want this behavior, however it is inconsistent with the
dropdown behavior for now)

See bugs linked for what is fixed for filtering (some are not marked as
fixed as they still might need cts tests).
The main change is to make the privacy protection mechanism a bit
smarter - it now only applies to text-matching based logic.

Fix: 157763435
Fix: 156930859
Bug: 155517211
Bug: 157762527
Test: atest CtsAutoFillServiceTestCases:DatasetFilteringInlineTest \
  CtsAutoFillServiceTestCases:InlineFilteringTest \
  CtsAutoFillServiceTestCases:DatasetFilteringDropdownTest
Test: atest android.autofillservice.cts.inline
Change-Id: Icf94e21ba0df3b15a32454038772967cc1f6da79
2020-05-29 14:12:27 -07:00
Steven Thomas
fbf3b3139c Clarify FRAME_RATE_COMPATIBILITY_* params
Bug: 155894036
Test: n/a
Change-Id: I4e9f1a293c19d1d8475d1173d58637ea018c25cf
2020-05-28 14:30:00 -07:00
Louis Chang
77db95ce85 Merge "Revert "Only add divider when it need to show"" into rvc-dev 2020-05-28 14:45:46 +00:00
TreeHugger Robot
9cf7941324 Merge "Insets: Allow animations when setting SYSTEM_UI_LAYOUT_* flags" into rvc-dev 2020-05-28 14:14:15 +00:00
Adrian Roos
2e2631572a Insets: Allow animations when setting SYSTEM_UI_LAYOUT_* flags
Test: atest android.server.wm.WindowInsetsAnimationTests#testAnimationCallbacks_withLegacyFlags
Fixes: 155955734
Change-Id: Idb35218abb4e17688bfb985abb97ae739a60136b
2020-05-28 14:33:38 +02:00
Louis Chang
bf1a597b20 Revert "Only add divider when it need to show"
This reverts commit 91bba497c3.

Reason for revert: unblock wm presubmit

Fix: 157629296

Change-Id: I04fd8b79de025d7c531ac03218a7590e6a32e1be
2020-05-28 09:43:53 +00:00
Tony Huang
8acb04e235 Merge "Only add divider when it need to show" into rvc-dev 2020-05-28 04:26:37 +00:00
Adrian Roos
792dc29a6e Merge "InsetsController: Maintain type user animation when restarting input" into rvc-dev 2020-05-27 18:09:16 +00:00
Adrian Roos
c7577d48c0 Merge "InsetsController: Add missing onWindowInsetsAnimationEnd when cancelling" into rvc-dev 2020-05-27 18:08:19 +00:00
Heemin Seog
58169786a6 Merge "Add climate bar insets" into rvc-dev 2020-05-27 15:38:32 +00:00
Taran Singh
e20c25ddc6 Merge "Add Insets dumps and IME debug logs" into rvc-dev 2020-05-27 15:12:30 +00:00
Taran Singh
85661e3f9e Add Insets dumps and IME debug logs
Add more dumps and logs to better help debug IME insets better
Logging can be enabled by setting InsetsController.DEBUG to true.

Bug: 154348613
Test: manually build and flash.
      Verify showing and hiding IME shows logs.
      verify adb shell dumpsys window windows has new dumps

Change-Id: Iad0a21d81a22d6acfaaf5c5ca8b5131eec411e79
2020-05-27 15:12:07 +00:00
Tony Huang
91bba497c3 Only add divider when it need to show
By previous memory patch, the divider will always call update when
enter split when means it always add divider view when showing. So
we can reduce some update call to avoid any unnecessary surface
memory allocate.

Fix: 150190730
Test: Check split mode rotate normally and dump SF to check divider
      memory status
Change-Id: Ibccd0b998d299968ee6d68127c801fae656d2127
2020-05-27 11:25:05 +08:00
Heemin Seog
d79e4f49d2 Add climate bar insets
This can be used to support a 3rd kind of system bar to inset the
applicaiton space.

Bug: 152763889
Test: manual
Change-Id: I3ba75886e94a9fe80a0d1a920749d152dda64031
2020-05-26 14:26:25 -07:00
TreeHugger Robot
58c7846f6a Merge "WindowlessWindowManager: Set size when creating surface" into rvc-dev 2020-05-26 20:41:22 +00:00
Adrian Roos
a2d2ba7e61 InsetsController: Maintain type user animation when restarting input
When the IME restarts input, it re-requests to show itself. If the app is
already animating, we should maintain that animation instead of cancelling
it.

Fixes: 155962435
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I57618e43b2cddc55e5dfc32111abbbd82cc6ed48
2020-05-26 20:22:05 +00:00
Adrian Roos
a79b8851f7 InsetsController: Add missing onWindowInsetsAnimationEnd when cancelling
Fixes a few issues around cancelling insets animations:

- dispatch the onEnd callback when the animation gets cancelled
- When using the CancellationSignal, we need to properly cancel the
  animation, and not just the controller - otherwise we never actually
  remove it from mRunningAnimations.
- Now that cancellation dispatches to apps, make sure they do not
  restart a different animation of the same type we just cancelled

Bug: 156740834
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I4c36470a816ff8e3b92cd03090b8e947a2234f13
2020-05-26 21:26:25 +02:00
Robert Carr
5d9d2ddca2 WindowlessWindowManager: Set size when creating surface
When we set the buffer size from relayout window, there is a race
condition where the client may then submit its first buffer but the
transaction hasnt applied yet on the SF side and so the buffer is
rejected. Setting a defualt size when creating fixes this. Luckily
SurfaceControlViewHost size is known at add time, since we force the
window size based on the values passed in to the SurfaceControlViewHost API.

Bug: 157153874
Test: Existing tests pass
Change-Id: I2566844aea81df92f1694f43254a480fc3b3c019
2020-05-26 11:29:39 -07:00
Hongwei Wang
047a550900 Merge "Ignores entering PiP animation on seamless rotation" into rvc-dev 2020-05-21 03:12:56 +00:00
Hongwei Wang
f4e4bab403 Ignores entering PiP animation on seamless rotation
- Added onFixedRotationStarted/onFixedRotationFinished callback in
  DisplayWindowListener
- onFixedRotationStarted shall be called before onTaskAppeared for PiP
- When onTaskAppeared is received in PipTaskOrganizer, we defer the
  entering PiP transition if fixed rotation is ongoing
- When onFixedRotationFinished is received in PipTaskOrganizer and the
  entering PiP transition is deferred, schedule an immediate
  transition to PiP to make sure all the expected callbacks from
  PipTaskOrganizer are still being sent

Video: http://go/recall/-/aaaaaabFQoRHlzixHdtY/bb8HjJvMZKtpN8YTPKZXmj
Bug: 153861223
Test: manually enter PiP from Play Movies / YT fullscreen
Test: atest ActivityRecordTests \
            RecentsAnimationControllerTest \
            ActivityTaskManagerServiceTests \
            PinnedStackTests
Change-Id: I0dea905d610e2387af56b611be5f93518cc9a153
2020-05-20 17:34:17 -07:00
Tiger Huang
090ee6ff39 Merge "Dispatch the requested visibility if the client has the control" into rvc-dev 2020-05-20 14:36:30 +00:00
Julian Odell
4946555a8e Merge "Flush buffered data when session connects. Typically this data would have been flushed at the end of the first draw and there would otherwise be an extended delay before the data would be sent to the service." into rvc-dev 2020-05-19 22:22:30 +00:00
Julian Odell
ef928f8a11 Flush buffered data when session connects.
Typically this data would have been flushed at the end of the
   first draw and there would otherwise be an extended delay
   before the data would be sent to the service.

Test: make -j
Test: Manually start WhatsApp - check for lost events
Test: atest CtsContentCaptureServiceTestCases

Bug: 154777879
Change-Id: Ia0a97e24ffcc1c189d5d0cd6b8888678fa48968e
2020-05-19 12:30:57 -07:00
Tiger Huang
2ab590a4b8 Dispatch the requested visibility if the client has the control
Otherwise, we would think its visibility needs to be cleared.

This CL:
- reverts parts of eb5a5920b7,
- prevents sending redundant MSG_DISPATCH_SYSTEM_UI_VISIBILITY, and
- cancels clearing visibility if a new reversed visibility is set.

Fix: 156994866
Test: atest --iterations 100 LayoutTests#testAddingImmersiveWindow
      atest WindowInsetsControllerTests InsetsAnimationControlImplTest
Change-Id: I8b8b7541523c0a94daf336f3be415aa5fa3f33da
2020-05-19 22:07:04 +08:00
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