Commit Graph

14402 Commits

Author SHA1 Message Date
Jorim Jaggi
98f012c304 Merge "Restore force relayout logic for apps targeting < R" into rvc-dev 2020-05-04 20:44:08 +00:00
Feng Cao
98367aef11 Merge "Make autofill requested by augmented autofill service non-manual" into rvc-dev 2020-05-04 20:30:01 +00:00
TreeHugger Robot
1e15db9ce4 Merge "SurfaceControlViewHost: Let ViewRoot release control." into rvc-dev 2020-05-04 20:19:04 +00:00
TreeHugger Robot
fcaa5a8667 Merge "Fix IME visibility after lock screen" into rvc-dev 2020-05-04 20:00:53 +00:00
Feng Cao
08abd46f61 Make autofill requested by augmented autofill service non-manual
* The use case of this API was for augmented autofill service to send
  updated suggestions
* Before this change, the dynamic autofill request by the augmented
  autofill service only triggers a manual request, but this has caused
  some regular autofill providers to always some suggestion due to
  their special handling for the manual request. Thus the augmented
  autofill service will not receive the request.
* With this cahnge, the request cancels the previous session to start a
  new session, and also it triggers a regular request (non-manual) so
  the autofill provider will not special handle the request.

Test: atest CtsAutoFillServiceTestCases
Bug: 154543563

Change-Id: I233125a6070394a102ad40b9a50b98a43d952b9f
2020-05-04 11:36:21 -07:00
Robert Carr
8644050a99 SurfaceControlViewHost: Let ViewRoot release control.
In SurfaceControlViewHost#release we currently immediately
release mSurfaceControl and then call ViewRootImpl#doDie.
However doDie executes on a handler so the ViewRootImpl may try
and use the SurfaceControl between posting and executing
the message. Actually this release is totally erroneous,
mSurfaceControl is the same object used by the ViewRootImpl
and the ViewRootImpl will release it when processing
doDie().

Bug: 155575445
Test: Existing tests pass
Change-Id: I6a4bf41ba38636ff884aa73d2653b1bab6958b00
2020-05-04 11:23:29 -07:00
Jorim Jaggi
653828d09e Restore force relayout logic for apps targeting < R
Test: Open IME in Telegram
Fixes: 153832271
Change-Id: I0c26bbaeb22b06718054fccdec0b550129ccecf8
2020-05-04 17:01:09 +02:00
Steven Thomas
5724666853 Merge "Split refresh rate range into two ranges" into rvc-dev 2020-05-02 02:12:39 +00:00
Andrew Sapperstein
975ca816ec Merge changes from topic "cherrypick-ctor-refs-03y8i58ine" into rvc-dev
* changes:
  Update inner class constructor refs to use proper syntax.
  Fix broken @see tags in public documentation.
2020-05-02 00:21:33 +00:00
Feng Cao
4e20f2b97c Merge "Support receiving touch event in the inline suggestion view" into rvc-dev 2020-05-01 22:07:39 +00:00
Feng Cao
c23bfc7819 Support receiving touch event in the inline suggestion view
* Before this change, the suggestionRoot would intercept all touch
  events so that it can optionally forward them to the IME process
  to support scrolling, no touch event will be sent to the child
  view through the regular event dispatching process.
* With this change, we move the touch event transferring (to IME)
  logic from SuggestionRoot's onTouchEvent to dispatchTouchEvent.
  Now the touch events before a scroll is detected will be sent to
  the child chip view, and only the touch events after a scroll is
  detected will be sent to the IME.
* This patch also move the OnClickListener and OnLongClickListener
  from the root view to the chip view, since the touch events now
  either goes to the chip view or to the IME process.
* Note that in order to achieve this, given that we can't change
  the API, and there is existing OnLongClickListener registered
  to the chip view, we have to add a @hide API to the View to
  get the existing OnLongClickListener and attach a new one to the
  chip view, such that we can do the additional work of sending
  the long click event to IME, when the view is long clicked.
* This patch should also fix the a11y talkback mode bug where
  double-tapping on the view doesn't autofill the value.
  Double-tap and hold also works that it triggers the attribution
  dialog.

Test: atest CtsAutoFillServiceTestCases (sanity test)
Bug: 155245913
Bug: 154149807

Change-Id: I6f7be1ea5c0955969abb4ccae0cb421423095c4d
2020-05-01 12:36:51 -07:00
Andrew Sapperstein
88d565e7e7 Update inner class constructor refs to use proper syntax.
Previously, we generally required fully qualified names for referring
to inner class constructors (like #Notification.Builder()) despite that
not being valid javadoc. Now, we properly support #Builder() syntax and
the old syntax will error.

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
Merged-In: Ib2e4360493275b79c72487ee1cb173bb5e0fd35f
(cherry picked from commit 4c4aa41272)
2020-05-01 18:33:15 +00:00
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Abodunrinwa Toki
1cf3ce8fde Merge "Rewrite Icons from the TCS." into rvc-dev 2020-05-01 10:52:43 +00:00
Steven Thomas
305a57c5fc Split refresh rate range into two ranges
To prevent low-priority refresh rate considerations from overriding the
app frame rate as specified via the new setFrameRate() api, split the
display refresh rate range into "primary" and "app request" ranges. The
primary range includes the low priority considerations, while the app
request range removes two lower priority considerations.

In general, surface flinger will keep the display refresh rate within
the primary range, but layers with frame rate settings via the
setFrameRate() api may cause surface flinger to pick a refresh rate
outside the primary range. Surface flinger will never choose a refresh
rate outside the app request range specified by display manager.

Bug: 148978562

Test: - Added a new unit test to DisplayModeDirectorTest to verify that
        display manager strips lower priority considerations when
        deciding the app request range.

- Added a new unit test to RefreshRateConfigsTest to verify
  RefreshRateConfigs handles the primary vs app request range
  correctly.

- Manual test: Confirmed that with the "force 90Hz refresh rate" option
  turned on, we don't switch to 60Hz when playing a 60Hz video.

- Manual test: Confirmed that with the "force 90Hz refresh rate" option
  turned on, when an app calls setFrameRate(60), we stay at 60Hz.

- Manual test: Modified a Pixel 4 XL to prefer 60Hz in low brightness,
  entered low brightness, and confirmed we don't touch boost to 90Hz.

- Manual test: Confirmed that Maps stays at 60Hz on Pixel 4.

- Manual test: Turned on verbose logs in RefreshRateConfigs.cpp,
  confirmed they look good.

- Manual test: Inspected dumpsys output, confirmed the primary and
  app request refresh rate ranges are printed correctly.

Change-Id: I2a7f5ded0831c90b9b1ac09d941963a63b824098
2020-04-30 19:58:42 -07:00
TreeHugger Robot
d725389a55 Merge "Update the documentation for inline suggestion APIs" into rvc-dev 2020-05-01 01:42:05 +00:00
Evan Rosky
5a61909275 Merge "Give Divider back its touch-region" into rvc-dev 2020-05-01 00:11:36 +00:00
Taran Singh
c1d504c0c5 Fix IME visibility after lock screen
IME was not able to hide itself correctly after lock screen, resulting
in visibility state being inconsistent.

Bug: 154753046
Test: atest KeyguardLockedTests#testImeShowsAfterLockScreenOnEditorTap
            WindowInsetsControllerTests
Change-Id: Ice33d68e999627b7b62410d22cd51e18f8e23d34
2020-04-30 13:18:53 -07:00
Tiger Huang
b8ad491e6d Merge "Ensure the requested insets state is up to date" into rvc-dev 2020-04-30 17:56:41 +00:00
Tiger Huang
173480f29d Ensure the requested insets state is up to date
Previously, the client won't send the modified insets state to window
manager if the dispatched state and the local state are the same. The
following case can make the requested insets state at the server side
stale:

1. Window A requests an insets source to be invisible while having
   the control.
2. Window A loses the control.
3. The new control target requests the insets source to be visible.
4. Window A receives the new insets state from server.
5. Window A also requests the insets source to be visible while not
   having the control.
6. Window A gain the control.
7. Window A won't send the new requested state (visible) to window
   manager because the local state and the dispatched state are the
   same.
8. Window manager keeps assuming that window A is requesting the insets
   source to be invisible which is incorrect.

This CL stores what insets state is sent to server, and updates/sends
the state to server while gaining the control if the requested state is
changed.

Fix: 146964271
Test: Manual.
Change-Id: I6ee533d9316c769faef539bfb980197c351ee8d1
2020-05-01 00:27:38 +08:00
Adrian Roos
1cd9750aa4 Merge "WindowInsetsController: make available after addView" into rvc-dev 2020-04-30 15:40:26 +00:00
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
Adrian Roos
7794a00407 WindowInsetsController: make available after addView
Fixes an issue where the WindowInsetsController was only available after
the first traversal.

Bug: 155280356
Test: atest WindowInsetsControllerTests
Change-Id: I225efcaa31e97da9e8ebc6bd7d24c433c8e80826
2020-04-29 17:13:57 +02: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
TYM Tsai
e79aa09f87 Update the documentation for inline suggestion APIs
Update the APIs documentation and add test cases

Bug: 152316540
Test: atest InlinePresentationStyleUtilsTest
Change-Id: Icff5d5b36fecd94ceb7db5446eefa16b4b1aac3b
2020-04-29 17:21:01 +08: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
Evan Rosky
128372810d Give Divider back its touch-region
Divider used to have a touch-region that allowed apps
to receive touch events that would normally overlap the
divider window as long as they weren't in the center.

Re-introduce this by allowing windowless windows to
pass through a touch-region. This region is always
constrained to the window size to prevent security issues.

Bug: 154840035
Test: Enter split and observe touch events away from
      center of divider.
Change-Id: I85310c78beda7bd5574df78e2a83462e965d1154
2020-04-28 09:39:37 -07:00
Abodunrinwa Toki
8f2bf3cb53 Rewrite Icons from the TCS.
Because of the new app visibility constraints introduced in Android R,
apps may be unable to load icons from the TextClassifierService (TCS).
This is because the TCS returns "Icons" based on resources to the apps.
These resources were globally available until this new restriction.

In this CL, the TCMS rewrites responses with Icon(typ=RESOURCE) coming
from a TCS to responses with Icon(typ=URI). The new icons are backed
by a content provider that may be used to retrieve the necessary icons.

Bug: 151847511
Test: atest tests/tests/textclassifier/src/android/view/textclassifier/cts
Test: atest core/tests/coretests/src/android/view/textclassifier
Test: Select a phone number text, check that the "Call" icon shows
Change-Id: Ib63e54462508029cdf0e56c2c6a82ff4e81b02a8
2020-04-28 15:02:26 +01: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