Commit Graph

14073 Commits

Author SHA1 Message Date
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
Jorim Jaggi
555a54a900 Merge "Unhide WindowInsets#inset with insets argument" into rvc-dev 2020-03-02 20:09:35 +00: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
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
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
TreeHugger Robot
97ce4799af Merge "DisplayModeDirector: use configGroup when choosing default config" into rvc-dev 2020-02-28 17:43:40 +00:00
Ady Abraham
8a5e39174f DisplayModeDirector: use configGroup when choosing default config
When calling to SurfaceFlinger to set the display config spec, the
default configId needs to consider the config group of the config.

Bug: 149784270
Test: Simulate multiple config with debug change ag/10355181
Change-Id: I50dce6e31e8cc842a221baaa69e128428f67be99
2020-02-28 04:35:51 +00:00
Robert Carr
7fdf5d1370 Fix typo in SurfaceControlViewHost relayout overload
Need to point to the other method, not just infinitely recurse.
Seems to imply that the tests aren't running in CTS anymore either (this
method doesn't have any real users yet). Following up on why the tests
aren't running seperately.

Bug: 150338132
Test: SurfaceControlViewHostTests
Change-Id: Ie43a6affaac3616164c892713b4bc7fc4b775aa1
2020-02-27 20:13:51 +00:00
Adrian Roos
cd9cf09965 PhoneWindow: Fix potential memory leak
Fixes an issue where PhoneWindow and thus Activity can be leaked through AttachInfo through
the OnContentApplyWindowInsetsListener.

Fixes: 148799801
Test: make droid; atest WindowTest
Change-Id: I1de5518c84fd7e6d1aa1542a9252b1c600f5712d
2020-02-27 17:01:09 +00:00
lumark
0df8812486 Finish input when the screen state is off
Add ImeFocusController#onScreenStateChanged callback for ViewRootImpl to
callback the screen state for ImeFocusController, and then check the served
view to finish input connection when the screen state is off.

With this change, we can remove InputMethodManagerService#setInteractive
related codes, since we still can finish current input connection
once the device is screen off, ensures the security behavior remains
the same.

This change is expected to reduce accumulated technical debt introduced
by [Prior works] to address multiple edge cases [1][2][3][4], especially
around window focus changes and display-off events.

[Prior works]
 [1]. Re-start input when the IME is deactivated but window is focused
        (Bug 6188159)
          I9189e6d2ac90aa8c621fdb44989728101e00329d
          31e4e14994
 [2]. Fix a crash in InputMethodManager when switching the IME in the
      system process
        (Bug  6789252)
          I66f51da1299532793ef8fa700f35b0811670f235
          4e5184f929
 [3]. Call startInput on return from sleep mode
        (Bug 17558972)
          I95d05110bc1cf310fad23ea1bcbc5890f642d1fc
          82ae3ff4cf
 [4]. Make IMM more robust to spurious window focus-in
        (Bug 26851566)
          I60adb38013b063918b074c7b947649eada77b2c8
          8e9214b4bd

Note that one behavior change is that when the screen is on and window focus
back to the app, if the app previously did't request show soft input explictly,
InputMethodManager will not request to show soft-keyboard explicitly for the
next served view.

Fix: 26851566
Bug: 141738570
Bug: 9216494

Test: atest SearchViewTest, FocusHandlingTest
Test: atest ActivityViewTest, MultiDisplayClientTests,
      MultiDisplaySystemDecorationTests

Change-Id: Ic11956fe745a829da1ec7c09ea214e9b3961c8e0
2020-02-27 09:03:35 +00:00
Taran Singh
73b1d16d28 Merge "Pipe windowToken for hideSoftInput" into rvc-dev 2020-02-27 07:14:04 +00:00
Tarandeep Singh
4fe5b654a1 Pipe windowToken for hideSoftInput
Pipe the windowToken of the window requesting hideSoftInput just like we
did it for showSoftInput [1].
This calls hideInsets on the correct display when control target is
different from IME target e.g. ActivityView.
Also hideInsets should be called on InsetsControlTarget instead which was
originally attempted in [2]

[1]: Ia49e23dd077d264a58d28a7b8acffde54b7db187
[2]: I7133e151a1037c42b275b97857936437a7a6725f

Bug: 149870112
Bug: 133381284
Test: Manually using steps mentioned in bug.

Change-Id: Ia596a392eb73ae46debd097151c8c9a7edd59833
2020-02-27 04:13:25 +00:00
TreeHugger Robot
658fc6d6d6 Merge "A few inline autofill API tweaks." into rvc-dev 2020-02-27 03:16:38 +00:00
Taran Singh
05b07c2657 Merge "Remove IME surface when hidden" into rvc-dev 2020-02-27 00:53:09 +00:00
Feng Cao
4b0ef392c2 A few inline autofill API tweaks.
* add isPinned() to InlineSuggestionInfo so IME can choose to pin the suggestion
* allow augmented autofill service to set inline actions in the response
* non-api change: pull the autofill hints from the Slice in the InlinePresentation

Test: m -j; atest InlinePresentationTest, atest CtsInputMethodTestCases:InlineSuggestionInfoTest CtsInputMethodTestCases:InlineSuggestionTest
Bug: 137800469

Change-Id: I63b6b843ef056df18c317299e617b8fe21907374
2020-02-26 13:49:54 -08:00
Evan Rosky
149bbf89bc Merge "Clean-up old docked-stack implementation from WM" into rvc-dev 2020-02-26 21:47:57 +00:00
TreeHugger Robot
31c94a2f0e Merge "Removing possible user defined strings from bugreport view-dump" into rvc-dev 2020-02-26 20:12:10 +00:00
Tarandeep Singh
94c9a8328e Remove IME surface when hidden
When IME is no longer shown, notify IMS to hide the window surface.
This reclaims the memory allocated to IME window surface.

Fix: 150163310
Test: atest CtsInputMethodTests
      Manually:
      1. Open any app that has editor  and run
         adb shell  dumpsys SurfaceFlinger | grep Total
      2. Note down total memory
      3. Tap on editor and IME shows. Note down memory
         using command in #1. It should go up by ~27MB
      4. Hide IME and note down memory again.
         It should revert to original value in #1.

Change-Id: I6c2a13dd40b22d3fd62b4763ba369992e5ff1138
2020-02-26 18:58:33 +00:00
Evan Rosky
73a7fe9479 Clean-up old docked-stack implementation from WM
Bug: 133381284
Test: Existing tests pass. Manually use sysui
Change-Id: I44155d74df1489fa391c60a05d1f8098986cefb7
2020-02-25 21:13:16 +00:00
TreeHugger Robot
0253cc8f2f Merge changes from topics "input_events_id", "wire_input_event_id" into rvc-dev
* changes:
  Send input event ID in InputEventSender.
  Add ID to InputEvent.
2020-02-25 19:20:17 +00:00
Sunny Goyal
c444b514bf Removing possible user defined strings from bugreport view-dump
Bug: 64101886
Test: Verified build
Change-Id: Ifad98a268fc17a2e1572ca3e0962a89447083294
2020-02-25 10:00:37 -08:00
Shawn Lin
faff9bd887 Merge "Fixed not updating waterfall insets in DisplayCutout.inset()" into rvc-dev 2020-02-25 06:15:37 +00:00
TreeHugger Robot
0cbb2687ed Merge "Move PiP animation to SysUI package" into rvc-dev 2020-02-25 03:10:24 +00:00
TreeHugger Robot
ba58fd615f Merge "Add Option To Prevent Wake On Back Key Press" into rvc-dev 2020-02-25 02:10:32 +00:00
Feng Cao
85cbe43d48 Merge "Use context for correct display in the renderer service" into rvc-dev 2020-02-24 22:10:06 +00:00
Hongwei Wang
85cf41fcc3 Move PiP animation to SysUI package
The bounds animation is cleaned up within window manager and it's now
the SysUI component listening on callbacks from TaskOrganizer for
entering to and exiting from PiP mode.

Additionally, the expand and move of the PiP window is now part of SysUI
as well.

Known issues:
- Black background when in transition from PiP to fullscreen. The
wallpaper gets into hidden state too early
- App gets into PiP mode too early when entering PiP, need to defer the
configuration change sent to app in this case

Bug: 146594635
Bug: 148198539
Bug: 138144750
Bug: 149569903
Test: atest PinnedStackTests
Test: atest PipAnimationControllerTest
Test: atest RecentsAnimationTest
Test: atest RecentTasksTest
Test: atest com.android.server.wm.ActivityStarterTests
Merged-In: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
Change-Id: Id0c8ce03fa26952daf5e3687b18b2eb2375b7d20
2020-02-24 21:16:20 +00:00
Garfield Tan
c8362b24f6 Add ID to InputEvent.
The interaction between Java and native code for KeyEvent and
MotionEvent is different, so I used different arrangement to pass
sequence number across JNI that keeps the consistency with other
metadata.

Unfortunately this new ID doesn't have absolute uniqueness guarantee so
it can't replace InputEvent#getSequenceNumber() which is used with a
strict in-process uniqueness assumption. Therefore only convert systrace
related use to ID.

Also expose ID generator through a static function in InputEvent so that
everyone can use it. InputReader and InputDispatcher will use different
instances.

Bug: 144889238
Test: Build and run.
Test: atest FrameworksCoreTests:KeyEventTest
Test: atest FrameworksCoreTests:MotionEventTest
Change-Id: Icbdcaee1d98948c05484865a4e15e55161ecfa69
Merged-In: Icbdcaee1d98948c05484865a4e15e55161ecfa69
(cherry picked from 29d21d4062)
2020-02-24 12:45:27 -08:00
Robert Carr
6d16c8c340 RESTRICT AUTOMERGE - Explicitly disable BLAST for SurfaceControlViewHost surfaces
Right now it crashes because the ViewRoot expects to receive a
BLAST surface but the WindowlessWindowManager doesn't support it.
Adding support should be relatively trivial (coming in a follow-up)
but we haven't tested it yet so suggesting merging this patch for
today.

Bug: 150000636
Test: Existing tests pass
Change-Id: I4b36d190c8f4f022dada656e02452034113a4000
(cherry picked from commit b4727e0f55)
2020-02-24 15:56:07 +00:00
shawnlin
16ba068293 Fixed not updating waterfall insets in DisplayCutout.inset()
Bug: 149975807
Test: atest DisplayCutoutTest
Change-Id: Ic672e0688bbafabdd67790936568f40f6c4a3dff
2020-02-24 18:00:22 +08:00
Charles Chen
23c81a156e Merge "Revert "Revert "Always get window insets from server""" into rvc-dev 2020-02-24 09:14:56 +00:00
Patrick Rohr
2faf788151 Add Option To Prevent Wake On Back Key Press
KEYCODE_BACK was previously hardcoded as a wake key in KeyEvent.java.
For TV remotes, we want to make this behavior configurable.

Test: Tested on Android TV Device.
Bug: 144979700
Change-Id: I496c9c283525d5e04325e4bb3d6ab19a571db0c7
2020-02-24 08:17:24 +00:00
Charles Chen
65da12a421 Update document of WindowMetrics#getSize
Update document to notify that reported size is different between
WindowMetrics#getSize and Display#getSize and provide a sample
code to transform between usages.

Test: build & run
Bug: 128338354
Change-Id: I06aee9aaf903c3864fbb0fe89ea1d3e15506fe1c
(cherry picked from commit 2de0f42d50)
2020-02-24 07:08:09 +00:00
Charles Chen
1ac295ec08 Revert "Revert "Always get window insets from server""
This reverts commit 288e1bd045.

The previous implementation of computeWindowInsets is to
use last view from WM#addView, which may be invalid because
the last added view is removed and throws NPE when getting
property from the invalid view.
In this CL, we change the approach to always obtain window
insets from server.

fixes: 148789183
fixes: 149480577
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest WindowMetricsTests

Change-Id: I6db5970d14ac9eebe0ab0df65cb1300515ad1754
(cherry picked from commit 6bb2d4f68c)
2020-02-24 03:46:51 +00:00
Jackal Guo
a67e14a6e1 Correct the bound if it's from outside of screen
Use getBoundsOnScreen without clipToParent instead since the bounds
may be out of screen.

Bug: 149539748
Test: a11y CTS & unit tests
Change-Id: Ie2107f58a7cc5f0b76e4a468cfb295c410dbb559
Merged-In: Ie2107f58a7cc5f0b76e4a468cfb295c410dbb559
(cherry picked from commit 9a341abdb4)
2020-02-24 01:28:21 +00:00
Svet Ganov
02fdd34057 Use context for correct display in the renderer service
bug:149958394

Test: atest android.autofillservice.cts.inline.InlineLoginActivityTest

Change-Id: I4bcdca8188b9b97076c4146f0f9eddffe3e1b3b1
(cherry picked from commit 2aa4f10996)
2020-02-22 19:54:59 +00:00
Andrii Kulian
02c0e4d2ac Handle config/display changes for WindowContext
Introduce IWindowToken to report config/display changes from
server side. When config change callback is received,
it will update the resources associated with the window token.

Test: WindowContextTests
Bug: 128338354
Bug: 146820733

Change-Id: I871bd78a21dbde1286786e65c340b6259b873660
2020-02-21 16:07:32 +08:00