Commit Graph

14288 Commits

Author SHA1 Message Date
Jorim Jaggi
ee54070608 Re-apply local client state when leash changes
When leash changes, we need to re-apply our local state, to ensure
new leash has same state as before and new leash is visible on
screen.

Test: Switch IME while open
Test: SurfaceControlTest
Fixes: 152876819
Change-Id: Ieae1aecdc3ddc427ccb89c4aa7ef7ae9283f39eb
2020-04-07 23:04:44 +00:00
Steven Thomas
2845ad86a4 Merge "Add frame rate flexibility token" into rvc-dev 2020-04-07 18:20:36 +00:00
TreeHugger Robot
bd745f763a Merge "Expose Display.getType() via TestApi." into rvc-dev 2020-04-07 16:41:47 +00:00
TreeHugger Robot
77d7bcc124 Merge "Update controls after addToDisplay/relayout before dispatching insets" into rvc-dev 2020-04-07 16:26:53 +00:00
Santos Cordon
29d5b8f43e Expose Display.getType() via TestApi.
Bug: 151124371
Test: atest android.display.cts.DisplayTest
Change-Id: Id3c25fe675c1fa2b0070cf95736c608315b5e26b
2020-04-07 09:56:16 +00:00
Tiger Huang
0426a33650 Update controls after addToDisplay/relayout before dispatching insets
A window might request to control insets before it is added to WM and
expect the first dispatched WindowInsets as requested.

The first insets state returned from addToDisplay or relayout might be
not expected if the window just become thecontrol target in the
function.

With this CL, WM can return controls from addToDisplay and relayout, so
that the client can apply controls immediately, and update controlled
insets sources before dispatching the insets to the view hierarchy. This
enaures the insets dispatched are up-to-date.

Fix: 150756571
Test: atest WindowInsetsControllerTests RelayoutPerfTest
            WindowAddRemovePerfTest
Change-Id: Ib78c24beb7af5a54ad78935c3ddb260ef9645212
2020-04-07 16:05:40 +08:00
Sally Yuen
3987ae1ad8 Merge "Make the system action API more clear with documentation" into rvc-dev 2020-04-06 23:54:03 +00:00
TreeHugger Robot
7a851ba728 Merge "SurfaceView: Use BLAST transaction when visibility changes." into rvc-dev 2020-04-06 20:31:47 +00:00
Rob Carr
0e22967d6c Merge "SurfaceView: Ensure we don't fill unused BLAST Transaction." into rvc-dev 2020-04-06 20:02:13 +00:00
Jorim Jaggi
a775f45d85 Merge "Revert "Revert "Defer updating InsetsSource.mFrame while animating""" into rvc-dev 2020-04-06 14:27:16 +00:00
Jorim Jaggi
33a2183d4b Revert "Revert "Defer updating InsetsSource.mFrame while animating""
This reverts commit 8c56ac6b94.

Underlying issue has been fixed:

Test: InsetsControllerTest
Bug: 152071027
Change-Id: I2b80de7067bf688a6b36233b9a1e92e2cf31c148
2020-04-06 14:28:59 +02:00
Tony Huang
a171ec4203 Merge "Fix split divider janky" into rvc-dev 2020-04-06 07:24:15 +00:00
Steven Thomas
6ec6fbc2cc Add frame rate flexibility token
Add support for temporarily relaxing frame rate restrictions in surface
flinger. This is used by CTS tests to get a consistent device state
while running frame rate tests.

Bug: 148033900

Test: - On a Pixel 4, I turned the brightness down and covered the
ambient light sensor, causing the display manager to set a frame rate
restriction. I ran the frame rate CTS test without these CLs applied,
and confirmed the test failed because surface flinger couldn't switch
frame rates, as expected. Then I ran the tests with the CLs applied, and
confirmed the tests pass.

- I confirmed that, without adopting shell permission identity, the CTS
test is denied the request to acquire a frame rate flexibility token. So
normal apps won't be able to access this.

Change-Id: Ie2b611cf5726c14a7a22e315a85bf6200d190682
2020-04-04 19:55:00 -07:00
Robert Carr
92e08bf997 SurfaceView: Ensure we don't fill unused BLAST Transaction.
If BLAST is enabled and we somehow end up in positionLost or
setParentSpaceRectangle without having called setUseBLASTSyncTransaction
we will end up putting operations in to a Transaction which will never be
applied. This condition should be considered a bug, but it's best to
defend against it. To compensate, rather than checking the global
use BLAST flag, we check if the current draw is actually using
BLAST.

Bug: 152663327
Bug: 152780239
Test: Existing tests pass
Change-Id: I3c05b83400b59be82a339933fc8ef1382d4f0e21
2020-04-03 15:07:35 -07:00
Rob Carr
73e4cc48c7 Merge "BLASTBufferQueue: Fix unnecessary copying of Surface" into rvc-dev 2020-04-03 21:48:08 +00:00
TreeHugger Robot
59a65bdc0f Merge "Revert "Fix DecorView error about non-visual context"" into rvc-dev 2020-04-03 19:53:56 +00:00
Rob Carr
0bed41a993 Merge "BLASTBufferQueue: Avoid unnecessary transactions" into rvc-dev 2020-04-03 19:04:42 +00:00
Vadim Tryshev
5420fffe19 Revert "Fix DecorView error about non-visual context"
This reverts commit 828c498904.

Reason for revert: b/152806048
Bug: 152806048

Change-Id: I0ba53944a7fddf42cccf79c6495945c8afa3ab31
2020-04-03 18:06:05 +00:00
Robert Carr
59773cbdd4 SurfaceView: Use BLAST transaction when visibility changes.
If visibility changes we will try and hide the Surfaces from
the RT. We want to sync this with ViewRoot drawing so
we enable BLAST sync for the next frame in this case.

Bug: 152663327
Bug: 152780239
Test: Existing tests pass
Change-Id: I9cd157954a3ce87a8f95a7be97d6d5c7f324327b
2020-04-03 17:12:58 +00:00
sallyyuen
ca5c921416 Make the system action API more clear with documentation
Bug: 149755168
Test: N/A
Change-Id: I2c82ce755d3c94d0514f49da0cc770c83dafbad1
2020-04-03 09:23:29 -07:00
TreeHugger Robot
37b8baa3a8 Merge "Only track focused next served view in onViewFocusChanged" into rvc-dev 2020-04-03 15:51:28 +00:00
Robert Carr
1dd148d9ac BLASTBufferQueue: Fix unnecessary copying of Surface
When we call mSurface.transferFrom(getOrCreateBLASTSurface()) we
always end up incrementing mSurface.generationId, because
BLASTBufferQueue.java::getSurface will always return a new native
wrapper object. We had a similar situation with
mSurface.copyFrom(mSurfaceControl), and had to build IGBP
comparison in to the native method. Here though, it's easier
to just rely on the stability of the Surface (never changes
for the lifetime of the BLASTBufferQueueAdapter) to avoid
duplicate calls to transferFrom.

Bug: 152501005
Test: Existing tests pass.
Change-Id: I64b9a6ae3cabfa75974e040460638417bfac6845
2020-04-02 15:29:34 -07:00
Robert Carr
cb250de686 BLASTBufferQueue: Avoid unnecessary transactions
Currently every call to getOrCreateBLASTSurface produces a transaction.
This transaction has two parts, both of which can be eliminated:
	1. The first is the reparent. This was written when the
	client allocated the BLAST SurfaceControl, but now the WM
	allocates it and it has the correct parent to start, so
	we can just eliminate this.
	2. Showing the surface. We can eliminate this by just showing
	the surface by default.

Bug: 152501055
Test: Flip BLAST flag. Play.
Change-Id: If6e28e9153a09909fb3bb061980deb82c132dd5a
2020-04-02 12:28:36 -07:00
Adrian Roos
56f4b1b9d3 Merge "WindowInsetsAnimation: Fix app driven closing of IME" into rvc-dev 2020-04-02 13:41:46 +00:00
Adrian Roos
f5a0f80fe2 Merge "WindowInsetsAnimation: Synchronously dispatch window insets animation callbacks" into rvc-dev 2020-04-02 13:41:46 +00:00
Jorim Jaggi
d80aee2ed8 Merge "WindowInsets: Ignore consumeStableInsets()" into rvc-dev 2020-04-02 11:21:22 +00:00
Jorim Jaggi
ea4fe825b7 Merge "Request fit system windows if soft input mode updates" into rvc-dev 2020-04-02 10:56:27 +00:00
Jorim Jaggi
fe2228aa89 Merge "Initialize sourceless insets with Insets.NONE" into rvc-dev 2020-04-02 10:55:38 +00:00
Feng Cao
257aa916ac Merge "Define custom equals method for bundles in the inline APIs" into rvc-dev 2020-04-02 02:47:01 +00:00
Rob Carr
f2f056ef71 Merge changes I98b51b43,I03cb69e1 into rvc-dev
* changes:
  InsetAnimationThreadControlRunner: Don't copy controls
  InsetsSourceConsumer: Release directly
2020-04-01 22:43:59 +00:00
Adrian Roos
6a4448f0f8 WindowInsetsAnimation: Synchronously dispatch window insets animation callbacks
Test: atest WindowInsetsAnimationControllerTests
Bug: 152617481
Change-Id: Ie002f2e605f841563d8c2669f949be3ddd666146
2020-04-01 21:30:17 +00:00
Jorim Jaggi
6f2ccea9f9 Initialize sourceless insets with Insets.NONE
...in order to make WindowInsets.equals consider source missing
and source not providing insets the same.

Fixes: 152822955
Test: InsetsAnimationTest
Change-Id: I31cb0278f45c38fb788d4f2bdefb1a13b6870216
2020-04-01 22:00:39 +02:00
Feng Cao
59b682f5cd Define custom equals method for bundles in the inline APIs
Test: atest android.view.inputmethod.cts
Bug: 152811052

Change-Id: I15051493bb37f05b579b16d6e7fee36b05ab10cc
2020-04-01 12:46:15 -07:00
Selim Cinek
a2b1d3753b Added back the recently alerted indicator to conversations
Previously this was dropped, it's now reintroduced.

Fixes: 150905003
Test: atest SystemUITests
Change-Id: Ia152bc4117fa9c656b3d477ef8e50708e1056148
2020-04-01 11:40:57 -07:00
Selim Cinek
4237e8277a Reintroduced app ops for conversation notifications
Previously app ops weren't showing in conversation notifications
Also made sure that they show in case the app name is long.
Additionally this fixes the coloring of the sender name.

Fixes: 150905003
Test: atest SystemUITests
Change-Id: Iae8026e7efdec8c207d1984dac4ee089abe116b9
2020-04-01 11:40:54 -07:00
Adrian Roos
3b19ff1e0f WindowInsetsAnimation: Fix app driven closing of IME
When using controlWindowInsetsAnimation to close the IME,
delay reporting this to the IME until the animation is actually
finished. Otherwise, the IME will self-hide and start a transition
that breaks the just-begun app-driven transition.

(Regression from I7f6098a61a5942795ffd33a60329e4dd5fb5d6cb which
changed InputMethodService to hide itself in reponse to notifyHidden)

Bug: 151980214
Test: make WindowInsetsTests, ensure that dragging the IME closed doesnt get cancelled
Change-Id: If4e64cc78742a4e1e8c98137bd97d65dd567f674
2020-04-01 18:28:13 +00:00
Jorim Jaggi
526632d15f Merge "Fix missing finish callback to fix running animation leak" into rvc-dev 2020-04-01 16:13:54 +00:00
Jorim Jaggi
c5c829f675 Request fit system windows if soft input mode updates
To make sure legacy insets are correct always.

Test: Open Message, go to attachments, reopen IME
Bug: 152851108
Change-Id: I9ae0930645ca4331d362af7db9ab77bf49d74edc
2020-04-01 15:48:17 +02:00
Jorim Jaggi
f103588cc1 Fix missing finish callback to fix running animation leak
Make sure finish callback gets called when
applyChangeInsets gets called synchronously from
scheduleApplyChangeInsets

Bug: 152071027
Test: InsetsAnimationControlImplTest
Change-Id: I6808b3527f1d2e15de681c5260208d238dcf53e2
2020-04-01 14:50:59 +02:00
Adrian Roos
9ab688d487 WindowInsets: Ignore consumeStableInsets()
With the introduction of insets types we no longer support consuming
individual insets.

Instead we consumed all insets, regardless of whether you consumed
stable or system insets - but that led to compat issues.

On Q, consumeStableInsets was almost always a no-op anyways, because
stable insets already came pre-consumed during dispatch.

This change makes consumeStableInsets() a no-op to more closely match
that behavior.

Bug: 152033222
Test: atest WindowInsetsTest
Change-Id: Ic48ee7386320fc16449ac79435b69305a8132bf8
2020-04-01 14:26:24 +02:00
Tony Huang
89d580c056 Fix split divider janky
The janky caused by SurfaceFlingerVsyncChoreographer does not work
reliably. Sometimes it didn't update but sometimes update twice per
frame so cause janky.

Fix this by removed using SurfaceFlingerVsyncChoreographer and use
real surface flinger sync signal to update screen.

Bug: 150874701
Test: enter split mode and drag divider to observer janky
Change-Id: I5a8bce36738a97b0ddaf4c4e77949eb5295b4894
2020-04-01 19:07:49 +08:00
Feng Cao
edb332c645 Replace Nullable bundle with NonNull and use Bundle.EMPTY
Test: atest InlineSuggestionsRequestTest
Bug: 152525467

Change-Id: Ie510e08ced8be4cc8df486f1acfa6eb330d194ef
2020-03-31 14:50:51 -07:00
Robert Carr
53be42a75d InsetAnimationThreadControlRunner: Don't copy controls
The controls are copied previously in collectSourceControls and
so this copy is unnecessary.

Bug: 150805473
Test: Existing tests pass
Change-Id: I98b51b4372ace95036e25e806d1ab646d2df7879
2020-03-31 14:44:36 -07:00
Robert Carr
4c101c3f68 InsetsSourceConsumer: Release directly
Since we copy the InsetSourceControl to the animation
runner, we don't need to release the InsetsSourceConsumer
copy from the render thread, as it wont be used there.

Bug: 150805473
Test: Existing tests pass.
Change-Id: I03cb69e17e036237410472e8b4601b61fc40bc0e
2020-03-31 14:43:25 -07:00
TreeHugger Robot
c068acb6ae Merge "Add @UnsupportedAppUsage to the old inline APIs for compatibility" into rvc-dev 2020-03-31 21:23:09 +00:00
Selim Cinek
9bad85af2b Merge changes I0d79642d,If8756ac8,I29e73897,Ia8c5121a,I533b8f06 into rvc-dev
* changes:
  Indented the conversation action list
  Fixed some issues where conversation badges would not be visible
  Improved the animations of the conversation badges
  Important conversations now also transform into the shelf
  Adapted Shelf algorithm to also use conversation icons
2020-03-31 20:02:01 +00:00
Ming-Shin Lu
c7424a2848 Only track focused next served view in onViewFocusChanged
When introduced ImeFocusController, we originally would like to
resolve CL[1] enabling IMM#focusOut issue to archieve auto-hide IME when
no more view with focus.

However, some problems that we end up to disable because:
 1) Bug 152230171 shows the current view focus may be cleared temporary
    when in touch mode, closing input at this moment isn't the right way.

 2) Bug 148974380 hits a case when tapping SearchView which is inside
    of ListView, several focus in/out events comes up and may break input
    connection unexptectly because wheather the next served view is no longer
    coming or not is unpredictable from this callback.

    Even we fixed the issue with CL[2] to tweak the next served view as
    null only when the current served view lost focus, we still can't
    guarantee that input connection won't break when current served view
    lost focus by moved to other focusable view (e.g. popup window)

 3) Setting the next served view as null when no more served view should
    be handled more conservative in other special events
    (e.g. view detached from window or the window dismissed).

[1]: I2228ae0c48ad3d9e0b55875f0dcb5ef8c55b0c5f
[2]: I9e90428387fcf43fbf86a8407de7535913202872

Bug: 152698568
Test: atest FocusHandlingTest
Change-Id: I6e38c4425233cea4b0a90285a2dc476b76c20979
2020-04-01 02:51:13 +08:00
Adrian Roos
53989971bf WindowInsetsAnimationController: Fix minor API issues
- make sure we only dispatch the controller in onCancelled after the app has seen onReady
- return a linearly interpolated getFraction() if there is no interpolator instead of -1

Bug: 118118435
Test: atest WindowInsetsAnimationControllerTests
Change-Id: Iccd0b6246b4cdc250f3111409821c1dac53c694e
2020-03-31 17:48:52 +02:00
Feng Cao
77636e89d0 Add @UnsupportedAppUsage to the old inline APIs for compatibility
Test: manually tested
Bug: 152799973

Change-Id: I6fed3fdbb9d3d872de8ed3bde8cbf45f5826975f
2020-03-30 23:08:21 -07:00
Svet Ganov
5baa279868 Properly layout InlineContentView
bug:152723089
bug:152319052

Test: atest android.view.inputmethod.cts.InlineSuggestionTest

Change-Id: I656c2fb75560719210aa1efe8b9f06a0ced4d7e0
2020-03-31 03:37:24 +00:00