Commit Graph

13659 Commits

Author SHA1 Message Date
TreeHugger Robot
1e4c5237df Merge "Add minimal post processing API to framework" 2019-12-25 13:14:51 +00:00
Tiger Huang
7a339ca8e2 Merge "Call InputEventReceiver.dispose from the right thread" 2019-12-25 05:26:07 +00:00
Tiger Huang
dbc4e9c468 Merge "Window Manager Flag Migration (8/n)" 2019-12-24 08:41:13 +00:00
Tiger Huang
82520fcb67 Window Manager Flag Migration (8/n)
Dispatch the copied insets states and controls if the client and the
server are in the same process. Otherwise, changing them at the server
side will affect ones at the client side, and vice versa.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyLayoutTests
            DisplayPolicyInsetsTests DisplayPolicyTests
            TaskSnapshotSurfaceTest NavigationBarColorTest
Change-Id: Iabe9fb1f345f576f08b156f32aa9bd3989911149
2019-12-24 14:28:40 +08:00
TreeHugger Robot
4c3a915c36 Merge "Add styling related fields to Inline presentation spec." 2019-12-24 01:54:31 +00:00
Feng Cao
7a0f002f5a Add styling related fields to Inline presentation spec.
Test: manual
Bug: 146454892

Change-Id: Id8f08ad0ee69e5c9c24fe038a06cbae3a3bc2c57
2019-12-23 15:53:58 -08:00
TreeHugger Robot
b722457082 Merge "Fix layer metadata key for a11y ID." 2019-12-23 23:38:49 +00:00
Galia Peycheva
056b3ee745 Add minimal post processing API to framework
This API allows applications to instruct the connected display to do minimal
post processing on the produced image or video frames. This will switch the
display to a low latency mode (ALLM, Game mode or some other custom
implementation thereof), reducing lag in the final images. Thus, minimal post
processing would greatly enhance performance for gaming and video
conferencing applications. It would not, however, suit applications that
prioritise image quality over performance.

This CL adds 2 public method:
 - Window.setPreferMinimalPostProcessing()
(this can also be set in WindowManager.LayoutParams.preferMinimalPostProcessing)
If minimal post processing is preferred, the connected display will be requested
to go into low latency mode, which reduces image processing, resulting in better
performance for gaming applications. If the Display sink is connected via HDMI,
the device will begin to send infoframes with Auto Low Latency Mode enabled and
Game Content Type. This will switch the connected display to a lower latency
mode (if available).
For more information, see HDMI 2.1 specification.

If the Display sink has an internal connection or uses some other protocol than
HDMI, effects may be similar but implementation-defined.

 - Display.isMinimalPostProcessingPreferred()
Returns true if the connected display supports either Low Latency Mode (ALLM or
some other custom low latency implementation) or Game content type.

Bug: 135116095

Test: make -> flash on ATV OTT device -> open an activity which requests minimal
post processing -> check SurfaceControl logs -> verify correct signals are
passed to native

Change-Id: I5508bb9e5c138b0f2b42d8f8fab10e1915ba3cb6
2019-12-23 17:27:55 +01:00
Tiger Huang
ced251f389 Call InputEventReceiver.dispose from the right thread
TaskPositioner attaches the InputEventReceiver to the animation thread.
This CL makes it to dispose the receiver in the same thread to avoid
race conditions.

This CL also makes InputEventReceiver.finalize call dispose from the
right thread.

Bug: 122054478
Fix: 122096091
Test: 1. Make a task enter free-form mode.
      2. Drag and drop the task.
      3. Check if InputEventReceiver.dispose and finishInputEvent are
         executed in the same thread.

Change-Id: I2f8831e7fccca4f96562f2abe4962811339d02e9
2019-12-23 13:21:10 +08:00
Joanne Chung
3468ae5320 Merge "TextLinks API updates." 2019-12-23 02:11:45 +00:00
Daichi Hirono
638ae6d112 Fix layer metadata key for a11y ID.
Index 4 has already been used for METADATA_MOUSE_CURSOR.
The CL fixes the index for a11y ID from 4 to 5.

Bug: 143734779
Test: None
Change-Id: I295f8d327101c58c0034cf2a39d428d2bb397d0b
2019-12-23 11:07:01 +09:00
Steven Thomas
a7872c333d Merge "Switch from allowed display configs to refresh rate range" 2019-12-21 01:43:34 +00:00
George Mount
c9cf8c1e40 Merge "Add public access to debug layout bounds flag." 2019-12-20 23:28:32 +00:00
George Mount
658db3c23f Add public access to debug layout bounds flag.
Jetpack compose UI wants to respond to the developer setting
that shows the layout bounds of Views to show layout bounds
of it sub-elements. This API gives access to that value.

Bug: 146676765
Test: New CTS test
Change-Id: I1c45f9e6f0ab1192f231ad34df88e392214fa061
2019-12-20 23:27:57 +00:00
Winson Chung
afbe32079a Merge "Clean up remote animation definitions when activity is destroyed" 2019-12-20 17:52:36 +00:00
Lucas Dupin
5465b18518 Merge "Enable WCG support for ImageWallpaper" 2019-12-20 17:28:49 +00:00
Winson Chung
10fc25dadd Clean up remote animation definitions when activity is destroyed
- Remove the remote animation definition when the associated process dies
- Also expose method to unregister any registered animation defs

Bug: 139137636
Test: Kill launcher, ensure the remote animation ref is removed
Change-Id: Ia38d037397703221c17c8258ec1a245055d5896d
2019-12-19 15:01:50 -08:00
Hongwei Wang
41df8e465c Merge "Move rotation bounds calculation into SysUI" 2019-12-19 22:19:49 +00:00
Hongwei Wang
ebf1808abc Move rotation bounds calculation into SysUI
Also included in this CL
- Cleanup all bounds calculation in PinnedStackController
- Move PipSnapAlgorithm to SysUI

Bug: 139016833
Bug: 139016576
Bug: 145133340
Test: atest PinnedStackTests
Test: atest MultiDisplayActivityLaunchTest
Test: atest MultiDisplaySystemDecorationTests
Change-Id: Ifa0621a1cb69e76498e020aef7d8fa815df4ce48
2019-12-19 12:36:53 -08:00
TreeHugger Robot
c5c9e5c25a Merge "Add SurfaceControl.Transaction lock debugging utility." 2019-12-19 17:06:17 +00:00
Artur Satayev
50aa67dff1 Merge "Use new UnsupportedAppUsage annotation." 2019-12-19 13:43:58 +00:00
Joanne Chung
f652343e63 TextLinks API updates.
1. Add get/setReferenceTime to TextLinks
2. Make TextLinks.getText() public

Bug: 143873595
Test: atest FrameworksCoreTests:android.view.textclassifier
Test: atest android.view.textclassifier.cts.TextClassifierValueObjectsTest
Change-Id: I720e0e1fe9e4d05de0d7a1427f7d7ded01287aff
2019-12-19 14:32:57 +08:00
TreeHugger Robot
6d080ff13b Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" 2019-12-18 16:42:02 +00:00
Artur Satayev
ad9254cb1d Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
2019-12-18 16:27:02 +00:00
Daulet Zhanguzin
e1559479eb Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: Ia0e5166475169769f22cfd4ee7e23b6408a5e981
2019-12-18 14:20:29 +00:00
Derek Sollenberger
7da86dd922 Merge "Move FrameMetricsObserver logic into UI Module." 2019-12-18 12:14:26 +00:00
Adrian Roos
cc64caeacf Merge "Revert "Enable IME Insets flag"" 2019-12-18 09:42:08 +00:00
Robert Carr
fee0b82175 Add SurfaceControl.Transaction lock debugging utility.
Add a subclass of SurfaceControl.Transaction which can be given a monitor
object at construction. If the monitor is not held when other methods are
called the method will throw an exception. This should help us debug those
hard to find unlocked Transaction access issues that frequently show up. I think
this has been common enough that it's worse keeping a utility around in trunk.

Bug: 146473344
Test: Builds
Change-Id: I3617181745b452fbf9a575fd8e55760df900dd6f
2019-12-18 17:20:39 +08:00
Riddle Hsu
f7146a989d Revert "Enable IME Insets flag"
This reverts commit 86ed94a13b.

Reason for revert: break wm presubmit

Change-Id: Ie9bbfa4e1293560c0605ee68f0e87d00a2b0579d
2019-12-18 09:03:36 +00:00
Taran Singh
cd3e045b2c Merge "Enable IME Insets flag" 2019-12-18 03:19:50 +00:00
Adam He
b50bc1f669 Merge "API for autofill integration with keyboard." 2019-12-18 00:39:13 +00:00
Automerger Merge Worker
e44fee2d3a Merge "docs: Fixed typo" into qt-dev am: 3e4f4f9933 am: 6231cffbb8 am: 18c0fbfacd am: b6349b363d
Change-Id: I8b6bdefb277e58c2342075601e49f62fd1ce66f6
2019-12-18 00:07:53 +00:00
Automerger Merge Worker
b6349b363d Merge "docs: Fixed typo" into qt-dev am: 3e4f4f9933 am: 6231cffbb8 am: 18c0fbfacd
Change-Id: Ic8cde8755fe5fce355931efb735c7d90fb857817
2019-12-17 23:58:44 +00:00
Automerger Merge Worker
18c0fbfacd Merge "docs: Fixed typo" into qt-dev am: 3e4f4f9933 am: 6231cffbb8
Change-Id: I1653273a1d9c0eae7b8a8406bc188e2e909ffaa0
2019-12-17 23:43:26 +00:00
Automerger Merge Worker
6231cffbb8 Merge "docs: Fixed typo" into qt-dev am: 3e4f4f9933
Change-Id: Ic625ffed3ce23a7766a12a153d9794a4abf7a6b5
2019-12-17 23:31:47 +00:00
Andrew Solovay
3e4f4f9933 Merge "docs: Fixed typo" into qt-dev 2019-12-17 23:20:29 +00:00
Tarandeep Singh
699aa679a3 Add alpha support to Insets API
All insets side may want to animate with transparency with or without
insets. This change allows any side to do that.
Also, this CL adds fade to IME when its not controlled by app.
This tries to replicate original IME animation.

Bug: 111084606
Test: Manually using test app.

Change-Id: I1ecd4715336a58cd904b2898bb36462e5ce2b6ab
2019-12-17 11:59:25 -08:00
TreeHugger Robot
af109096eb Merge "Support @left marker" 2019-12-17 18:21:35 +00:00
Taran Singh
43c913bf13 Merge "API update for insets" 2019-12-17 18:04:43 +00:00
Derek Sollenberger
c4ef2c702a Move FrameMetricsObserver logic into UI Module.
Introduce HardwareRendererObserver to isolate the android.graphics
package from the android.view package.  The native code that
interacts with the observer was also moved from libandroid_runtime to
libandroid_graphics to keep it within the confines of the UI Rendering
module.

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Ibccecbeda0c4d9501d86514a53eb98548233ba6a
2019-12-17 10:15:27 -05:00
Ahan Wu
287d8283f4 Enable WCG support for ImageWallpaper
Check if the system wallpaper is wcg and request a wcg surface if yes.
Also take multiple display case into account.

Bug: 136338733
Bug: 74008618
Test: Manually
Change-Id: I830dca97be61401453dffb892a7beb8afc0a32f4
2019-12-17 16:28:14 +08:00
Ana Krulec
a74a864378 Switch from allowed display configs to refresh rate range
This completes the recent work to switch from a list of allowed display
configs to a default config + min/max frame rate.

Bug: 142507213

Test: Ran on a device with refresh rate switching, confirmed expected
      60/90 switching behavior when touching the screen.
Test: Launched Google Maps on a device with 60/90 switching, confirmed
      the device stays at 60fps.
Test: Checked dumpsys output, confirmed new display config specs
      formatting looks good.
Test: Ran on a device with refresh rate switching disallowed via the
      ro.surface_flinger.refresh_rate_switching sysprop, and confirmed
      we don't do refresh rate switching.
Test: Ran on a device that doesn't support refresh rate switching, and
      confirmed normal behavior.
Test: Tested surface flinger's display config back door, confirmed it
      still works.
Test: Inspected log output, made sure there's nothing weird.
Test: Ran unit tests for DisplayModeDirector, LocalDisplayAdapter, and
      RefreshRateConfigs.
Test: atest FrameworksServicesTests
Test: atest FrameworksMockingServicesTests
Test: adb shell /data/nativetest64/libgui_test/libgui_test
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest

Change-Id: If1417dbb5723df3386db15b2d968cfd164c2615b
2019-12-16 16:12:18 -08:00
Andrew Solovay
b0c09e4ba6 docs: Fixed typo
Fixed a clear copy/paste error, docs had said "call getHeight() to
get the width" when it should have been "...to get the height".

Skipping staging since it's a simple text change.

Change-Id: Ic06557ac38517f409943585054835d774240ccf3
Test: make ds-docs
Exempt-from-owner-approval: Docs-only change
Bug: 144537947
2019-12-16 14:54:09 -08:00
Taran Singh
d1ee549ad9 Merge "Window with FLAG_NOT_FOCUSABLE cant be IME target." 2019-12-16 22:30:27 +00:00
Tarandeep Singh
54554e238a API update for insets
- Rename WindowInsetsAnimationListener to
WindowInsetsAnimationCallback
- Make onAnimation WindowInsetsAnimationCallback.onStarted
hierarchical by giving the client a chance to consume
AnimationBounds, which then will be dispatched to its children.
- Clarify that WindowInsetsAnimationController insets are always
relative to the window.
- Introduce progress variable for inset animations. Since
DecorView will be consuming insets, apps still need a way to
calculate the full progress. Instead of also dispatching the root
insets, we offer a animation progress instead.

Bug: 111084606
Test: CTS will be added in the future
Change-Id: I7df27581d01c1db0118eef469ec089249012ba5f
2019-12-16 22:18:11 +00:00
Adam He
bc67f2e158 API for autofill integration with keyboard.
Bug: 137800469
Test: manual verification
Change-Id: Id222500c373898d576661cacb7a1cb51061041d4
2019-12-16 12:43:01 -08:00
Tiger Huang
4a7835ffb6 Window Manager Flag Migration (7/n)
Introduce new APIs in Window/WindowManager.LayoutParams for developers
to decide which types of insets at which side a window should avoid:

    setFitWindowInsetsTypes(@InsetsType int types)
    setFitWindowInsetsSides(@InsetsSide int sides)
    setFitIgnoreVisibility(boolean ignore)

The existing logic in DisplayPolicy.layoutWindowLw uses combinations of
window types, window flags, and system UI flags to decide what frames a
window should have, which is very complex, difficult to maintain, and
should be replaced with the new APIs.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyLayoutTests
            DisplayPolicyInsetsTests DisplayPolicyTests
            TaskSnapshotSurfaceTest
Change-Id: I06ddc9d0d2887ba4ded7bb8adbf9c9c0da4bf7b4
2019-12-16 17:08:21 +08:00
Robin Lee
75ba497beb Merge "Revert submission" 2019-12-14 03:06:25 +00:00
Tarandeep Singh
bcba88c325 Window with FLAG_NOT_FOCUSABLE cant be IME target.
Any window that sets FLAG_NOT_FOCUSABLE should not be considered IME target.
IME subsystem starts input on a window when it receives focus, if window never
intended to receive focus, it should not considered an IME target either.
Also, fix the broken javadoc for ALT_FOCUSABLE_IM.
Certain apps try to manually synchronize app window to IME insets by
using ADJUST_NOTHING in main window and introducing a transparent window
on top with FLAG_NOT_FOCUSABLE & ALT_FOCUS_IM to listen for IME insets.
We will support this use case until new focus management takes care of
it.

Fix: 143898978
Bug: 140641950
Bug: 145812508
Bug: 141738570
Bug: 144619551
Test: atest WindowStateTests
      atest FocusHandlingTest
      atest WindowManager_LayoutParamsTest
      Also manually using steps:
      1. Launch gmail compose activity
      2. start typing in receipient field
      3. verify that suggestions popup window w/ FLAG_NOT_FOCUSABLE doesn't
         become IME target.

Change-Id: I941571c97145d77b0a59d030cf2a8c8318f3b59f
2019-12-13 23:34:22 +00:00
Hansong Zhang
b62b7b724d Revert submission
Based on Forrest run with earlier base build 6069142, the build with this submission failed apct/bluetooth/instrumentation_test

Reason for revert: Break tests
Bug: 146198238
Change-Id: I65060ca389bf3ae1f107552ca828bfc1e7baa7c1
2019-12-13 22:10:01 +00:00