Commit Graph

14265 Commits

Author SHA1 Message Date
TreeHugger Robot
37b8baa3a8 Merge "Only track focused next served view in onViewFocusChanged" into rvc-dev 2020-04-03 15:51:28 +00: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
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
Selim Cinek
79d9863ebc Adapted Shelf algorithm to also use conversation icons
Previously the algorithm would only work with a header
and the icon wouldn't transform into the shelf.
This is now fixed.

Bug: 150905003
Test: add conversation notification, observe normal transition
Change-Id: I533b8f06bee29ee93888d748808b4313fef338e8
2020-03-30 16:18:09 -07:00
Jorim Jaggi
684afc926d Merge "Revert "Defer updating InsetsSource.mFrame while animating"" into rvc-dev 2020-03-30 21:21:25 +00:00
Hongwei Wang
6173317ad8 Merge "Save reentry bounds from SysUI" into rvc-dev 2020-03-30 18:23:19 +00:00
Jorim Jaggi
8c56ac6b94 Revert "Defer updating InsetsSource.mFrame while animating"
This reverts commit 2751c29414.

Reason: Broken logic

Test: Open IME in Messages
Fixes: 152695319
Change-Id: I6a63f20c6342d4284a5da99e39e8f835028a5b6b
2020-03-30 19:22:37 +02:00
TreeHugger Robot
c322ed2173 Merge "Fix flickers when changing control" into rvc-dev 2020-03-30 11:45:54 +00:00
TreeHugger Robot
8927986f3b Merge "Fix DecorView error about non-visual context" into rvc-dev 2020-03-30 07:20:00 +00:00
Adam He
5a3a3f2239 Merge "Migrate android.view.inline to android.widget.inline" into rvc-dev 2020-03-30 06:53:35 +00:00
Charles Chen
828c498904 Fix DecorView error about non-visual context
This error showed because DecorContext uses application context
to get WindowManager. This CL changes to use context to do so.
Also rename fields in DecorContext because we actually can pass any
context in "activityContext."
Note that most cases of misuse WindowManager is covered by [1].
We can guarantee that WindowManager can be obtained by mContext.

[1]:I52aa0c4a02b7da018aa10f1473e1616564296e41

Bug: 150632074
Test: manual - enable strict mode and check the error log not shown.
Test: atest DecorContextTest
Change-Id: I558a2819e5928a802b897a130cfc3262115b9935
2020-03-30 11:24:48 +08:00
Adam He
f27433af0f Migrate android.view.inline to android.widget.inline
Old APIs are kept and marked as @hide + @removed to maintain
compatibility.

Bug: 151262653
Test: manual verification
Change-Id: Ia50a1f87c194211be5256e948d43fb54c1cbf941
2020-03-29 17:29:32 -07:00
Sergey Volnov
5532c77904 Store hard refences in a static context and pass through only weak
references during the Content Capture Sharing.

Motivation: if the remote app is killed, we don't want a possibility of
system server holding a stroing reference (through a reference chain)
to large objects in that app. Therefore what's send in the binder has to
be a weak reference. And we will store a hard reference to those objects
in the client app's static context.

Storing hard references to objects in system_servier is less critical, because that is not going to be killed.

Bug: 148265162
Test: covered by CTS tests
Change-Id: Ie561aab6019d191cf8659fb350e045089e7781ed
(cherry picked from commit 13f65b2974)
2020-03-29 12:50:41 +00:00
TreeHugger Robot
a8d6a321d3 Merge "Allow autofill to request show soft IME through InputMethodManager" into rvc-dev 2020-03-28 03:46:40 +00:00
Feng Cao
43c2043e2d Allow autofill to request show soft IME through InputMethodManager
* So that autofill manager service can use it to control the IME
  visibility to better support the inline suggestion workflow

Test: m -j, also manually verify with local changes
Bug: 152082216

Change-Id: I5c4b236bedeced8ff714090effce46161ee1170a
2020-03-27 18:54:29 -07:00
Steven Thomas
b2e92b6a5a Merge "Clean up some formatting problems in the setFrameRate sdk docs" into rvc-dev 2020-03-27 23:00:22 +00:00
Chris Li
c64d21d47a Merge "Report incorrect context usage in ViewConfiguration" into rvc-dev 2020-03-27 20:19:15 +00:00
Jorim Jaggi
49b9f6c67c Fix flickers when changing control
- Do not reset system bar visibility when changing control target
- Do not apply hide transaction when gaining control, because that
may result in a single-frame flicker because it will conflict with
the animation
- Check requestedVisible instead of InsetsState.isVisible in
DecorView to avoid drawing the bar backgrounds transiently
- Abort transient mode when focused win changes.

Bug: 150195782
Bug: 152014877
Change-Id: I8bc9cdc89ce7364984ade8146e12a706ad5e8edb
2020-03-27 20:11:31 +01:00
Galia Peycheva
66b1dfe6aa Merge "Change TYPE_DREAM logic to use ACTIVITY_TYPE_DREAM" into rvc-dev 2020-03-27 18:34:49 +00:00
TreeHugger Robot
d347c7acaf Merge "Moving the NO_SESSION_ID constant from ContentCaptureSession to ContentCaptureManager" into rvc-dev 2020-03-27 18:23:33 +00:00
Hongwei Wang
221fe3d905 Save reentry bounds from SysUI
On the other hand, since we won't be able to get the callback from
TaskOrganizer when an activity (used to be in PiP mode) is removed,
reset of the reentry bounds is kept in WM.

Bug: 152549281
Test: manually enter/exit PiP
Change-Id: I8b4b7f87c4a7601d8bdf32af8105a68450012a87
2020-03-27 11:10:12 -07:00
Jorim Jaggi
ac30aafd29 Merge "Make caption a insets source" into rvc-dev 2020-03-27 17:27:01 +00:00
Mihir Patel
6f33b10ab5 Moving the NO_SESSION_ID constant from ContentCaptureSession to ContentCaptureManager
Bug: 150599209
Test: manual
Change-Id: I3e7b67cf92ddb6405829ec3c6ed2c491b4e77cab
2020-03-27 15:50:43 +00:00
Galia Peycheva
70b55719db Change TYPE_DREAM logic to use ACTIVITY_TYPE_DREAM
Bug: 151750434

Test: m && flash && check that dream starts normally

Merged-In: Ic4561cd0594d7a3465454221db256499dd06c145
Change-Id: I58a8795f2801b598be5c958b1a854e8f84f31940
2020-03-27 11:26:44 +00:00
Chris Li
bfe1b70fcd Report incorrect context usage in ViewConfiguration
Before, the documentation said that the passed context is an application context, which is incorrect to get the density, window metrics, and window manager. We should use visual context to get these instead.

Bug: 151474461
Test: StrictModeTest#testIncorrectContextUse_GetViewConfiguration
Change-Id: Iea28d727cafbb3ec8536742c6a0e594f73fe5a51
2020-03-26 22:09:28 -07:00
Steven Thomas
4528b333db Clean up some formatting problems in the setFrameRate sdk docs
Bug: 152413112
Test: Built the sdk docs locally, confirmed they look correct.
Change-Id: Ia7286958b582e6d0eb776c4ebeff6072dabc723e
2020-03-26 21:47:56 -07:00