Commit Graph

13584 Commits

Author SHA1 Message Date
Galia Peycheva
a4aff1e1df Merge "Add minimal post processing API to framework" 2019-12-13 10:09:00 +00:00
Evan Rosky
c3527d7edd Merge "Add support for SystemUI Window Management" 2019-12-13 05:02:20 +00:00
Evan Rosky
22b6bbd8c5 Add support for SystemUI Window Management
Enables SystemUI to create/position its own ui elements.

First of all, this adds, to WM, the concept of a ShellRoot
which represents a piece of the hierarchy that a client shell can
do whatever it needs with. For now, multiple of these roots can
be registered at various "levels" (which correspond to window
types for now). This is needed because not everything will live
in this piece of the hierarchy, so handling z-order will still
be a shared effort between the Shell and WM for a while.

On the SystemUI side, a new Dependency called SystemWindows
provides simplistic window management for these system-ui
windows via WindowlessWindowManagers per-display-per-layer.
The benefit of this is that manipulation of these windows lives
entirely in SystemUI making synchronization easier and making
it possible to move a lot of the special handling code out
of wm (eg. DOCK_DIVIDER). As a result, SystemUI becomes
more customizable and WM becomes simpler.

Early clients of this are going to be display-level IME
handling and Split-screen.

Bug: 133381284
Test: manual test after later CLs
Change-Id: I1602d9b9b69d38b9ff15806e509cc8128c837748
2019-12-12 17:34:05 -08:00
Jackal Guo
24ca88cf30 Merge "Don't clear cache when changing accessibility focus" 2019-12-13 01:27:08 +00:00
TreeHugger Robot
b43fe24ad6 Merge "Removing remnants of menu key" 2019-12-12 05:50:46 +00:00
Jackal Guo
24a1ac51bf Don't clear cache when changing accessibility focus
Instead of clearing all cache, refreshing the accessibility windows
and the nodes.

Bug: 145562808
Test: a11y CTS & unit tests
Change-Id: I3048bffeb970712e43b82843acd452c147ca5054
2019-12-12 11:42:28 +08:00
Joanne Chung
6efdab9f88 Merge "Remove ConfigParser from TextClassificationConstants." 2019-12-12 03:33:05 +00:00
Chavi Weingarten
b61168bcfe Merge "Allow Windows in Display Overlays" 2019-12-11 22:15:37 +00:00
TreeHugger Robot
fc9c8684b6 Merge "Put userId at the end of parcel" 2019-12-11 17:47:39 +00:00
chaviw
8065f44020 Allow Windows in Display Overlays
Instead of display overlays being a SurfaceControl that can only have
child surfaces, it now is a WindowContainer that can have windows.
Specifically, windows with the type TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY
will be placed in the display overlays layer

This is the first step to allow window magnification to use real windows
on the display.

Test: go/wm-smoke
Bug: 136250281

Change-Id: Idad98db7a85f68ba49557c0efb83b9a1be089609
2019-12-11 08:37:46 -08:00
Rhed Jao
d85e2b467c Merge "Accessibility shortcut improvement (5/n)" 2019-12-11 02:17:29 +00:00
TreeHugger Robot
323de93f9d Merge "Add toString() to Display.HDRCapabilities" 2019-12-10 16:34:15 +00:00
Marin Shalamanov
04c6a4696b Add toString() to Display.HDRCapabilities
HdrCapablities in adb shell dumpsys display and in log messages appear
as android.view.Display$HdrCapabilities@49f9cd26. This change adds a
toString() method so HDR Capabilities are visualized in a nice way.

Test: adb shell dumpsys display
Change-Id: I0800ac4f615ca733d0901654184d884dd2b81752
2019-12-10 15:55:34 +01:00
Tony Mak
709c0a1cc8 Put userId at the end of parcel
userId is a new field added in ag/8350816, and it is written in between
some old fields when we parcelize it.

That breaks AiAi because some of its code rely on the implementation
details of SelectionEvent.writeToParcel.

In the long run, we may want to update AiAi such that it works
without this assumption, but before that, let's fix that in platform
for now.

Bug: 145962464
Bug: 123232892

Test: atest FrameworksCoreTests:android.view.textclassifier.SelectionEventTest

hange-Id: I98137a095cddf0fb4c600e1e09eef507bb750528
2019-12-10 08:10:22 +00:00
Valerie Hau
28ed8110f7 Merge "Update to Blast surface control" 2019-12-09 15:54:11 +00:00
Joanne Chung
c44f529a92 Remove ConfigParser from TextClassificationConstants.
ConfigParser was introduced mostly for reading both legacy Settings and
DeviceConfig lazily. We are ready to migrate to DeviceConfig and no
longer read legacy Settings, and thus we don't need this class.
DeviceConfig invalidates cache whenenver any config in the same namespace
is changed, and thus we don't need a listener.

No performance issue observed after testing TextClassificationManagerPerfTest.

Bug: 143585708
Test: atest FrameworksCoreTests:android.view.textclassifier
Test: atest android.view.textclassifier.cts.TextClassifierServiceSwapTest
Test: frameworks/base/apct-tests/perftests/textclassifier/run.sh
Test: adb shell cmd device_config put textclassifier <key> <value> and
adb shell dumpsys textclassification monitor the value change.
Test: Dynamic switch TCS and make sure the service status is expected.

Change-Id: I3c07ef4b16cd1f81c6aa60a0b9b26cac1a3bb5c0
2019-12-09 19:35:32 +08:00
Rhed Jao
6dad25dee6 Accessibility shortcut improvement (5/n)
- Adds support for magnification and multiple shortcut targets assigned
  to accessibility shortcut key in AccessibilityManagerService.
- New extra field in ACTION_CHOOSE_ACCESSIBILITY_BUTTON intent to
  support accessibility shortcut key.

Bug: 136293963
Test: atest AccessibilityShortcutControllerTest
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutTest
Change-Id: If0a446dfd269e82ec0d09db92e86f859cdae50d8
2019-12-09 15:20:45 +08:00
Valerie Hau
d6c6146674 Update to Blast surface control
Bug: N/A
Test: build, boot, surfaces fling
Change-Id: I4096790ee12d0f3e86c24e40a8ff9c654ef10a52
2019-12-06 14:20:55 -08:00
TreeHugger Robot
bd52bdf8b7 Merge "Fix signedness of DisplayAddress.Physical ports" 2019-12-06 21:51:21 +00:00
Jeffrey Huang
77db950964 Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
Galia Peycheva
ea9457585a 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: Id09160ba1513fef4dac979162bcda3bfeaace0e6
2019-12-06 15:20:02 +01:00
TreeHugger Robot
99d990ec1b Merge "Trigger autofill service when a text field's text is set by the application." 2019-12-06 13:11:42 +00:00
lpeter
e28d6b0a98 Trigger autofill service when a text field's text is set by the application.
Some apps have an payment screen with a scan card button.
When a text field's text is set in this scenario, the autofill
service is never triggered because no field gets focused.

Currently this new behavior is implemented for normal view.
Add the check logic in these two functions of AutofillManager
(notifyValueChanged/notifyViewVisibilityChanged)
to check if it should trigger autofill automatically.

Bug: 142821537
Test: atest CtsAutoFillServiceTestCases
Change-Id: Ibde94791f49772dc19cb8566a9c3a48dfbf16a58
2019-12-06 13:43:29 +08:00
Andrew Chant
0cb0315c9d Merge "Revert "Window with FLAG_NOT_FOCUSABLE cant be IME target."" 2019-12-06 02:22:45 +00:00
TreeHugger Robot
9bd71189b7 Merge "Check if the surface control is released before setting metadata on it" 2019-12-05 23:33:04 +00:00
TreeHugger Robot
ca07451b9e Merge "Prevent Insets side visibility change during animation" 2019-12-05 23:07:57 +00:00
Andrew Chant
17c896e69b Revert "Window with FLAG_NOT_FOCUSABLE cant be IME target."
This reverts commit 0ffa15ab5f.

Reason for revert: Checking treehugger to see if this fixes instagram
input handling.

Bug: 144619551
Change-Id: I606c651f7ec1ea8c26ecc92fc5e94994a480950b
2019-12-05 22:39:02 +00:00
TreeHugger Robot
57bb01c720 Merge "Set accessibility ID to window surface" 2019-12-05 22:22:58 +00:00
Jeffrey Huang
cb78285b81 Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -08:00
TreeHugger Robot
63330e6859 Merge "Fix SurfaceControl#captureLayers docs" 2019-12-04 16:25:50 +00:00
Daichi Hirono
1d56ce3731 Set accessibility ID to window surface
The change allowes HAL to access accessibility ID.

Bug: 143734779
Test: TBD
Change-Id: Ib4ad2b2c62264bb8ea73dd3e663b9ff797c62a7a
2019-12-04 16:27:26 +09:00
Ryan Lin
3c71e504dc Merge "Added ACTION_PRESS_AND_HOLD" 2019-12-04 06:12:56 +00:00
ryanlwlin
7b122e8f1c Added ACTION_PRESS_AND_HOLD
This action is used to do support distinct behaviour depends on how long
it's pressed and hold. The view declares this action should not expose
ACTION_LONG_CLICK.

Bug: 139506603
Test: The API Builds, there is no executable code here.
Change-Id: Ic3cf37677dd8bee2faf22f2f57feef4c9bb7cc22
2019-12-04 10:30:58 +08:00
Steven Thomas
82eed535ab Merge changes I4851c742,If399edd6
* changes:
  2) DM Generalization of Refresh Rates: Rename listener
  1a) DM: create Class to pass around Specs
2019-12-03 22:37:03 +00:00
TreeHugger Robot
b11f93129c Merge "Persist PiP size to be restored on re-entry" 2019-12-03 21:44:59 +00:00
TreeHugger Robot
2d4862d4c9 Merge "Expose setFixedToUserRotation via IWindowManager." 2019-12-03 20:28:03 +00:00
Vishnu Nair
a8bff9707d Fix SurfaceControl#captureLayers docs
Fixes: 144514274
Test: docs
Change-Id: I31c80db594982174910974a6f385dae5f0e224ce
2019-12-03 18:23:14 +00:00
Garfield Tan
a3f19030ed Expose setFixedToUserRotation via IWindowManager.
With the parent CL that allows the topmost fullscreen activity to set
the display rotation when freeform windows are visible, OEMs may need
this method to easily regulate the display rotation behavior on external
displays, or primary displays when a keyboard is attached. Therefore
let's expose it to for SysUI to use it.

Also change its name for consistency, especially to differentiate this
and mIgnoreRotateForApps in DisplayContent.

Bug: 144185986
Test: Command line can still set it.
Change-Id: Id1233869c30b66bde3550267dbb21a84076c223d
2019-12-03 10:09:52 -08:00
Vishnu Nair
5f4c4ddf14 Check if the surface control is released before setting metadata on it
Bug: 145096599
Test: Checked setting metadata on a released surfacecontrol throws an exception
Change-Id: I85ed44acffff4d265dd37898ec67e6071c2d938d
2019-12-03 07:42:37 -08:00
Steven Thomas
4d1c3e7136 Merge "1) DM Generalization of Refresh Rates: adding calls to DM and Surface Control" 2019-12-03 00:18:42 +00:00
Jackal Guo
566121289c Publicize constructors of accessibility related infomational classes
This is the first step of eliminating SynchronizedPool for a11y ojbects.
The patch doesn't stop recycling, but allows service developers to
choose whether or not to.

Since recycling a11y node info is stopped in the cache, but the nodes
are still holding pooled collection/item/range info objects. Here it
goes away with public constructors except those refreshed one.

Bug: 117999988
Test: m update-api; m checkapi; m ds-docs
Test: atest --test-mapping $ANDROID_BUILD_TOP/frameworks/base/core/java/android/view/accessibility:postsubmit

Change-Id: I12304662f216b5e443785939f231893abdfa07d5
2019-11-27 13:50:56 +00:00
TreeHugger Robot
81a102b378 Merge "Add some lifecycle functionality to WindowlessWM" 2019-11-27 01:29:38 +00:00
Ana Krulec
52f1289031 1a) DM: create Class to pass around Specs
Test: observer logs.
Bug: 142507213
Change-Id: If399edd6d795e88800f6f82822e94ede13b56ac0
2019-11-26 13:14:26 -08:00
Tarandeep Singh
93ea15a536 Prevent Insets side visibility change during animation
If app requests to show IME as soon as app resumes, the animation is
prepared and IME window is set visibile/invisible at start of the
animation. Also, control is set to the window when it receives focus.
This results in control showing the IME before even animation starts
creating a flicker.
Solution is to not applyVisibility when control is set if IME (or
another side) is already animating.

Fix: 144503524
Test: Manually using steps in bug.
      atest InsetsControllerTest InsetsSourceConsumerTest

Change-Id: I5271d906772510cd819f75dc8eed141f4248b34f
2019-11-26 11:09:14 -08:00
Garfield Tan
f2ef2a7fca Fix doc of TOOL_TYPE_MOUSE.
It says it's set when the tool type is a mouse or trackpad, but the fact
is the tool type is TOOL_TYPE_FINGER on trackpads. Therefore remove
trackpad from Android doc.

Bug: 145135609
Test: N/A
Change-Id: Ife91ba032f9f0a8e7359425b415409ac609cdb25
2019-11-26 09:52:53 -08:00
Dieter Hsu
2574b4a1dd Update test mappings for CtsAccessibilityServiceSdk29TestCases
Bug: 145096015
Test: make checkbuild
Change-Id: I45462071dfce5dca3df97c50a784c38e02b83ad6
2019-11-26 03:09:17 +00:00
Evan Rosky
3f09bb3f11 Add some lifecycle functionality to WindowlessWM
This adds other parts of the window lifecycle (eg. ViewRoot
death, window removal, layout update). Some of the lifecycle
controls are just utilities, but are needed so that they
can be performed out-of-package.

It also shows/hides the surface based on underlying view
visibility. In actual WM, the surface is actually created/
destroyed based on visibility, but this breaks continuity
in WWM because the WWM user should have full control over
it.

Also made this public so it can be subclassed.

Bug: 133381284
Test: manual test in later CLs
Change-Id: Ibd7792c3f52c216089d9b498e3770e100ff24642
2019-11-25 17:19:22 -08:00
Dominik Laskowski
67cc7f819e Fix signedness of DisplayAddress.Physical ports
Interpret port as unsigned byte for consistency with uint8_t in SF/IF,
and clarify signedness in doc comments.

Bug: 143713778
Test: adb shell dumpsys display | grep physicalPort
Test: LocalDisplayAdapterTest
Test: DisplayWindowSettingsTests
Change-Id: I56ce0067367372a3a747fde783a1956975e833a0
2019-11-25 14:46:29 -08:00
Ana Krulec
4f753aacdf 1) DM Generalization of Refresh Rates: adding calls to DM and Surface Control
Bug: 142507213

Test: 1. Manually verified refresh rate switching behavior on a phone
with refresh rate switching.

2. Wrote a new test file, DisplayModeDirectorTest.java, to verify the
behavior of the display mode voting algorithm.

Change-Id: Iceac6fd74e6528ddb2302f4d7eb926753e4ffd19
2019-11-25 14:00:53 -08:00
TreeHugger Robot
6636ea6da3 Merge "Allow adding EmbeddedWindows without host windows" 2019-11-25 21:44:46 +00:00