Commit Graph

14106 Commits

Author SHA1 Message Date
Evan Rosky
05ec88668e Fix config change on secondary split adjustment
This adds some more config controls to containerTransaction so that
sysui divider can "freeze" the configuration w/h while it is
offset for IME.

Bug: 133381284
Bug: 149952263
Bug: 150400846
Test: Just after boot, open split with settings in secondary and
      open the search activity. This should show IME and not
      randomly hide it when background apps are started.
      Also added a wmtest.
Change-Id: I731378f625079f8a1413469f71455650d9e59a50
2020-03-06 00:45:46 +00:00
Rob Carr
ed48db3d87 InsetSourceConsumer: Ensure we release Leash when finished.
SurfaceControl resources may be heavy weight, and so we explicitly
release them when finished. Specifically, we need to fix this to
keep the CloseGuard from complaining in strict-mode.

Bug: 150805473
Test: Existing tests pass
Change-Id: Ie3c609f79a953374a4d336465676cdc312679f93
2020-03-05 22:05:59 +00:00
Jorim Jaggi
b8138a2835 Merge "Fix alpha when applying insets" into rvc-dev 2020-03-05 18:38:23 +00:00
Galia Peycheva
fc1430a39e Merge "Make ActivityInfo.preferMinimalPostProcessing a flag" into rvc-dev 2020-03-05 15:45:06 +00:00
Jorim Jaggi
1df5bd2672 Fix alpha when applying insets
Test: WindowInsetsActivity
Bug: 150852597
Change-Id: I352a7e6c81b5bface1fc92f8d30a36408cabb125
2020-03-05 15:52:21 +01:00
Jorim Jaggi
0fb8fb2caa Address API feedback
Test: n/a
Bug: 149216359
Change-Id: I52019474b244816a5909fac4437d888cae81219f
2020-03-05 10:25:04 +00:00
Tiger Huang
b979998eb4 Merge "Prevent causing insets if the system bar is shown forcibly" into rvc-dev 2020-03-05 07:06:15 +00:00
Jackal Guo
2d627ec8f3 Merge "Update Javadoc" into rvc-dev 2020-03-05 01:11:23 +00:00
Winson Chung
896f664c77 Merge "Update sync rt applier for background blur" into rvc-dev 2020-03-04 20:09:22 +00:00
Dominik Laskowski
15842bc4cb Merge "Blacklist Display#getAddress" into rvc-dev 2020-03-04 18:28:04 +00:00
Heemin Seog
d1bbc14732 Merge "Replace TYPE_STATUS_BAR_PANEL with TYPE_STATUS_BAR_ADDITIONAL" into rvc-dev 2020-03-04 17:06:50 +00:00
Winson Chung
7e895da152 Update sync rt applier for background blur
- Copy surface params builder to compat class
- Add calls to set background blur
- Make recents/app transition leashes effect layers so blur can be set
  on them

Bug: 149792636
Test: Build with launcher with blurs enabled
Change-Id: I4cebcab090719c6a17f197a3cd4450d68e55b424
2020-03-04 08:45:12 -08:00
Tony Mak
36beec8030 Merge "Rename TextClassificationSessionId.flattenToString() to getValue()" into rvc-dev 2020-03-04 16:08:03 +00:00
Tiger Huang
b9510efabd Prevent causing insets if the system bar is shown forcibly
Forcibly-shown system bars are usually transient. Prevent them from
causing insets can reduce the UI shakiness, and can be compatible with
the behavior in the legacy insets mode.

Fix: 150582388
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest
Change-Id: I3c0fa4fb7555b2f63e1c4849db7b169489ab64e4
2020-03-04 16:06:19 +08:00
Jackal Guo
fd2eab0067 Update Javadoc
Note the limitation on embedded hierarchy.

Bug: 149199973
Test: build pass (m -j docs)
Change-Id: I2be24ecb79f35a7ded913e37d8e8c32511f760f3
2020-03-04 11:51:47 +08:00
Ryan Lin
4401b0db11 Merge "Revise the javadoc and rename the constant" into rvc-dev 2020-03-04 01:49:37 +00:00
Tarandeep Singh
7bbce8ee6b Ignore unchecked IME show/hide when no root
Both showSoftInputUnchecked() and closeCurrenInput() rely on rootView to
obtain window token. If view root is null, window has already gone away
and IME control had been revoked. Trying to show or hide at this time
would be a no-op.

Bug: 149900693
Test: Manually using the steps mentioned in bug and verify that there is
      no NPE.
Change-Id: I294bb2ec5395d7502a855bafbac672af069e9b4a
Merged-In: I294bb2ec5395d7502a855bafbac672af069e9b4a
(cherry picked from commit ba9b716a70)
2020-03-03 23:43:37 +00:00
Feng Cao
c9611acb62 Merge "Notify autofill with the IME start/finish input view events" into rvc-dev 2020-03-03 18:36:11 +00:00
Galia Peycheva
bdd66e30f8 Make ActivityInfo.preferMinimalPostProcessing a flag
Bug: 149420259

Test: atest CtsWindowManagerDeviceTestCases:MinimalPostProcessingTest

Change-Id: I250669158a532316bebed8fa8c17e009b9293ecb
2020-03-03 16:59:26 +01:00
Jorim Jaggi
57157ac5d8 Fix WindowInsetsController lifecycle
Provide a recording insets controller before the window gets
created, and replay the commands once a view gets attached. This
allows the client to use the controller in Activity.onCreate.

Test: WindowInsetsControllerTests
Bug: 118118435
Change-Id: I1a825ecc4367c02b27f2d08cd5442325315d4f89
2020-03-03 15:12:15 +01:00
ryanlwlin
ef02aa431f Revise the javadoc and rename the constant
Bug: 147804256
Test: The API Builds, there is no executable code here.
Change-Id: I452f8bcbedb7422878a1cfc7245c33f6e38b57e3
2020-03-03 18:01:17 +08:00
Feng Cao
7c85eb79a7 Notify autofill with the IME start/finish input view events
* autofill will cache the inline suggestions response until it receives
  a start input view event from IME
* the data flow from IMS point of view is:
  IMS#startViews and IMS#doStartInput (before calling onStartInputView)
  ->
  [async] InlineSuggestionsRequestCallback#onInputMethodStartInputView()
  --- process boundary ---
  ->
  IMMS.InlineSuggestionsRequestCallbackDecorator
     #onInputMethodStartInputView()
  ->
  InlineSuggestionSession.InlineSuggestionsRequestCallbackImpl
     #onInputMethodStartInputView()
* similar data flow for  IMS#finishViews()
* this CL should not block IME's UI thread because it's only issuing a
  new async IPC from IMS start/finish input view call that's running on
  the UI thread.
* there should not be performance impact on IMEs if autofill inline
  integration is not active

Test: manual verification, atest EditorInfoTest
Test: atest android.autofillservice.cts.inline, with two failing cases:
 InlineAugmentedLoginActivityTest#testAugmentedAutoFill_twoDatasetThenFilledSecond
 and InlineAugmentedLoginActivityTest#testAugmentedAutoFill_oneDatasetThenFilled
 due to the test itself being broken, I'll fix the test in a separate patch
Bug: 149522488
Bug: 149442582
Change-Id: I2faa3577b9f95a122f26a6d7fa7822a769a51e34
2020-03-02 21:18:16 -08:00
TreeHugger Robot
78160dc4c0 Merge "Uses SurfacePackage instead of SurfaceControl on inline suggestion" into rvc-dev 2020-03-03 02:56:24 +00:00
TreeHugger Robot
e858e30c46 Merge "Fix broken inset anims" into rvc-dev 2020-03-03 01:34:12 +00:00
TreeHugger Robot
bf2697bfda Merge "Restrict DisplayInfo dumping for app process" into rvc-dev 2020-03-03 00:58:22 +00:00
Jorim Jaggi
b71e6892f1 Fix broken inset anims
Parameters were correctly flipped but usages weren't.

Test: Open IME
Bug: 118118435
Change-Id: Ib0c417216b8e586c633c4607a9eb979e83b50231
2020-03-03 00:38:47 +01:00
Rob Carr
26351d7c4d Merge "SurfaceControl: Bind close-guard lifetime to native-object lifetime." into rvc-dev 2020-03-02 20:40:17 +00:00
Jorim Jaggi
96cc10c2de Merge "Various inset fixes" into rvc-dev 2020-03-02 20:22:34 +00:00
Jorim Jaggi
432e0c7440 Merge "Fix unnecssary traversal for starting windows" into rvc-dev 2020-03-02 20:20:52 +00:00
Dominik Laskowski
c8f52f6e79 Blacklist Display#getAddress
Bug: 138677816
Test: Call via reflection in app.
Change-Id: Idb022b32a61ce137db7a4718ef4c52c61481eed0
2020-03-02 12:11:45 -08:00
Jorim Jaggi
555a54a900 Merge "Unhide WindowInsets#inset with insets argument" into rvc-dev 2020-03-02 20:09:35 +00:00
Dominik Laskowski
1039ea50f3 Restrict DisplayInfo dumping for app process
Bug: 138677816
Bug: 150290985
Test: Log Display#toString in app.
Test: dumpsys display
Change-Id: I0d992b6662cde7e295916a7a144c68061dd1f4b3
2020-03-02 10:53:43 -08:00
Jorim Jaggi
aa6235d894 Fix unnecssary traversal for starting windows
Test: AppTransitionTests#testColdLaunchFromLauncher
Bug: 148985084
Change-Id: I526ad6d55c16b7b621229d142c1102dfd1cac1ad
2020-03-02 18:36:20 +01:00
Jorim Jaggi
3381108be2 Unhide WindowInsets#inset with insets argument
Test: WindowInsetsAnimationTests
Bug: 118118435
Change-Id: I359ac49403bfc63120d4e9565e4fa7801a840333
2020-03-02 18:13:29 +01:00
Jorim Jaggi
580aef5a82 Various inset fixes
- Fix alpha
- Fix running animation book-keeping
- Fix max insets dispatched during onProgress
- Fix visibility of onProgress
- Fix cutout during onProgress

Bug: 118118435
Change-Id: Ibc0204280407ea6c981b86af6992ef24ff8fb41f
2020-03-02 17:37:01 +01:00
Tiger Huang
ec2c4dfffe Merge "Refine adjustLayoutParamsForCompatibility about fitting insets" into rvc-dev 2020-03-02 14:33:39 +00:00
Tiger Huang
c9035d7d43 Merge changes If5ccacdd,I381a083d into rvc-dev
* changes:
  Unhide API: WindowInsets.Type#displayCutout()
  Make display cutout can produce insets
2020-03-02 14:32:21 +00:00
TYM Tsai
b1f42dd78a Uses SurfacePackage instead of SurfaceControl on inline suggestion
The InlineContentView uses the SurfacePackage instead of the SurfaceControl
for accessibility and UiAutomation supporting.

Bug: 149194105
Test: manual
Change-Id: Ib10f37a58dde7dc09d0ea16d1a121088dab4738e
2020-03-02 20:51:46 +08:00
Tiger Huang
5fb9ab7ddf Refine adjustLayoutParamsForCompatibility about fitting insets
By the compatible logic in DisplayPolicy.layoutWidnowLw(), if a regular
window (non-TYPE_STATUS_BAR_PANEL, non-TYPE_TOAST, and
non-TYPE_SYSTEM_ALERT) doesn't extend into any of system bars, it should
fit IME.

The logic was implemented by pf.set(displayFrames.mContent) in the
legacy insets mode, where mContent would be adjusted after processing
IME.

Fix: 149838078
Test: Steps in the target issue
Test: atest ViewRootImplTest
Change-Id: I6eb685fa1e3ad9789621e5647fc490300054db8b
2020-03-02 20:19:18 +08:00
Rhed Jao
7fc16f7c32 Merge "Do not prefetching accessibility nodes while a view is scrolling" into rvc-dev 2020-03-02 12:18:24 +00:00
Tiger Huang
e06d071446 Unhide API: WindowInsets.Type#displayCutout()
With this CL, the public developers can interact with display cutout via
insets APIs.

Bug: 118118435
Test: build
Change-Id: If5ccacddb079bc5513ccb5820ea1c371e95fe562
2020-03-02 15:44:36 +08:00
Tiger Huang
e16645a966 Make display cutout can produce insets
This CL creates InsetsType and InternalInsetsType for display cutout.
With this CL, WindowInsets.getSystemWindowInsets() can be compatible
with the legacy insets mode.

Fix: 149932355
Test: Open an app which has LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
      and hides navigation bar on the display which has double display
      cutout. And check if the app can get the correct result from
      WindowInsets.getSystemWindowInsets().

Change-Id: I381a083d8c30e1678c835eaf5341e941139aa0d7
2020-03-02 15:08:20 +08:00
TreeHugger Robot
16286e3c3f Merge "Populate the autofillId in the IMS EditorInfo" into rvc-dev 2020-03-02 04:09:29 +00:00
Rhed Jao
e135e2e4e6 Do not prefetching accessibility nodes while a view is scrolling
Accessibility framework default enable prefetching accessibility
nodes in application, when an accessibility service is trying to
query a node on the screen. These nodes are stored in the
AccessibilityCache which is in the accessibility service to save
the IPC between accessibility service and application on screen.

This mechanism does not help performance in some scenarios. For
example, an application with thousand nodes on screen and user
needs to scroll the content frequently. In this case, the
AccessibilityCache will be cleared frequently, and the prefetching
behavior also happens frequently. It becomes an extra effort and
drop the performance.

In this patch, we stop prefetching for a little time while a
scrolling event is detected. This can mitigate performance drop
symptom while user is scrolling.

Bug: 143730839
Test: Manual
Change-Id: I336ee2907ba63c32c6e53259589817dfd14b99e1
Merged-in: I336ee2907ba63c32c6e53259589817dfd14b99e1
(cherry picked from commit 1be8809974)
2020-03-02 03:28:57 +00:00
Ming-Shin Lu
dabdc31ad1 Merge "Finish input when the screen state is off" into rvc-dev 2020-02-29 14:30:42 +00:00
Feng Cao
e65a97cef4 Populate the autofillId in the IMS EditorInfo
* So it can be checked against the autofillId from autofill manager
  service
* Currently not checking due to race condition, will find a fix in
  follow up CL

Test: manual verification
Bug: 149522488

Change-Id: I49457e33c7a1acb028023cb70f248805a96c5346
2020-02-28 22:08:32 -08:00
Robert Carr
01b0dd5f1d SurfaceControl: Bind close-guard lifetime to native-object lifetime.
Currently there are two bugs in the close-guard behavior:
Bug 1:
   a. Create surface control from parcel, close guard opens
   b. Import new parcel, last object release close guard closed
   c. Close guard not reopened, now we have a resource but no close guard
Bug 2:
   a. Construct "new SurfaceControl()" but don't do anything with it
   b. Now we have a close guard but no native resources

This CL ensures the state of the close guard matches the ownership of
native resources.

Bug: 150128124
Test: Existing tests pass
Change-Id: I0155854213ac64be3ac9a5d264815dbd43018fca
2020-02-28 21:30:33 +00:00
Rob Carr
228376091d Merge "Fix typo in SurfaceControlViewHost relayout overload" into rvc-dev 2020-02-28 21:06:34 +00:00
Taran Singh
7ac48bae21 Merge "Fix controlWindowInsets for IME" into rvc-dev 2020-02-28 19:34:01 +00:00
Tarandeep Singh
b9538cdfff Fix controlWindowInsets for IME
If IME is already visible, requestShow() is immediate.
If animation is finishing and IME is hiding, notify IME process of the
visibility.

Bug: 111084606
Test: Use test app [1] and verify that swiping up and down multiple
      times opens and closes the IME respectively.

      [1] I4320871bdc8184fac38921616e1a1322f8dbc804

Change-Id: Icf202b56c0bc3833e86ee70c43fedd418e27b140
2020-02-28 19:33:11 +00:00