Commit Graph

14377 Commits

Author SHA1 Message Date
Yunfan Chen
9f804f7593 Merge "Report caption insets change when layout" into rvc-dev 2020-04-30 04:43:47 +00:00
Jeff Sharkey
1eb3fcfb33 Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev 2020-04-29 23:55:03 +00:00
Evan Rosky
650e162195 Merge "Shift Primary stack as well as secondary during ime adjustment" into rvc-dev 2020-04-29 20:55:18 +00:00
Jeff Sharkey
1639e6b8ee Update more Parcelables to send Strings UTF-8.
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes.  (So an improvement in
both cases!)

Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.

Bug: 154436100
Test: manual
Change-Id: I9a675473e0ce3a4a5c5e305dd851b40bb1560e1c
2020-04-29 14:54:44 -06:00
Jorim Jaggi
1db61c9a6e Merge "Decouple InsetsController from ViewRootImpl" into rvc-dev 2020-04-29 14:35:10 +00:00
Jorim Jaggi
bf87c15b33 Decouple InsetsController from ViewRootImpl
Such that all it's goodness can also be used in context when
ViewRootImpl isn't available, like the SystemUI controller used
for Car and Split

Test: InsetsControllerTest
Fixes: 154631128
Change-Id: I54a3f8a34810472d9273e4627a7811b7abd0863f
2020-04-29 14:00:09 +02:00
Rob Carr
6fcbf83d5e Merge "BLAST: Avoid JNI call on creation" into rvc-dev 2020-04-29 03:59:14 +00:00
Evan Rosky
e067ddfc05 Shift Primary stack as well as secondary during ime adjustment
Previously, was only 'adjusting' the secondary split for
ime. So the secondary had functional insets and drag/drop.
However, the primary wasn't being adjusted (accorcding to
WM). This caused its insets to be calculated against its
originla position (which allowed ime insets to potentially
overlap it) and it meant that WM didn't use its visual
position when calculating drag/drop coordinates.

So, this does the same with the primary stack as what was
done with secondary.

However, doing this required some other fixes in WM. Basically,
if appbounds is explicitly overridden, just use them instead of
intersecting with parent. Also, WSA doesn't apply crop for
splits (maybe it shouldn't apply crop to anything anymore).

Additionally, insets calculation was applying top insets to the
bottom if the inset frame's top wasn't exactly equal to the
window's top -- because of a catch-all else condition. So this
adds checks for matching the bottoms as well.

Bug: 154056542
Bug: 151862790
Test: Open two apps in split screen and open IME in secondary. Drag
      from secondary to primary.
Change-Id: I2391783e726e4a1c8ed3150628af2f398218fe90
2020-04-28 11:59:22 -07:00
Yunfan Chen
a07fb93cb0 Report caption insets change when layout
This patch let DecorCaptionView report back to it's owner about height
change, instead of let the DecorView query the height. The previous
query points enableCaption() and updateDecorCaptionStatus() cannot
ensure the caption layout is finished and attached to the phone window.
Such that it may return a zero caption insets when it shouldn't be, if
the app do window configuration change handling by restarting.

The layout will ensure the caption insets get set when everything is
ready.

There will be no caption height change when resizing or moving, make
sure the calculated insets always include the caption regardless of the
frame position.

Bug: 154792488
Test: Manuel test with message and settings app.
Test: go/wm-smoke
Test: atest InsetsControllerTest#testCaptionInsetsStateAssemble
Test: atest InsetsSourceTest#testCalculateInsets_caption_resizing
Change-Id: I1728628eccb32b912210a64fe3a1c9cbe9e3b302
2020-04-28 11:35:43 +09:00
TreeHugger Robot
5e9aed81d0 Merge "Support WRAP_CONTENT in InlineSuggestion#inflate" into rvc-dev 2020-04-27 23:52:59 +00:00
Diego Vela
7383ef7a6c Merge "Fix default constructor for DisplayAdjustments" into rvc-dev 2020-04-27 23:41:45 +00:00
Feng Cao
bd26abbc5b Support WRAP_CONTENT in InlineSuggestion#inflate
Test: atest android.autofillservice.cts.inline
Bug: 154887895

Change-Id: Ie420bd40e8f0fb7d6e6b1e47ed0f41dc3f85b25e
2020-04-27 15:12:14 -07:00
Evan Rosky
db49a262de Merge "Connect systemwindow root with accessibility" into rvc-dev 2020-04-27 21:52:07 +00:00
Robert Carr
ae8e0aea36 BLAST: Avoid JNI call on creation
JNI calls aren't free and we don't need to burn one
to call update with the values we just passed in.

Bug: 152501005
Test: Existing tests pass
Change-Id: Iaf272edb03d4ec195b75e9ef7e6c122604025dcb
2020-04-27 12:54:11 -07:00
Rob Carr
9005cdcf01 Merge "BLAST: Two start-up optimizations" into rvc-dev 2020-04-27 17:20:42 +00:00
Taran Singh
88191952ec Merge "Add test for ImeInsetsSourceConsumer" into rvc-dev 2020-04-27 17:08:05 +00:00
Charles Chen
413ce328e5 Merge changes Ida26b961,I1d416b9c into rvc-dev
* changes:
  Fix error in DecorView's ViewConfiguration
  Fix DecorView error about non-visual context
2020-04-27 08:57:58 +00:00
Charles Chen
6661575791 Fix DecorView error about non-visual context
This error showed because DecorContext uses application context
to get WindowManager. This CL changes to use PhoneWindow to obtain
WindowManager instance. Also refactor ctr to obtain context from
PhoneWindow.

Bug: 152806048
Test: manual - enable strict mode and check the error log not shown.
Test: atest DecorContextTest
Test: atest MemoryTests#testActivityRecreation
Change-Id: I1d416b9cdb015c9bc3553571041f3b14bb9da5da
2020-04-27 16:37:46 +08:00
TreeHugger Robot
6e9ee1c78f Merge "Keeps the served view of the window when focus to the next window" into rvc-dev 2020-04-27 04:40:38 +00:00
Ming-Shin Lu
6743813471 Keeps the served view of the window when focus to the next window
CL[1] intends to reset served view and restart input state when focus to
the next window, which the main idea is try to make the lifecycle of the
input connection can more aligned with the window focus change.

However, this behavior change unexpectedly breaks Gboard
TranslatesUIExtention that will closeExtensionView when
onFinishInputView -> onDeactivate called, while launching language
selection dialog.

Remove the reset logic as the lifecycle of input connection still
needs to break down.

[1]: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9

Fix: 152373385
Test: To make sure not break Bug 148489857 and Bug 148788569, following
auto / manual test to verify:
 - Auto: atest FocusHandlingTest#testKeyboardStateAfterImeFocusableFlagChanged
 - Manual:
    1) Build / install EditTextVariations
    2) Select menu -> Direct-Reply, make sure Notification comes up.
    3) Tap EditText on Notification, verify soft-keyboard is visible.

Change-Id: If20cdb43ecd013c330c5e16c73e9af972bd89f33
2020-04-27 03:22:52 +00:00
Robert Carr
b9cf275b9b BLAST: Two start-up optimizations
1. Avoid a seperate IPC querying in to system-server
   to initialize the mUseBLAST flag.
2. Avoid calling property_get_bool with each BufferQueue
   creation.

Instead we piggy-back both values inside addWindow return values.

Bug: 152501005
Test: Existing tests pass
Change-Id: If130560a8230f8d399cf7631264d551522939faa
2020-04-24 14:42:55 -07:00
Sally Yuen
8ab42a27ce Merge "Add @TestApi to registerSystemAction and unregisterSystemAction" into rvc-dev 2020-04-24 20:12:16 +00:00
Taran Singh
8321a2a48d Add test for ImeInsetsSourceConsumer
Add test to verify that requestedVisibleAwaitingControl starts
animation. This is followup test for comment in commit
I958fc5747382109aa2f21bc1067a28746e7242d8

Bug: 154440912
Fix: 153577930
Test: atest ImeInsetsSourceConsumerTest
Change-Id: I08db27151605ac53b0575b08343b5a75dc2e5fc2
2020-04-24 11:37:30 -07:00
TYM Tsai
4ddfdaf641 Merge "Filter the content of the Bundles used as extras and styling APIs" into rvc-dev 2020-04-24 08:42:56 +00:00
Shawn Lin
b578ddde3e Merge "Update the description of getWaterfallInsets()" into rvc-dev 2020-04-24 05:56:04 +00:00
Jason Hsu
ea2d4bf1fd Merge changes from topic "rhedjao_a11y_button_rollback" into rvc-dev
* changes:
  Rollback chooser menu to version Q behavior for accessibility button (2/n).
  Rollback chooser menu to version Q behavior for accessibility button (1/n).
2020-04-24 03:07:39 +00:00
Evan Rosky
cff7ebb93d Connect systemwindow root with accessibility
This sets the most-recently created view on a shellroot
to be used as the "accessibility" window. This allows
each shellroot to have 1 window that accessibility sees.

Bug: 152368950
Test: atest AccessibilityWindowQueryTest#testWindowDockAndUndock_dividerWindowAppearsAndDisappears
Change-Id: Ice2820e11544ccdf7a3e600f918eac0ffb506548
2020-04-23 19:01:53 -07:00
sallyyuen
8bc474b8df Add @TestApi to registerSystemAction and unregisterSystemAction
@SystemApi requires @hide, so @TestApi is needed for these to
be visible to CTS testing

Test: methods visible to CTS test
Bug: 152052560
Change-Id: Icd7f82f3859a1deccd41d2279d8f9722a42df957
2020-04-23 09:40:18 -07:00
Peter_Liang
0589ab0ae3 Rollback chooser menu to version Q behavior for accessibility button (2/n).
Allow separate Activities to handle the multiple-target case for the hardware and software shortcuts. Migrate from an extra to an explicit class so the Intent dispatch will launch the correct Activity for the particular shortcut.

Bug: 151294664
Test: manual test
Change-Id: I54bb1d3ab91e2757c465e8763786d0234f6d4ea8
2020-04-23 16:25:17 +00:00
Charles Chen
1e52a093ae Merge "Limit number of window context without any window" into rvc-dev 2020-04-23 03:34:37 +00:00
Jacky Kao
f6f8deea32 Merge "Makes AccessibilityNodeInfo#getSourceNodeId as test API" into rvc-dev 2020-04-23 01:08:46 +00:00
Tiger Huang
75485cf52e Merge "Do not dispatch leashes if they are not ready" into rvc-dev 2020-04-22 19:25:24 +00:00
Tiger Huang
e480e5f49c Do not dispatch leashes if they are not ready
The previous solution used a different transaction from the one used in
SeamlessRotator#finish. So the transaction might be applied in an
unexpected order between here and there when the target frame number is
reached.

This CL reverted the previous solution. Instead, we don't dispatch the
leash if it is not ready. For the client, it won't play the animation
until obtaining the leash.

Fix: 154195854
Test: Rotate device to change the orientation in Camera, and see if
      navigation bar stays visible.
Test: Check if transient bar can be shown/hidden/aborted as expected.
Test: Make sure b/153104643 stay fixed.
Test: atest InsetsPolicyTest
Change-Id: I29f80f1c77615b0a3cde38df265220f48d66f117
2020-04-22 20:23:18 +08:00
Charles Chen
2622d3ef7e Limit number of window context without any window
This change is to prevent misuse of window context from app
and leads to performance drop on system by limit the numer of window
context an app can use. Code snippet below is a sample to cause
this issue:
```
Rect getBounds() {
    Context windowContext = context.createWindowContext(...);
    return windowContext.getSystemService(WindowManager.class)
            .getCuttentWindowMetrics().getBounds()
}
```
This method could be invoked dozens of times and produce dozens of window
tokens. It would slow down the speed of window traversalling. These
token won't be removed until system server has been GC'd.

Test: atest WindowContextTests WindowContextPolicyTests
fixes: 152934797
Bug: 153369119

Change-Id: I927e85a45c05c4d90b51a624ea408ff3a3ffce93
2020-04-22 18:16:56 +08:00
Jacky Kao
ec8733e497 Makes AccessibilityNodeInfo#getSourceNodeId as test API
For testing the accessibilityNodeInfo constructor methods, making this
method, AccessibilityNodeInfo#getSourceNodeId, to become a testing API.

Bug: 154163930
Bug: 154163953
Test: a11y CTS & unit tests
Change-Id: I9a2ff665996e28d6d5770723d98b49f96eab1f50
2020-04-22 15:43:27 +08:00
TYM Tsai
850c8129e6 Filter the content of the Bundles used as extras and styling APIs
Adds filter to prevent passing binder objects in the extras and styling
APIs for inline suggestions. Avoids these to be used to send over remote
objects for Autofill provider and IME to communicate through private APIs
bypassing the OS.

Bug: 152316540
Test: atest CtsAutoFillServiceTestCases
Test: atest InlineSuggestionsRequestTest
Change-Id: I00940a845ed0e2546cbe09fa36e2439869c2f783
2020-04-22 14:41:07 +08:00
Taran Singh
8386c222c9 Merge "Fix Ime consumer isRequestedVisible" into rvc-dev 2020-04-21 20:11:13 +00:00
Miranda Kephart
44cc1e274b Merge "Add screenshots logging" into rvc-dev 2020-04-21 16:58:54 +00:00
shawnlin
96cde448c2 Update the description of getWaterfallInsets()
Bug: 154229434
Test: make
Change-Id: If70d09dfa96e82b4cc4d20cd9a17764ac3c5a2b7
2020-04-21 13:33:47 +08:00
Taran Singh
335ffd017c Fix Ime consumer isRequestedVisible
isRequestedVisible() was mistakenly missed from previous
commit I93dd5790e1fb3d7841ad1323a45cd3bae2d6e9b8

Fix: 154440912
Test: atest ImeInsetsControllerTest WindowInsetsControllerTests
Change-Id: I958fc5747382109aa2f21bc1067a28746e7242d8
2020-04-20 17:19:46 -07:00
TreeHugger Robot
afe3e11c65 Merge "Check for null mBlastBufferQueue" into rvc-dev 2020-04-20 23:22:49 +00:00
chaviw
ab581a4c04 Check for null mBlastBufferQueue
If there is a sync transaction, but blast is not enabled,
mNextDrawUseBLASTSyncTransaction will be true, but mBlastBufferQueue
will be null. This will cause a NPE when trying to call
mBlastBufferQueue.setNextTransaction

Test: Use sync transaction without blast
Fixes: 154527936
Change-Id: Ibff2de7fc7460f882acaceb0182c68ea4b05afb7
2020-04-20 12:48:19 -07:00
Mark Renouf
03f9a814a5 Merge "Scroll Capture Framework" into rvc-dev 2020-04-20 19:20:13 +00:00
Mark Renouf
a927929d99 Scroll Capture Framework
This is an implementation of long screenshots supporting
interactive, incremental capture of scrolling content using
a cooperative API between the app process and the system.

Design goals:

 - Provide for tile based incremental screenshots of scrolling content
 - Support existing apps without developer action
 - Provide support for non View-based Apps & UI toolkits

Bug: 148131831
Test: atest \
      FrameworksCoreTests:android.view.ScrollCaptureClientTest \
      FrameworksCoreTests:android.view.ScrollCaptureTargetResolverTest \
      FrameworksCoreTests:com.android.internal.view.ViewGroupScrollCaptureTest \
      FrameworksCoreTests:android.view.ScrollViewCaptureHelperTest \
      WmTests:com.android.server.wm.DisplayContentTest

Merged-In: I6c66a623faba274c35b8fa857d3a72030a763aea
Change-Id: I6c66a623faba274c35b8fa857d3a72030a763aea
2020-04-20 15:07:59 +00:00
TreeHugger Robot
dd4cd092b3 Merge "SurfaceView: Remove dead code" into rvc-dev 2020-04-17 22:52:27 +00:00
Robert Carr
b3ca38fb99 SurfaceView: Remove dead code
While debugging SurfaceView transaction usage I noticed this
code was unconditionally dead. Notice the else statement
only contains the single if statement within, so it could
be written as else-if. But then notice the condition of this
rewritten else-if is contained within the original if and
so it can never be entered.

Bug: 153120755
Test: Existing tests pass
Change-Id: I032b17911a9c71a1e3d09e3933e6f6a3d86dffb6
2020-04-17 14:14:33 -07:00
TreeHugger Robot
061f46b9bd Merge "Make setWallpaperZoomOut call oneway" into rvc-dev 2020-04-17 20:35:31 +00:00
Santiago Etchebehere
9548fd3220 Make setWallpaperZoomOut call oneway
There's no need to keep it synchronous

Bug: 154304487
Test: atest NotificationShadeWindowViewTest
Test: atest WallpaperControllerTests
Test: manual
Change-Id: I547e05fb4e2a5f2d30cfc5de354c36cd9070e65b
2020-04-17 11:53:36 -07:00
Taran Singh
9641cfc0fa Support WIC.show(IME) from Activity#onCreate
In Q, app developer would've to wait for InputConnection on Editor before
showSoftInput() could be called. This made API very un-intuitive. While
WIC.show(ime) took care of some of the scenarios, it didn't handle
showing IME from onCreate() i.e. when control is not yet available.
This CL introduces a pending IME show request that waits until IME
control is available.

Test: atest WindowInsetsControllerTests#testShowImeOnCreate
Bug: 153014086

Change-Id: I93dd5790e1fb3d7841ad1323a45cd3bae2d6e9b8
2020-04-17 10:41:30 -07:00
Miranda Kephart
7b2c313da7 Add screenshots logging
Bug: 150710005
Test: manual
Change-Id: I54a37eb0a62234c6c53fc0f3c80e18e9ee269f12
2020-04-17 13:28:23 -04:00