Commit Graph

14498 Commits

Author SHA1 Message Date
Adrian Roos
cb7fedfe12 Merge "WindowInsets: clarify displayCutout javadoc" into rvc-dev am: 22a58a4ce1 am: 5b966ab3a6 am: d50552a286 am: 7aefae6d27
Change-Id: Ida2728ad2fd85e6f380be16dabf60956ca9a0151
2020-04-14 14:01:39 +00:00
Adrian Roos
e978d75237 WindowInsets: clarify displayCutout javadoc
Fixes: 152729752
Change-Id: I4d24aaede44d80dae8d6e6d95a7d15d5f33a04c9
2020-04-14 12:44:01 +00:00
TreeHugger Robot
3824102224 Merge "SurfaceControlViewHost: Improve documentation" into rvc-dev am: 4413b0edba am: 96d7fdc315 am: bf777558d0 am: d31a1f3e75
Change-Id: Iebc9750060a2844c89801fe0b6dbd1d44e3cc14d
2020-04-13 20:36:08 +00:00
TreeHugger Robot
4413b0edba Merge "SurfaceControlViewHost: Improve documentation" into rvc-dev 2020-04-13 19:37:29 +00:00
Robert Carr
20c23963a7 SurfaceControlViewHost: Improve documentation
Capturing the answers to some questions I received today in-to
source-code comments.

Bug: 153756455
Test: Comments only
Change-Id: I208ca0370267803bf546d654f5a8d4e0c25b6f11
2020-04-13 11:35:51 -07:00
TreeHugger Robot
dd0ca1b234 Merge "Deprecates the animatingBounds from WM to SysUI" into rvc-dev am: c3721ac874 am: 7b48e03224 am: 97b959516c am: 620d5354dc
Change-Id: Ibbbb861bc1dadb728a9926c38a378e78a31aa009
2020-04-10 23:47:57 +00:00
TreeHugger Robot
c3721ac874 Merge "Deprecates the animatingBounds from WM to SysUI" into rvc-dev 2020-04-10 23:13:52 +00:00
Hongwei Wang
3c981f6eb7 Deprecates the animatingBounds from WM to SysUI
PipTouchHandler, similar to other components in SysUI, should be in-sync
with the destination bounds calculated within SysUI rather than WM.

Fixed also the empty movement bounds upon the first call to
PipTouchHandler#onMovementBoundsChanged. Together, this change should
fix the PIP not being lifted on IME show up. PipTouchHandlerTest is
updated correspondingly.

Bug: 153352899
Test: manually enter/exit PiP
Test: atest PipTouchHandlerTest
Change-Id: I2912af2a181b7fb57c6d90751744d46c6b3366d2
2020-04-10 13:47:14 -07:00
TreeHugger Robot
0652d6aaf4 Merge "Add an empty IMM#windowDismissed(IBinder) for app compat" into rvc-dev am: 51ec322208 am: b43dfe1f41 am: 1c4e32a52c am: 7076d608d5
Change-Id: I70db4bd3f1dc6b670e58f0a6bbba3f005a5b20d4
2020-04-10 16:15:48 +00:00
TreeHugger Robot
51ec322208 Merge "Add an empty IMM#windowDismissed(IBinder) for app compat" into rvc-dev 2020-04-10 15:10:43 +00:00
Wei Sheng Shih
3b17079b01 Merge "Support addWindow as other user" into rvc-dev am: 1a46294fdb am: bbc82f209c am: 648f3f1954 am: addde6e564
Change-Id: I66df80e7edcf543c52ae6f640cf09df9e67022de
2020-04-10 09:24:31 +00:00
Wei Sheng Shih
1a46294fdb Merge "Support addWindow as other user" into rvc-dev 2020-04-10 08:33:12 +00:00
Ming-Shin Lu
e9bd437978 Merge "Trigger onTaskAppeared when a task started from recents becomes ready." into rvc-dev am: 1c92e1f789 am: 7ffe6e70ae am: a22ad45c92 am: 82def810f5
Change-Id: I5389eadd171e9c658e01f5b13b57fbd0a39b7909
2020-04-10 07:52:15 +00:00
TreeHugger Robot
9efeded68f Merge "Fine tune performance for notifyContentCapture()" into rvc-dev am: 2a7091d896 am: 3051a0a8d9 am: f5b0460ad5 am: 9a23b05a65
Change-Id: Ib835855f089259692839c7b5e2c04f7383b95e27
2020-04-10 06:32:25 +00:00
Ming-Shin Lu
1c92e1f789 Merge "Trigger onTaskAppeared when a task started from recents becomes ready." into rvc-dev 2020-04-10 05:46:13 +00:00
Yohei Yukawa
7029cc3da8 Add an empty IMM#windowDismissed(IBinder) for app compat
It seems that there are several applications that call
InputMethodManager#windowDismissed(IBinder), which was recently
removed [1], then crash due to unhandled NoSuchMethodException
exception.

The most probable hypothesis that explains why these apps ended up
calling this method via reflection is trying to address object leaks
from InputMethodManager, which we have received reports then fixed all
the known issues [2][3][4][5][6].  There are several Internet articles
that claim calling InputMethodManager#windowDismissed(IBinder) can
*fix* such object leaks, which is in fact no longer necessary in
recent versions of Android.  However, it seems that some of such apps
didn't gracefully take care of cases where IMM#windowDismissed()
doesn't exist then ended up crashing due to unhandled
NoSuchMethodException.

Note also that AndroidX Activity (androidx.activity.ComponentActivity)
already implements a similar workaround [7] hence app developers no
longer need to work around by themselves.

Anyways, in order to avoid unnecessary crashes from apps that call
IMM#windowDismissed() via reflection, this CL re-introduce it as an
empty method.  As their goal is supposed to be clearing internal
fields within InputMethodManager to avoid object leaks, an empty
method is believed to be sufficient.

 [1]: Ib455704fe1e9d243f93190a84f230210dbceac2a
      970d9d2e0c
 [2]: Iad09cf5dbb7f6f156fd39ed243431432e00f8945
      4478de3c02
 [3]: Iaf3fe2c065b5bf91e49a729ba46262114bb6da88
      b13f015ab5
 [4]: I219394178e4172bc47864297f1418e677dba25e5
      5f05965f54
 [5]: Id6afc8fc64512225578c62557b96c7dc2e969adf
      0f3a99d837
 [6]: I8fabb30f14bcb2cd7019e29b6642b4562d49d248
      dff365ef4d
 [7]: I615e92f0c64b6d668b31f2c83527b7409a7bef6f
      b1bf8502e0574a4bfcf450235595372b7cb3778a

Fix: 152261618
Test: manually verified with apps in question
Change-Id: I599896a96267fc60a738eac31be02b770e10dff3
2020-04-09 22:38:04 -07:00
TreeHugger Robot
2a7091d896 Merge "Fine tune performance for notifyContentCapture()" into rvc-dev 2020-04-10 04:42:58 +00:00
Sergey Volnov
2080bf02c3 Merge "Fix Content Capture Data Share" into rvc-dev am: 51ecd453b3 am: 520aa4ce18 am: e917edaa09 am: ba7b0e67fe
Change-Id: I96e28029b865671877ebd80baffa69bff99a47a0
2020-04-09 23:36:10 +00:00
Sergey Volnov
51ecd453b3 Merge "Fix Content Capture Data Share" into rvc-dev 2020-04-09 22:35:08 +00:00
Rob Carr
1417334c2d Merge "ViewRootImpl: Pass buffer to finishDrawing when requested" into rvc-dev am: 0a57530be1 am: afe03f9f46 am: f8664ea3d3 am: b58b579aa2
Change-Id: I59966bd101a15059a29e5dae84f9c5d32334b618
2020-04-09 21:48:59 +00:00
Rob Carr
0a57530be1 Merge "ViewRootImpl: Pass buffer to finishDrawing when requested" into rvc-dev 2020-04-09 20:26:43 +00:00
Sergey Volnov
6c74f7cc9a Fix Content Capture Data Share
Fixing a typo in the previous commit: s/remove/put/

Bug: 153013604
Test: ran CTS tests on sdk_gphone_x86
Change-Id: Iabe8ce51f38ac921aa5cc0e78b559e4a512b9273
2020-04-09 21:23:03 +01:00
lumark
04bceb99f1 Trigger onTaskAppeared when a task started from recents becomes ready.
In quick switch flows, launcher will first swipe task snapshot
through recents animation, and then start new task with custom animation
options through startActivityFromRecents after gesture finish detected,
and then finish recents animation finally.

But that way user may experience flickering before the new task launch
and recents animation finish.

To improve quick switch flickering, we ignore the new task's custom
animation from recents and generate task remote animation target,
and then trigger a callback for launcher to control/animate this
task surface, more like a part of RecentsAnimation,

Also, adding removeTask method for launcher can flexibility remove the
new task animation target once no need to animate, so that launcher
can decide when to finish recents animation.

Bug: 152480470
Test: manual as below steps:
  1) Doing quick switch task.
  2) Make sure launcher can receive onTaskAppeared callback.
  3) Make sure launcher calls removeTask successfully.
  4) Make sure launcher can finish recents animation after 3).
Change-Id: I0692a280a49719229fa8871509bad37a1343a00f
2020-04-10 02:20:03 +08:00
TreeHugger Robot
9c205ff882 Merge "Add an API to set layer trace flags" into rvc-dev am: 9f990dedb3 am: 5db6b4924a am: 7cdcff516b am: 723b222e64
Change-Id: Ib8019abca731724371e1ee8ec3c344026ca15cfb
2020-04-09 16:54:03 +00:00
TreeHugger Robot
9f990dedb3 Merge "Add an API to set layer trace flags" into rvc-dev 2020-04-09 16:26:21 +00:00
Charles Chen
fa42fcc372 Merge "Fix WindowContext leak" into rvc-dev am: 5c082c998f am: c4750c036b am: 020b6173bb am: 57a0f90a57
Change-Id: I751bbbc8991c33679c22eba2e67f59a047fd997d
2020-04-09 11:50:59 +00:00
Charles Chen
5c082c998f Merge "Fix WindowContext leak" into rvc-dev 2020-04-09 07:39:29 +00:00
Vishnu Nair
9eb672e5a9 Add an API to set layer trace flags
This will be used by FlickerTests to capture composition state
in SurfaceFlinger trace.

Test: atest FlickerLibTest:LayersTraceMonitorTest
Fixes: 153563549

Change-Id: I3d09196ced43a1b0bac811e8f458c28be4e44992
2020-04-09 04:04:46 +00:00
TreeHugger Robot
21b646d15d Merge "Fix an issue that setMaxSuggestions(-1) throws unexpectedly" into rvc-dev am: 0fcab06f80 am: 41afef709e am: 7b53afcbce am: 2036a54ac0
Change-Id: Iccad994ebb42d234dbc5f72004dfb6583dfdebcf
2020-04-09 03:22:18 +00:00
TreeHugger Robot
0fcab06f80 Merge "Fix an issue that setMaxSuggestions(-1) throws unexpectedly" into rvc-dev 2020-04-09 02:23:23 +00:00
Steven Thomas
5eb08789d0 Merge "Add acquireFrameRateFlexibilityToken permission comment" into rvc-dev am: 288c434f34 am: c9af9ec01f am: 40493ddb4d am: 4d8cfec9f8
Change-Id: If52da95cea698b3bd32dcad259559a772129b0ee
2020-04-09 02:04:44 +00:00
Steven Thomas
288c434f34 Merge "Add acquireFrameRateFlexibilityToken permission comment" into rvc-dev 2020-04-09 01:08:40 +00:00
TreeHugger Robot
05d5fc6292 Merge "Populate AccessibilityEvent.getAction when preforming an action" 2020-04-09 00:30:02 +00:00
Robert Carr
6cc720b70a ViewRootImpl: Pass buffer to finishDrawing when requested
As the final enabler for the BLASTSyncEngine, we add a new relayout
result BLAST_SYNC. If the WindowState is participating in a BLAST sync
during relayout we return it to the client. If we return it to the
client the client will direct it's next draw in to a BLAST transaction
and report that transaction via finishDrawing. You can now observe
the BLASTSyncEngine working end to end in TaskOrganizerMultiWindowTests.
We do a few small clean-ups in TaskOrganizerMultiWindowTest while we
are there.

Bug: 153561718
Test: TaskOrganizerMultiWindowTests
Change-Id: I719b731350b942aafa444a33972aaef8973422ea
2020-04-08 11:18:09 -07:00
Charles Chen
4bff5be1a9 Fix WindowContext leak
The root causes of this issue are:
  1. WindowTokenClient#attachContext makes WindowTokenClient has strong
     reference to WindowContext, which leads to WindowContext cannot be
     GC'd.
  2. WMS#removeWindowToken needs MANAGE_APP_TOKEN permission which
     normal apps don't hold.

This CL does following things:
  1. Use weak reference instead on WindowTokenClient#mContext.
  2. Relax WMS#removeWindowToken to check callingUid if
     MANAGE_WINDOW_TOKEN permission is not held
  3. Deliver config changes to the client side in
     WMS#addWindowTokenWithOption
  4. Some minor fixes

fixes: 150812449
Bug: 150715095
Test: atest WindowContextTest
Test: atest WindowManagerServiceTests
Test: atest WindowTokenTests
Test: atest WindowManagerPermissionTests#testMANAGE_APP_TOKENS
Test: atest
WindowManagerPermissionTests#testADD_WINDOW_TOKEN_WITH_OPTIONS

Change-Id: I9f1d73af2abb78fc9844e6d9eb25e9f0293514e7
2020-04-08 21:30:24 +08:00
Tony Mak
976cd96983 Fix an issue that setMaxSuggestions(-1) throws unexpectedly
As per the javadoc, -1 is a valid input.

BUG: 153529167

Test: ag/10976796
Change-Id: I4cf172fbd36b893428be1bb87a9ccb0b7c5c3c6a
2020-04-08 14:16:11 +01:00
Jorim Jaggi
96980318aa Merge "Re-apply local client state when leash changes" into rvc-dev am: 9c50a64e91 am: 125072dce1 am: d0d74de729 am: 6185375b3c am: ac4d50d4ee
Change-Id: Ic2a18372df71fb7e102e30c3da07baec3b81de89
2020-04-08 11:52:34 +00:00
wilsonshih
d0fc2ca51f Support addWindow as other user
Support addWindow with the other userId which can be different from Uid.

This can be used when client want to addView for secondary user.
Example:
1. Create context with createContextAsUser or similar method.
2. Get WindowManager with this context.
3. WindowManager#addView

Bug: 151414297
Test: atest WmTests WindowAddRemovePerfTest AddWindowAsUserTest
Change-Id: I13e58d76b1f056f3829bc984c2b61496c8f8d535
2020-04-08 15:15:01 +08:00
Steven Thomas
6faeaa2a9b Add acquireFrameRateFlexibilityToken permission comment
Add a comment explaining the permissions necessary for a successful call
to acquireFrameRateFlexibilityToken(). This is feedback from a
previously submitted CL.

Change-Id: Id316e6943153c20a06d90af844605851591e225c
Bug: 148033900
Test: n/a
2020-04-07 21:31:59 -07:00
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
Alex Spradlin
ef1c8f719f Merge "Add frame rate flexibility token" into rvc-dev am: 2845ad86a4 am: 928df10731 am: ddd44f0156
Change-Id: Ic81df70e38cc486ff883e1eb5bb6df6ecb15e677
2020-04-07 19:17:09 +00:00
Steven Thomas
2845ad86a4 Merge "Add frame rate flexibility token" into rvc-dev 2020-04-07 18:20:36 +00:00
TreeHugger Robot
2bf66482c8 Merge "Expose Display.getType() via TestApi." into rvc-dev am: bd745f763a am: 8122a3938e am: e1e4f30329 am: f845a21c07
Change-Id: Ia512ab896e77449bfbdc1a7e6fd54b4f573468a3
2020-04-07 17:40:24 +00:00
Automerger Merge Worker
37894bc45c Merge "Merge "Update controls after addToDisplay/relayout before dispatching insets" into rvc-dev am: 77d7bcc124 am: 2873becff7" into rvc-d1-dev-plus-aosp am: a5d9ff7eb6 am: 1198e2a2ec
Change-Id: I818ab389cd50935be5398904706c54e5df41739f
2020-04-07 16:55:07 +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
TYM Tsai
2689c3696b Fine tune performance for notifyContentCapture()
Notify ContentCapture only when the visible has changed

Bug: 149561198
Test: manual on Chat
Change-Id: Ifb5eb9a71c91f4994f5c1e8e7faed809ef4667e1
2020-04-07 17:43:11 +08: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
Automerger Merge Worker
0ea0caa75c Merge "Merge "Make the system action API more clear with documentation" into rvc-dev am: 3987ae1ad8 am: 66f5db1e8e" into rvc-d1-dev-plus-aosp am: 9b9021593e am: 7ff11732a8
Change-Id: I0248361a05abde1f23587d1e600db6f3ff491d49
2020-04-07 01:01:15 +00:00