Commit Graph

13701 Commits

Author SHA1 Message Date
Rob Carr
57b072545f Merge "Introduce TaskOrganizer" 2020-01-10 20:27:27 +00:00
Jorim Jaggi
4e04eb24ae Move visible insets calculation to client
As otherwise they may be out of sync, leading to shifting when the
IME disappears.

Bug: 111084606
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest
Change-Id: Ifd7dfa6694efccf8693fd46bec1a9dea879790ff
2020-01-10 15:36:51 +00:00
TreeHugger Robot
f093b48b58 Merge "Correct layout/draw/animation interleaving for insets callbacks" 2020-01-10 13:35:28 +00:00
Jorim Jaggi
a51168aaee Correct layout/draw/animation interleaving for insets callbacks
See WindowInsetsAnimationCallback.onPrepare for detailed
description of new behavior.

Also rename InsetsSourceConsumer.setVisible to setRequestedVisible
to communicate that this is client intent vs. current state.

Test: windowinsetstest application
Bug: 111084606
Change-Id: Id35c60e0f59a8aa4f0d300220391d1e2b96a91fd
2020-01-10 11:24:31 +01:00
TreeHugger Robot
8c32659ae1 Merge "Use ExecutorService to replace CompletableFuture" 2020-01-10 09:32:48 +00:00
Robert Carr
8a2f913ac4 Introduce TaskOrganizer
A first take at the TaskOrganizer API for allowing SysUI to control task presentation.
In this CL we introduce the first two primitives:
        1. The interface itself for implementation by SysUI
        2. Support for organizing a given windowing mode (but atm really only PIP)
We include a sample app that manages the PIP from an APPLICATION_OVERLAY window.

Bug: 139371701
Test: wmtests/TaskOrganizerTests. TaskOrganizerPipTest
Change-Id: I44a8ed311bc5f06285bba2c6ff3b37a7d19a9190
2020-01-09 13:04:18 -08:00
Hongming Jin
d261711e49 Merge "System action registration API for SystemUI" 2020-01-09 21:00:39 +00:00
lumark
ba400449e1 Use ExecutorService to replace CompletableFuture
CL[1] introduced starting input with CompletableFuture for improving IME
performance.

Since CompletableFuture is not recommanded way to use in system server side for
memory usage concern, we use java ExecutorService and Future to remove
this dependency.

[1]: I6aa4a664cfd0c86f75cee2457715317194bbe5e2
      e0172102b9

Fix: 147331480
Test: atest CtsInputMethodTestCases

Change-Id: I10391b834c33458c3e0ac846ab738e805d235c26
2020-01-09 17:34:13 +08:00
Tiger Huang
969c60859a Window Manager Flag Migration (9/n)
Update the leash of InsetsSourceControl and send it to the client while
the insets source window is moved.

This CL also guarantees that the array of InsetsSourceControl send to
the client side doesn't contain any null element.

Bug: 118118435
Test: atest InsetsSourceProviderTest InsetsStateControllerTest
            InsetsPolicyTest WindowStateTests CommandQueueTest
            RegisterStatusBarResultTest InsetsFlagsTest
            LightBarControllerTest RegisterStatusBarResultTest
            ViewRootImplTest DisplayPolicyLayoutTests
            DisplayPolicyInsetsTests DisplayPolicyTests
            TaskSnapshotSurfaceTest NavigationBarColorTest
Test: Rotate Camera in the new insets mode

Change-Id: I96d7ac5c37abbb472dab4cd2c24644e136d23947
2020-01-09 17:01:42 +08:00
Evan Rosky
769c9a5ee7 Merge "IME to systemui" 2020-01-08 22:28:40 +00:00
Valerie Hau
4c2adf3477 Merge "Switch BLAST flag to WindowManagerGlobal" 2020-01-08 21:24:50 +00:00
Hongming Jin
bc76112e0b System action registration API for SystemUI
Bug: 136286274
Test: atest AccessibilityManagerTest
      atest AccessibilityManagerServiceTest
Change-Id: I6bbdf3627bfc9b39551cc7809dda1cf43d1d6ea4
2020-01-08 11:22:48 -08:00
Evan Rosky
8d782e0c01 IME to systemui
Re-route ime-control to SystemUI when it isn't driven by an app.

This allows multi-window system-ui components to synchronize
with the ime (eg. adjusting for split-screen).

Ime control goes through a new interface IDisplayWindowInsetsController.
This gets set on WM and there is only 1 per display. All of this
is currently handled in DisplayImeController which will also
drive the animation of the IME and dispatch to ImePositionProcessors.

On the server-side, InputMethodControlTarget is separated from
InputMethodTarget so that IME can be controlled by a different
client than the IME target.

Bug: 133381284
Test: Existing IME tests pass
Change-Id: I8e8ed2e09c45998c228df72e52a671fa327308f2
2020-01-08 10:34:40 -08:00
Jorim Jaggi
761a5ab018 Treat IME adjust flags correctly
- IME insets always get reported through WindowInsets.getInsets(ime())
- However, getSystemWindowInsets will not report it if ADJUST_RESIZE
isn't set.
- Fix bitmask check for ADJUST_RESIZE

Test: InsetsStateTest
Test: WindowInsetsTest
Fixes: 146465040
Bug: 111084606
Change-Id: Ib19c89050af4f669ddda14d2bf2415aa3b5092c1
2020-01-08 17:40:54 +00:00
Valerie Hau
089e5da3f3 Switch BLAST flag to WindowManagerGlobal
Setup for P/H experiment by switching to WindowManagerGlobal.
Follow up patch will set the flag based on DeviceConfig

Bug: 147096935
Test: build, boot, manual
Change-Id: If062fc16a90e0f3069064b969e1a63a6142421df
2020-01-07 13:55:33 -08:00
Artur Satayev
df4395991f 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: I288969b0c22fa3a63bc2e71bb5009fe4a927e154
2020-01-07 13:29:50 +00:00
Michal Olech
3c429ff1c8 Merge "Revert "Introduce config_customBugreport option"" 2020-01-07 12:09:20 +00:00
Michal Olech
8c5bc3b60d Revert "Introduce config_customBugreport option"
This reverts commit 88376e68c1.

Reason for revert: Will instead reuse BugReportHandlerUtil

Change-Id: I19644bbc32a758bdbc13a0a959879c6d5a5f0c71
2020-01-07 09:42:39 +00:00
TreeHugger Robot
a6447f2832 Merge "Fix issue with letterboxing" 2020-01-07 00:29:30 +00:00
Jorim Jaggi
0dd0cf911b Fix issue with letterboxing
- Only consider client state if new API is actually turned on.
- We only sent the state the client was actually controlling.
However, we then later check for visibility for state that may not
even exist. Thus, we keep the state but only update the sources
the client is actually controlling.
- Initialize source with default visibility. This prevents
issues where the source may not exist but we still check it.

This fixes issues where a letterbox was accidentally placed on
screen because WM was thinking client requested fullscreen flag
(hiding the status bar), and other places where we checked
requested visibility.

Also renamed client state to requested state.

Test: Open any app, open IME
Bug: 111084606
Change-Id: Ibead561fc5593d8944400320f5e31dbe262612fe
2020-01-06 23:50:39 +01:00
TreeHugger Robot
3c5d179ab3 Merge "Replace framework usage of SkMatrix with a stable C API" 2020-01-06 18:18:11 +00:00
Derek Sollenberger
4dc0aae61f Replace framework usage of SkMatrix with a stable C API
Isolate the usage of SkMatrix within the graphics module and
replace external usages with a stable C API.

Bug: 137655431
Test: CTS presubmit
Change-Id: I058051a6afb4ae6d48ecdcf5cf8bd21aa0995e90
2020-01-06 11:57:39 -05:00
TreeHugger Robot
6fa86b7933 Merge "Introduce config_customBugreport option" 2020-01-06 16:43:17 +00:00
Michal Olech
88376e68c1 Introduce config_customBugreport option
This adds support for a custom bugreport handler. When the option is
enabled instead of immediately triggering the full bugreport, only a
CUSTOM_BUGREPORT_REQUESTED broadcast is sent.

Bug: 146052311
Test: built and tested locally
Change-Id: Ifea9906c15e0bc1281192a90b4dbdb0ad1ecfbdd
2020-01-06 16:19:59 +01:00
TreeHugger Robot
d10dc73df9 Merge "Add target SDK restriction to SmartSelectionEventTracker." 2020-01-06 11:04:04 +00:00
Joanne Chung
d9a916fe4d Finish autofill integration with keyboard cleanup tasks
1. Only print log when debug is on.
2. Callback be notified when input does not start.
3. Avoid using hard code tag in Log class.
4. onCreateInlineSuggestionsRequest() do nothing in NOP.
5. Add missing javadoc.

Bug: 146525448
Test: manual verification
Change-Id: I41e1de92ffcdb8020aef99acbfec274e0294bad3
2020-01-06 16:43:45 +08:00
Joanne Chung
0041b17113 Merge "Ensure OVERTYPE event has an entity type." 2020-01-04 05:46:11 +00:00
Adam He
7bc8f60377 Added attributes for IME and AutofillService to indicate they support
inline suggestions.

Fixes: 146452946
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodInfoTest
Change-Id: I709b16d3f12c693bc670600bdcb9125630eb9b8e
2020-01-03 14:14:17 -08:00
Nikita Dubrovsky
8de5385616 Merge "Fix typo in javadoc in AutofillValue" 2020-01-02 18:30:26 +00:00
Chavi Weingarten
856ce4a17d Merge "Remove layer from window handle since it's no longer used" 2020-01-02 17:18:00 +00:00
Joanne Chung
a4099aaa01 Ensure OVERTYPE event has an entity type.
Bug: 145282510
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Ia064318198effbdfde00566c6746ab922573c32d
2020-01-02 22:20:25 +08:00
Rob Carr
4e535b4c41 Merge "Rename WindowlessViewRoot to SurfaceControlViewHost and rework API" 2020-01-02 05:18:58 +00:00
Rob Carr
9bc62f7678 Merge "Port SurfaceView deferTransaction usage to BLAST" 2020-01-02 03:14:49 +00:00
Robert Carr
85bb940f72 Port SurfaceView deferTransaction usage to BLAST
When the SurfaceView is invalidated (e.g. geometry has changed) we ask
the ViewRootImpl to render the next buffer in to a BLAST transaction which
the SurfaceView will also use from it's RT callbacks in place of deferTransactionUntil

Test: Flip USE_BLAST_BUFFERQUEUE flag. Run SurfaceViewSyncTests.
Bug: 146598493
Change-Id: I43d301f25101afae32ad1c43a3a3210c5aeadd0f
2019-12-30 21:34:06 -08:00
Robert Carr
59b1888bb9 Rename WindowlessViewRoot to SurfaceControlViewHost and rework API
Should be a little more clear. The internal IWindowSession implementation
keeps the WindowlessWindowManager name, but the API section definitely
needs a more usable name. Instead of passing in a root Surface we want it
to be owned by the SurfaceControlViewHost itself. This way we can ensure
we only return a SurfacePackage. In follow up CLs we will add an
accessibility ID to the SurfacePackage so we can ensure the Control
is passed around with the accessibility ID.

Test: Builds
Bug: 134365580
Change-Id: I30520e8b169d3744a66ccedf61cc4515cfef4dee
2019-12-30 20:59:39 -08:00
Nikita Dubrovsky
85a8d446c8 Fix typo in javadoc in AutofillValue
Test: presubmits
Change-Id: I8c7d3c9cca57a8e272b63f72fea68978a5073cac
2019-12-30 15:38:46 -08:00
chaviw
7a67d07d90 Remove layer from window handle since it's no longer used
Fixes: 146671630
Test: go/wm-smoke
Change-Id: Ieae773147b1eb7d43fc2688d8570f98075dda8ea
2019-12-30 14:07:20 -08:00
Chavi Weingarten
9ec9264138 Merge "Removed regionId from updateTapExcludeRegion request." 2019-12-27 16:24:50 +00:00
TreeHugger Robot
a9ae085264 Merge "Decoupling InsetsAnimationControlImpl and the client" 2019-12-27 05:38:51 +00:00
Yunfan Chen
02abf55ab0 Decoupling InsetsAnimationControlImpl and the client
Currently InsetsAnimationControlImpl is heavily rely on
InsetsSourceConsumer and InsetsController on the client side, which
caused difficulties to the server to re-use the code. Decoupling it to
make it re-usable.

This patch made the following changes:
1. Introduce a callback interface to let InsetsAnimationControlImpl talk
   to InsetsController.
2. Use InsetsSourceControl instead of InsetsSourceConsumer in the
   InsetsAnimationControlImpl.
3. Remove all the consumers in the InsetsAnimationControlImpl.

Test: atest InsetsAnimationControlImplTest
Test: manual test with the new insets API, it works as expected.
Test: go/wm-smoke
Test: atest FrameworksCoreTests:InsetsControllerTest

Change-Id: I30f5aa73ff31e07c0dd8d61edbb208f16c5a6775
2019-12-27 12:04:54 +08:00
chaviw
aa0d74e6c6 Removed regionId from updateTapExcludeRegion request.
There was no need for regionId in the request since you can just replace
the previous region with a new one. This reduces confusion and
simplifies the code. This also allowed TapExcludeRegionHolder to get
deleted and just store the excluded region in the WindowState.

Additionally, this fixed a bug where the excluded region would get
overwritten when the window region was smaller. If the window region was
resized later, the exclude region would remain small.

This is also preparing for more uses of this API with embedded windows
and window magnification.

Test: ActivityViewTest
Change-Id: Ia151115b5a5e8f2ce5e606fe627821dcfef5d9b5
2019-12-26 15:47:37 -08:00
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