Commit Graph

17207 Commits

Author SHA1 Message Date
Yohei Yukawa
a5f1829af2 Merge "Clarify how Handler is used in IC#getHandler()" 2021-08-06 16:37:19 +00:00
Jelle Fresen
4ca8aeba1c Clarify documentation of canScrollHorizontally/Vertically
Fix: 195570254
Test: N/A

Change-Id: I517ccb099fe606d2fc157d2f7ceb06e209e4db7d
2021-08-05 15:52:03 +00:00
Yohei Yukawa
02ce38c2cf Merge "Lock down RemoteInputConnectionImpl#getInputConnection()" 2021-08-05 14:41:07 +00:00
Joanne Chung
d493f45146 Merge "Fix the Translator references are gone when receiving response." into sc-dev am: 9d17b85ce7 am: 48e583b04b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15444547

Change-Id: I886f22dc9ca1e4d99b99fed272ff3c1689c4e639
2021-08-05 14:05:22 +00:00
Naomi Musgrave
0a2d4bc962 Merge "Temporary flag for Launcher to debug their usage of sandboxed display APIs" into sc-v2-dev am: 5dd564dcf3 am: c143ac5c77
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15425031

Change-Id: I0231f76071c06d9b2abbe5ef515d7bbb7dc7ab76
2021-08-05 09:32:02 +00:00
Naomi Musgrave
5dd564dcf3 Merge "Temporary flag for Launcher to debug their usage of sandboxed display APIs" into sc-v2-dev 2021-08-05 08:54:12 +00:00
Joanne Chung
fd19460694 Fix the Translator references are gone when receiving response.
There are some issues TranslationService already sent the response
but the View onResponse doesn't be called. The reference seems to be
gone. If we don't fix the problem, we will missing the ui translation
even the service already give us the response. To fix the problem, we
change it to strong reference.

The change is low risk, the only risk is if TranslationService doesn
not release the reference to the callback properly causing a memory
leak for apps but this can recovered by app update.

Bug: 194973014
Test: atest CtsTranslationTestCases
Test: The translation for chat apps work fine. The memory is decreased
after receiving the responses for a while.

Change-Id: Ib3956b2250c54a29acf9f7d51f51e8191fe8aba2
2021-08-05 07:07:18 +00:00
Vishnu Nair
fecbd8b790 Merge "SurfaceView: Synchronize position updates with fixed size changes" into sc-dev am: 5d7ae9063a am: c28b2b6caf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15462690

Change-Id: I55d32f34f0d7ac2c4d0159bbcde8de30598a3c97
2021-08-05 05:08:36 +00:00
Vishnu Nair
700b37f4bf Merge "SurfaceView: Synchronize position updates with fixed size changes" into sc-dev am: 5d7ae9063a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15462690

Change-Id: If91aa26d1fbfe17f7dd4c2e5e417c58ba03c0874
2021-08-05 04:53:56 +00:00
Vishnu Nair
5d7ae9063a Merge "SurfaceView: Synchronize position updates with fixed size changes" into sc-dev 2021-08-05 04:36:08 +00:00
Yabin Huang
6f8792bba7 Merge "Add hidden APIs to allow to get and set task ID in AccessibilityWindowInfo" into sc-v2-dev 2021-08-05 01:22:36 +00:00
Yohei Yukawa
d1ff9740c1 Lock down RemoteInputConnectionImpl#getInputConnection()
This is a mechanical refactoring CL that locks down

  RemoteInputConnectionImpl#getInputConnection()

as a private method.

This is supposed to be helpful to to avoid future misuse of raw
InputConnection instance outside RemoteInputConnectionImpl.

Note that InputMethodManager#isAcceptingText() remains to have the
same observable behavior in this CL.  The key fact is that the
following two fields are updated in an atomic way.

  * RemoteInputConnectionImpl#mInputConnection
  * RemoteInputConnectionImpl#mFinished

Bug: 192412909
Test: presubmit
Change-Id: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
2021-08-04 11:57:42 -07:00
Yohei Yukawa
b37f32cfec Let IC#reportFullscreenMode() honor IC#getHandler()
This CL fixes a regression that

  InputConnection#reportFullscreenMode()

is always called back on the main thread rather than its associated
thread.  In most of cases those two threads are the same hence there
is no semantic problem, threads are the same, but for some special
cases, e.g. when apps explicitly override

  InputConnection#getHandler(),

our thread affinity contract can be violated.

This regression was accidentally introduced in Android O time frame
while attempting to make the system more robust at Bug 28406127 [1].

Although we have never received any actual issue report from app
developers so far, this is still worth fixing.

 [1]: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
      2bc66171cc

Bug: 28406127
Fix: 193588937
Test: atest CtsInputMethodTestCases:InputConnectionHandlerTest
Change-Id: Id3ac21c11d6b062bb66719109376ff642309b8ff
2021-08-04 11:37:16 -07:00
Vishnu Nair
befbb69cf5 SurfaceView: Synchronize position updates with fixed size changes
This cl solves a couple of issues:
1. Render thread workers and UI thread share the surface size. They work
on different frames (UI thread sets up the next frame while render
thread is working on the current frame. Accessing the surface size is
unsafe and can result in flickers.

2. UI thread is changing the geometry on size change which might
conflict with render thread causing flickers. This is because of
unsafe accesses as the one mentioned above and the UI thread may
not have the up-to-date position of the view.

This cl fixes the issues by only applying geometry changes in the
UI thread when creating the surface, otherwise the render thread
workers are responsible for updating the geometry. The RenderNode
position update listeners are updated whenever the surface size
changes in order to capture the new size and accompanying changes
which must be applied with the new geometry changes.

Note: updating the position update listeners will trigger a
position update callback so we are guaranteed to apply the
changes in scenarios where the fixed size changes but the view
size does not change.

Test: atest SurfaceViewSyncTest#testSurfaceViewChangeFixedSize
Test: atest SurfaceViewSyncTest#testSurfaceViewChangeFixedSizeWithViewSizeChanges
Test: go/wm-smoke
Test: repro steps from b/190449942
Fixes: 190449942
Change-Id: I076321c853f9a0f6cbf169637e3f3ede60361d60
2021-08-04 11:22:21 -07:00
Naomi Musgrave
253696fea3 Temporary flag for Launcher to debug their usage of sandboxed display APIs
The flag does not impact any other application calling the sandboxed
display APIs. The flag will be removed after Launcher finishes
identifying the breakages attributed to the display API changes.

For Launcher to receive the un-sandboxed values:
adb shell cmd display constrain-display-apis false

Test: manual
Bug: 193421404
Change-Id: I5d8612fd7dcb49769ae005130c9786b2d8416bfc
2021-08-04 16:11:23 +01:00
Yohei Yukawa
bebf16c494 Clarify how Handler is used in IC#getHandler()
Since its beginning [1] the system has been using

  InputConnection#getHandler()

only for retrieving Looper associated with it.  Although it has been
intentional, it'd be probably helpful for app developers if we can
clarify a bit more on this, because most likely the current behavior
is not going to change.

This CL also annotates the API with @Nullable as it should have been.

 [1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
      612cce92ad

Bug: 26945674
Fix: 195434171
Test: presubmit
Change-Id: I14910c6f0cc43feec505b2951625d0c00203ac92
2021-08-03 18:32:03 -07:00
Yohei Yukawa
5693db4d66 Rename IInputConnectionWrapper to RemoteInputConnectionImpl
This is a mechanical refactoring CL that renames

  com.android.internal.view.IInputConnectionWrapper

to

  com.android.internal.inputmethod.RemoteInputConnectionImpl

with no observable behavior change.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
2021-08-03 14:34:36 -07:00
Naomi Musgrave
0ee8ae0de9 Merge "Revert "MediaProjection captures DisplayArea"" into sc-v2-dev am: 93a74ca03b am: 657edec50f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15432520

Change-Id: If741ec02955e5b926aa2efaacb1c4e6f08e90917
2021-08-03 12:58:44 +00:00
Naomi Musgrave
93a74ca03b Merge "Revert "MediaProjection captures DisplayArea"" into sc-v2-dev 2021-08-03 12:19:43 +00:00
Naomi Musgrave
da38617955 Revert "MediaProjection captures DisplayArea"
This reverts commit 45dd2a3202.

Reason for revert: b/195280234 is blocking droidfood

Bug: b/195280234
Change-Id: I09593dffb797d1e4c60cff52e7901ed6c00f719c
2021-08-03 09:19:23 +00:00
Yabin Huang
1cd59c50f1 Add hidden APIs to allow to get and set task ID in AccessibilityWindowInfo
Bug: 195346337
Test: atest android.view.WindowInfoTest
Change-Id: I416f0330966e4a1880a2b6bdd6f24e6077cbe1cc
2021-08-03 00:56:02 +00:00
Vishnu Nair
896775a952 Merge "SurfaceView: Synchronize destframe updates with SurfaceView size changes" into sc-dev am: 40ddf958e6 am: f315a466d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15363651

Change-Id: I7366b93293ea9bfd6bfb6a39f8b0488963de2742
2021-08-03 00:08:32 +00:00
Vishnu Nair
67ebbffe5f Merge "SurfaceView: Synchronize destframe updates with SurfaceView size changes" into sc-dev am: 40ddf958e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15363651

Change-Id: Ibb5b01b673814faac6e15e4bda80ff070d0f2928
2021-08-02 23:54:34 +00:00
Vishnu Nair
40ddf958e6 Merge "SurfaceView: Synchronize destframe updates with SurfaceView size changes" into sc-dev 2021-08-02 23:35:38 +00:00
Hongwei Wang
fa325c750d Merge "Pass AppOps result for PiP in RemoteAnimationTarget" into sc-v2-dev am: 4eaeabe8bd am: 7abcb9bce8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15391157

Change-Id: I1d63fc358e69cf2cf0f2745216226a8447c2a5ed
2021-07-31 03:44:39 +00:00
Hongwei Wang
4eaeabe8bd Merge "Pass AppOps result for PiP in RemoteAnimationTarget" into sc-v2-dev 2021-07-31 03:14:11 +00:00
Josh Yang
bf649b323a Merge "Add a new API to control task snapshot behavior." 2021-07-31 00:57:39 +00:00
Yohei Yukawa
deeb90504a Merge "Move InputBindResult to com.android.internal.inputmethod" 2021-07-31 00:29:01 +00:00
Vishnu Nair
f13eac9f7e SurfaceView: Synchronize destframe updates with SurfaceView size changes
This CL fixes one of the issues with SurfaceView parent frame and
content syncing.

With BLAST, we have two surface controls each setting a scale. The
parent surface control sets a scale based on the requested surface
size and the SurfaceView layout size. The BlastBufferQueue surface
control scales the buffer to the requested buffer size if the buffer
has the appropriate scale mode.

The destination frame controls the second scaling and it must be
applied with the parent surface scale changes. This cl fixes flickers
where the requested fixed surface size changes without any view size
changes. This cl allows the caller to pass in a transaction to
BLASTBufferQueue#update which is updated with the destination frame
changes. This transaction can then be applied with the parent
surface changes.

This also fixes an issue where destination Frame was being set on
every buffer update and when we updated the BlastBufferQueue size.
Since buffer transactions can be queued up on the server side, a
stale value maybe applied for a few frames causing flickers.

Fixes: 194458377
Test: bug repro steps
Test: atest SurfaceViewSyncTest#testSurfaceViewSetFixedSize

Change-Id: I118bd1c3942b389e3951c3fd7389403895fc7b31
2021-07-30 16:18:21 -07:00
Hongwei Wang
c9a7c24e3e Pass AppOps result for PiP in RemoteAnimationTarget
This result will be used by Launcher when deciding if we should start
the auto-enter-pip transition.

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/c9raN4jiaNqbiV7DF4YTJ6
Bug: 194272108
Test: try auto-enter-pip with permission disabled
Change-Id: Iea3a45fd68b54d74e7d5da91b63684c206a0132e
2021-07-30 15:57:39 -07:00
Yohei Yukawa
7eece5feef Merge "Annotate TextServicesManager with @UserHandleAware" 2021-07-30 22:30:52 +00:00
Yohei Yukawa
d72d5a169c Move InputBindResult to com.android.internal.inputmethod
This CL mechanically moves InputBindResult from

  com.android.internal.view

to

  com.android.internal.inputmethod

without changing any observable behavior.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: Ifd68c8a0a0d1b410c9a480ad39ca470fe2da5bc6
2021-07-30 13:08:44 -07:00
TreeHugger Robot
4a6ae54ab9 Merge "Clarify on return value of IC#setImeConsumesInput()" into sc-dev am: 16065df252
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15429835

Change-Id: I0dcc29bb91482e856d2e86131741693010ec9ba4
2021-07-30 19:00:31 +00:00
Yohei Yukawa
db240e2687 Annotate TextServicesManager with @UserHandleAware
This is a follow up CL to my CL [1], enabled TextServicesManager to
determine the target user ID by Context#getUser().

This CL aims to clarify what methods in TextServicesManager follow
this semantics.

Note that @UserHandleAware is still a kind of hint for readers.  There
should be no change at the runtime.

 [1]: I31dda3ae8795190d44b0622b8335c34ddbc5dd48
      9f141ee802

Bug: 192412909
Test: presubmit
Change-Id: I00bd99ef9d83a13bd60a5aefd22094725b67e271
2021-07-30 10:12:27 -07:00
Yohei Yukawa
d8c0b18ea5 Clarify on return value of IC#setImeConsumesInput()
This CL aims to clarify on what the return value of

  InputConnection#setImeConsumesInput()

means for both the IME authors and editor authors [1][2].

In short, the semantics is exactly the same as

  InputConnection#performSpellCheck()

hence this CL reuses its @return section.

Other than clarifying an API doc, this CL changes nothing.

 [1]: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
      30fe6aa964
 [2]: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc
      66b21086e3

Bug: 175362887
Fix: 194099171
Test: presubmit
Change-Id: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
Merged-In: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
(cherry picked from commit f9ca70be57)
2021-07-30 13:49:02 +00:00
Naomi Musgrave
140ea00402 Merge "MediaProjection captures DisplayArea" into sc-v2-dev am: a4bd8de95c am: 659ae92051
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843819

Change-Id: I9fe435874d2dee7ecc43369b39dd871f3f614d07
2021-07-30 13:17:54 +00:00
Naomi Musgrave
45dd2a3202 MediaProjection captures DisplayArea
MediaProjection is used by apps to capture the contents of
a display. Apps consume the content from a surface passed
in to MediaProjection#createVirtualDisplay. The images
written out to the surface can be used for saving
screenshots of the current display, screen recording,
or casting to a different display.

MediaProjection is currently tied to capturing a physical
display. This change instead captures the DisplayArea
the app is launched on. This is consistent with Display API
sandboxing, which returns the DisplayArea bounds rather
than the physical display bounds.

Note that apps use the Display APIs to size the
VirtualDisplay and output surface.

Verified: screenshots, screen recording, and casting

Bug: 180624777
Test: atest WmTests:DisplayContentTests
Change-Id: I909e9d32f573aec33869d9f49d6caffc8d7420aa
2021-07-30 09:48:42 +00:00
Evan Rosky
f1e660fa10 Merge "Add some more transition filter properties" into sc-v2-dev am: cc3b202fab am: 84b5bb952e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15365409

Change-Id: I483dd032e7087f31cc6cde780bad5760c3fdb29c
2021-07-30 02:04:42 +00:00
Josh Yang
b780cae772 Add a new API to control task snapshot behavior.
Bug: 193962530
Test: manual test
Change-Id: I600efcafad0ad3118fc704533d56d2c9180f3308
(cherry picked from commit 583107258411942cd25fa0c5071480a94d3beea7)
2021-07-29 22:33:49 +00:00
Evan Rosky
adb7e53532 Add some more transition filter properties
These are needed for keyguard transitions. The ones added are:

A NOT requirement which will reject transitions with a matching
change.

The ability to match containers that aren't independent.

Checks for global transition flags as well as individual change
flags.

Match only if container is a task.

Bug: 191799478
Test: atest ShellTransitionTests
Change-Id: I963c6c91cdfc0b71a75ba9656261bb0e237f11f1
2021-07-29 15:05:24 -07:00
Shawn Lin
f26b64b961 Merge "Support display cutout for multi-display devices" 2021-07-29 06:47:45 +00:00
shawnlin
0a2167a063 Support display cutout for multi-display devices
- Add a new string array config that stores the unique id of each
  display and when loading the cutout configs we first look up the index
  of the unique id of the added display in the array and use this index
  to load the corresponding cutout configs.
- Add new array configs for every cutout configs.

Bug: 186604541
Test: make, atest LocalDisplayAdapterTest
Test: check the device and see if the cutout is correctly set for each
display

Change-Id: I038832795c11cd16969caff5031fa1090493b008
2021-07-29 12:30:54 +08:00
Evan Rosky
abbe3e853b Merge "Enable keyguard remote animation when WMShell is used." into sc-v2-dev am: 58fd4834b9 am: 8ae8c3e9c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15027112

Change-Id: I44fc397edce49cbc71ba45e3c7700cf6037770d1
2021-07-28 21:01:32 +00:00
Evan Rosky
58fd4834b9 Merge "Enable keyguard remote animation when WMShell is used." into sc-v2-dev 2021-07-28 20:37:38 +00:00
Tiger Huang
8827dca372 Merge "Refine the bounds of the wrap-content sides" into sc-v2-dev am: 0e517ebc04 am: 2d34e05f03
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15401691

Change-Id: I211d21ddf711b36168d901a3f25a5843fde2b134
2021-07-28 15:11:30 +00:00
Tiger Huang
0e517ebc04 Merge "Refine the bounds of the wrap-content sides" into sc-v2-dev 2021-07-28 14:51:28 +00:00
Winson Chung
95b87d420e Merge "Add mechanism for a task's windows to be trusted overlays" into sc-dev am: 24706f0654
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15150506

Change-Id: I2f7757dd1a5dff1101f4ee5469312f03ed9dbc9d
2021-07-28 14:46:21 +00:00
Tiger Huang
a7eef6e459 Refine the bounds of the wrap-content sides
Previously, the maximum length the client window can get for the
wrap-content side is the non-decor display width (or height) which
doesn't take the system bar visibilities into account.

This CL gives the wrap-content window more space if any of the system
bars is hidden.

This CL also refines the logic of selecting the fake control target
which is not always the focused window.

Fix: 193978485
Test: Open "Start Recording?" dialog on YouTube in fullscreen mode.
      See if the dialog can fill the screen while its content is not
      fully displayed.
      Swipe down from top, and see if the dialog is shifted down.
Change-Id: I3f7a71729196311e8f7406c6e07f68d23febe9a6
2021-07-28 14:57:34 +08:00
Shawn Lin
f04b9b8231 Merge "[DO NOT MERGE] Support display cutout for multi-display devices" into sc-v2-dev 2021-07-28 06:31:21 +00:00
shawnlin
348c66b52b [DO NOT MERGE] Support display cutout for multi-display devices
- Add a new string array config that stores the unique id of each
  display and when loading the cutout configs we first look up the index
  of the unique id of the added display in the array and use this index
  to load the corresponding cutout configs.
- Add new array configs for every cutout configs.

Bug: 186604541
Test: make
Test: check the device and see if the cutout is correctly set for each
display

Change-Id: I038832795c11cd16969caff5031fa1090493b008
2021-07-28 11:54:43 +08:00