Commit Graph

13792 Commits

Author SHA1 Message Date
Rob Carr
b6a5575a0f Merge "Replace deferTransactionUntilSurface with deferTransactionUntil" 2020-01-24 20:22:06 +00:00
TreeHugger Robot
cf38272125 Merge "Add inline controller UI fields to the autofill response and IME inline response" 2020-01-24 04:28:41 +00:00
Zak Cohen
43d858805b Merge "Screenshot helper - add method that allows the caller to supply bitmap." 2020-01-24 03:57:54 +00:00
Colin Cross
db2bb3e12a Fix docs error
Fixes:
out/soong/.intermediates/frameworks/base/doc-comment-check-docs/android_common/srcjars/android/view/View.java:12544: lint: Unresolved link/see tag "android.view.Window#setOnContentApplyWindowInsets Window#setOnContentApplyWindowInsets" in android.view.View [101]
out/soong/.intermediates/frameworks/base/doc-comment-check-docs/android_common/srcjars/android/view/View.java:12564: lint: Unresolved link/see tag "android.view.Window#setOnContentApplyWindowInsets Window#setOnContentApplyWindowInsets" in android.view.View [101]

Test: out/soong/.intermediates/frameworks/base/doc-comment-check-docs/android_common/doc-comment-check-docs-docs.zip
Change-Id: Ifdae4bad3f8a30d70a8894de8f7b011ba961adae
2020-01-23 18:37:27 -08:00
Zak Cohen
ebd3b8b1e9 Screenshot helper - add method that allows the caller to supply bitmap.
Add a method to screenshot helper that allows the caller to provide the
bitmap to be treated as a screen shot.
First use Overview can provide a task snapshot to use as a screenshot.

Test: update tests, local
Bug: 145297320

Change-Id: I4d21906212797bf394094d7a29208be02a6bfd7e
2020-01-23 14:59:31 -08:00
Steven Thomas
8c9f31b8b0 Merge "Add setFrameRate() api" 2020-01-23 19:40:20 +00:00
Feng Cao
9199498b46 Add inline controller UI fields to the autofill response and IME inline response
Test: build
Bug: 147394280

Change-Id: I4949852bb042390b35962627617d062bcd9b24b9
2020-01-23 11:22:56 -08:00
Adrian Roos
cce89e2785 Merge "Introduce WindowMetrics and WM#getCurrent/MaximumWindowMetrics" 2020-01-23 16:30:47 +00:00
Adrian Roos
1a585bec15 Merge "Window Manager Flag Migration (12/n)" 2020-01-23 16:29:44 +00:00
Adrian Roos
d7d9c3e354 Merge "Introduce WindowContext API" 2020-01-23 13:19:08 +00:00
Wale Ogunwale
ca5714920f Merge "Update IMM delegate if view root is moved to a different display" 2020-01-23 13:18:22 +00:00
Tiger Huang
527244459c Window Manager Flag Migration (12/n)
- Unhide new APIs
- MaxInsets -> InsetsIgnoringVisibility
- Deprecate SystemUI flags
- Deprecate some other stuff

Bug: 118118435
Test: Build, CTS coming soon
Change-Id: I0a0cbdb48258b3779d536668b59e8c88f3c96d18
Exempt-From-Owner-Approval: Trivial rename
2020-01-23 14:11:39 +01:00
Jorim Jaggi
80443cf213 Merge "Fix fraction, and other cleanup" 2020-01-23 12:49:32 +00:00
Jorim Jaggi
af30559dc3 Merge changes from topic "content_apply"
* changes:
  Force non-floating main app windows to not fit anything
  Introduce Window.setContentOnApplyWindowInsetsListener
2020-01-23 10:52:36 +00:00
Riddle Hsu
d4502794dc Update IMM delegate if view root is moved to a different display
Although it makes sense to not get IMM delegate every time, the
instance may need to be refreshed if the associated display is
changed because InputMethodManager returns different instance for
different display.

Fix: 148189172
Test: atest MultiDisplayClientTests# \
            testDisplayIdUpdateWhenImeMove_NoRelaunchActivity

Change-Id: Id4c85be1c0eab51f167ba00fc355386f852c424d
2020-01-23 18:07:32 +08:00
TreeHugger Robot
62a96a11f8 Merge "Add surrounding text to EditorInfo to speed up IME startup" 2020-01-23 06:45:34 +00:00
Charles Chen
f65e022caa Introduce WindowMetrics and WM#getCurrent/MaximumWindowMetrics
Bug: 128338354
Bug: 146820733
Test: atest WindowMetricsTests

Change-Id: I328b1b5a2296e470072a439e412276c1b6008789
2020-01-22 18:30:40 -08:00
Andrii Kulian
4a31697319 Introduce WindowContext API
Test: atest WmTests CtsWindowManagerDeviceTestCases
Bug: 128338354
Change-Id: I9c9dfc5e7f4edd4c968e60d2ffcbb19b5c72a853
2020-01-22 18:30:29 -08:00
Chris.CC Lee
c486acc4d2 Add surrounding text to EditorInfo to speed up IME startup
Previously when IMEs want to get initial input text for advanced
prediction featues, it will take up to three IPC calls. Once we provide
the initial text in the EditorInfo object, it would be available right
after the input connection setup and no IPC overheads will be
introduced.

Bug: 122691437
Test: atest FrameworksCoreTests:TextViewTest
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: Ie04f2349b1157408aa8ed9044aea12ce99132cb4
2020-01-23 02:28:52 +00:00
Rob Carr
5c8b722dc5 Merge changes from topics "scvhpapi", "wwm-api-3"
* changes:
  Unhide SurfaceControlViewHost API
  SurfaceView: Add reparentSurfacePackage method
2020-01-23 00:34:10 +00:00
Jorim Jaggi
dd3304ec3b Fix fraction, and other cleanup
Fraction is now from animation start to end state. This makes it
more in line with other animation fraction meaning. Also, the app
can figure out the animation direction on its own by inspecting
the visibility state when the animation gets prepared.

Also fix some other stuff in WindowInsetsAnimationCallback.

Test: CTS coming soon
Bug: 118118435
Change-Id: I81d36159817719a9b0ee25bb78cfbfddc2029270
2020-01-23 00:36:28 +01:00
Jorim Jaggi
0da8fd165f Force non-floating main app windows to not fit anything
Since we have a better approach of fitting content instead of
setting them on the layout params
(Window.setContentOnApplyWindowInsetsListener), we can now
simplify forcing of filling the screen:

Instead of clearing the fit types when the private flag is set, we
unset the types and straight out reject any params when the client
would like to fit.

Test: DisplayPolicyTests
Bug: 118118435
Change-Id: I845e6b1c81e29ab66a770891d03c62a32418e8cc
2020-01-23 00:27:58 +01:00
Steven Thomas
6cf051ef89 Add setFrameRate() api
setFrameRate() is a new api in Android 11 that will enable apps to
specify their intended frame rate.

Bug: 143912624
Bug: 137287430

Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest.

Change-Id: I922573c0d704e2e0ce4cfc2a462f14dce8cb7a79
2020-01-22 13:20:42 -08:00
Robert Carr
87f5d2cb78 Unhide SurfaceControlViewHost API
Unhide the SurfaceControlViewHost API and the getHostToken/setChildSurfacePackage
API's required to use them.

Bug: 134365580
Bug: 140587144
Test: WindowlessWmTests
Change-Id: I0c5af2166f1d87947f54a492fd0b887c6253b9fe
2020-01-22 12:54:06 -08:00
Jorim Jaggi
7fb715c425 Introduce Window.setContentOnApplyWindowInsetsListener
When root-level content containers fit insets, they used to just
apply and consume the entire system insets. However, with the new
Inset APIs, and with deprecating ADJUST_RESIZE IME flag, we want
to give apps an easy way to customize this behavior.

For that, we introduce Window.setOnContentApplyWindowInsetsListener
that returns what kind of margins/padding should be applied and
what should be dispatched to the content views. This is essentially
a replacement for SYSTEM_UI_FLAG_LAYOUT_* as well as
SOFT_INPUT_ADJUST_RESIZE: It allows apps to choose which insets
should be handled on the window level vs view level.

For that, we mark the window decor views as
FRAMEWORK_OPTIONAL_FIT_SYSTEM_WINDOWS, in order to distinguish the
case when support library calls makeOptionalFitSystemWindows(). This
is because of two reasons:
- We don't want the listener to be invoked twice.
- We can not do the compat ping-pong between onApplyWindowInsets
and fitSystemWindows. This is because during the ping-pong, the
result of the OnContentApplyWindowInsetsListener would be lost.
However, we still need to do the compat ping-pong for
ActionBarOverlayLayout in the support library (until that gets
migrated to use onApplyWindowInsets), so we have this separate
dispatching path that only gets used for framework optional
fitting views.

Test: WindowTest
Bug: 118118435
Change-Id: I4b514addd9e094163062d651972f85615b4a35db
2020-01-22 18:09:04 +01:00
Taran Singh
0b19cd94c8 Merge "Pipe windowToken of window requesting IME" 2020-01-22 07:36:51 +00:00
Robert Carr
30ad618cfe SurfaceView: Add reparentSurfacePackage method
For use with SurfaceControlViewHost. Currently this just performs a reparent
but it's future use is to also automatically link the accessibility IDs
of the embedded content and the SurfaceView.

Test: No test, to unblock accessibility team. Builds.
Bug: 134365580
Change-Id: I990c0f29b439ed6e6f18bdfa4be2c1d46f502503
2020-01-21 22:24:54 -08:00
TreeHugger Robot
a6a219e657 Merge "Fix some thread handling issues in InputMethodManager" 2020-01-22 06:03:38 +00:00
lumark
3f733cc7ef Fix some thread handling issues in InputMethodManager
- Make sure onCheckIsTextEditor should be called on the UI thread for
preventing exception in some cases that will break start input background
thread.

- Refine IMM#checkFocus and DelegateImpl#startInput to be out of
lock object to prevent start input background thread may blocked by other
methods which already inside the lock.

- Cache InputMethodManagerDelegate object for ImeFocusController#getDelegate.

Fix: 147447217
Bug: 141738570
Test: manual as test steps:
     1) Launch Keeeps app, type some web-URL link.
     2) Long press on any URL link > From the toolbar select "open / browser"
        and observe.
     3) Expect the soft-keyboard should be hidden after entering the
     browser page.
Test: atest CtsInputMethodTestCases

Change-Id: I098df41f935438bf1889fb030c7a3e7a0645a168
2020-01-22 12:34:14 +08:00
Tarandeep Singh
bb0e2f753b Pipe windowToken of window requesting IME
It takes time from when IME is requested to the time when IME is ready
to be shown. When its ready to be shown, we need to make sure that
window that requested IME is still the IME target in DisplayContent. The
only realistic way of knowing originating window is passing windowToken
from IMM API.

Bug: 111084606
Test: CtsInputMethodTestCases

Change-Id: Ia49e23dd077d264a58d28a7b8acffde54b7db187
2020-01-21 17:02:22 -08:00
Valerie Hau
2eb5cc7bf9 Merge "Adding WINDOW_MANAGER_NATIVE_BOOT and window_manager_use_blast_adapter flags" 2020-01-21 22:20:04 +00:00
Lucas Dupin
c1df8667ea Merge "Expose blurs to SurfaceControl" 2020-01-21 21:55:13 +00:00
Qasid Sadiq
86fc75c1a0 Merge "Throttle stateDescription changed events" 2020-01-21 20:30:37 +00:00
Jorim Jaggi
2b16b5993d Merge "Fix up new insets dispatch behavior" 2020-01-21 18:28:58 +00:00
Valerie Hau
eeef1a9baa Adding WINDOW_MANAGER_NATIVE_BOOT and window_manager_use_blast_adapter flags
For ViewRootImpl on BLAST experiment, setting up namespace and flag to
turn on Blast adapter through P/H experiment

Bug: 147096935
Test: build, boot, adb shell device_config put
window_manager_native_boot wm_use_blast_adapter true/false
check that BLAST adapter is turned on/off as expected
Change-Id: Ie1b158721ac9b751fcf3954310259f14486d3bb8
2020-01-21 10:01:39 -08:00
Jorim Jaggi
6d13bf4a54 Fix up new insets dispatch behavior
- Fix up target SDK check
- Keep WindowInsets.CONSUMED concept to stop dispatch for
performance optimization. If the insets are handled at some point
in the hierarchy, we really don't need to dispatch it to all the
children. However, deprecate all the individual consuming methods
instead.

Bug: 118118435
Test: ViewGroupTest
Change-Id: I6b6627fb9c0a43444ee3f9dbeb978109f9138fbd
2020-01-21 17:03:04 +01:00
Valerie Hau
dac3d675fa Merge "Preserve intended width/height for Blast adapter layers" 2020-01-21 15:50:28 +00:00
TreeHugger Robot
66031b3a58 Merge "Window Manager Flag Migration (10/n)" 2020-01-21 12:29:47 +00:00
Tiger Huang
7238a059c0 Window Manager Flag Migration (10/n)
Refine the APIs of system bar appearance/behavior:
- Add getters
- Let the caller can only change certain appearance flags with out
  touching others
- Adjust appearance/behavior for the legacy apps if they don't uses the
  new APIs

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyLayoutTests
            DisplayPolicyInsetsTests DisplayPolicyTests
            TaskSnapshotSurfaceTest

Change-Id: I388decc9dc9b617348a6352b81fe77a19f27a0d7
2020-01-21 19:00:17 +08:00
Tiger Huang
b8429e8051 Merge "Window Manager Flag Migration (11/n)" 2020-01-21 10:13:44 +00:00
TreeHugger Robot
b2b692f99d Merge "Make client InsetsAnimationControlListener impl static" 2020-01-21 06:02:45 +00:00
Yunfan Chen
4523d5d715 Make client InsetsAnimationControlListener impl static
This will let server be able to re-use the same implementation during
the insets animation.

Test: atest InsetsControllerTest
Test: New insets API test app works as expected.
Bug: 118118435
Change-Id: Ie8522d2b86ea117e83c1fa806d831604f112ff55
2020-01-21 13:36:17 +09:00
Lucas Dupin
991415e732 Expose blurs to SurfaceControl
SurfaceControl now has #setBackgroundBlurRadius, which receives a radius in pixels
pointing out how much the content behind the current window should be blurred.

Bug: 141640413
Test: visual; on power menu and shade
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I367f8a7199d5b37ad476d3c2bc02c8900f8c1f9e
2020-01-20 13:49:46 -08:00
Charles Chen
eb0ebddc1a Merge "Split status bar window (1/N)" 2020-01-20 17:23:36 +00:00
Tiger Huang
41ae5e8505 Window Manager Flag Migration (11/n)
This CL dispatches the compatible system UI visibility to the app.

There are some changes about the flag of low profile in the new insets
mode:
- A window cannot detect if another window changes the system bars to
  the low profile mode via OnSystemUiVisibilityChangeListener.
- SYSTEM_UI_FLAG_LOW_PROFILE won't be cleared by swiping to show bars.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyLayoutTests
            DisplayPolicyInsetsTests DisplayPolicyTests
            TaskSnapshotSurfaceTest InsetsAnimationControlImplTest

Change-Id: I85b720fd6b09c206ec56ca661cd5b645f7add404
2020-01-20 22:06:14 +08:00
Shawn Lin
d459dc237c Merge "Add a new flag ALWAYS for layoutInDisplayCutoutMode" 2020-01-20 14:02:57 +00:00
Jorim Jaggi
0865f08f5a Merge "Migrate LAYOUT_STABLE in new insets world" 2020-01-20 13:33:26 +00:00
Galia Peycheva
a85b3d56a3 Merge "Add a TestApi to DM to get the last requested MPP" 2020-01-20 08:05:39 +00:00
shawnlin
7dabcab3dd Make DisplayCutout support waterfall insets
For waterfall display, also take the waterfall insets into accout to
comput safe insets.

Change-Id: I1d5663ebd8588021387b7ae5296851769954f996
Bug: 146876976
Test: atest DisplayCutoutTest
2020-01-19 14:49:12 +08:00
Qasid Ahmad Sadiq
35b6f54463 Throttle stateDescription changed events
Similar to scrolling, state description changes can happen very
frequently, so let's not overwhelm the service when the user is focused
on something like a slider of progress bar.
Isolating and reusing scroll event throttling code to do this.

Test: Added CTS tests in other CL, tried scroll viewws around the
system, and progress bar and slider in talkback test app (which have
already adopted state API).
Fix: 145626718

Change-Id: I4f7d2e526d7d453485615c089b04a8a698828279
2020-01-17 22:53:48 +00:00