Commit Graph

13736 Commits

Author SHA1 Message Date
Joanne Chung
b0dbf96728 Merge "TextLinks API updates." 2020-01-17 09:06:52 +00:00
Ryan Lin
be69a3b62f Merge "Added an interface between Sysui and system_server" 2020-01-17 07:40:04 +00:00
Andrii Kulian
2b3b20c388 Merge changes from topic "app_config_compat"
* changes:
  Update resource config for default display
  Override process config to match activity config
  Set parent for WindowProcessController
2020-01-17 04:56:41 +00:00
Steven Thomas
777401766b Merge "Make setActiveConfig() private, remove plumbing" 2020-01-17 04:50:19 +00:00
Joanne Chung
eae7bb76a9 TextLinks API updates.
1. Change TextLinks.getText() return type from String to CharSequence
2. Javadoc improvement

Bug: 147761091
Test: atest FrameworksCoreTests:android.view.textclassifier
Test: atest android.view.textclassifier.cts.TextClassifierValueObjectsTest
Change-Id: I40e4f401025f96717272a9ea2aac4c168297191e
2020-01-17 10:44:51 +08:00
Yabin Huang
ef8a8ac927 Don't use View ID to search next focus backward View
There might be several Views with the same ID in View hierarchy,
and if we search the user specified next focused view by comparing
the View ID, it may return the wrong View with the same ID. To fix
that, we should compare the View itself.

Fixes: 147829061
Test: manual

Change-Id: I3eeb68ed3ea30ce9461165eea56227cb81b21929
2020-01-16 14:29:16 -08:00
Ana Krulec
25f0212763 Merge "WindowManager: Send layer priority hint to SurfaceFlinger" 2020-01-16 21:18:53 +00:00
TreeHugger Robot
16f519a176 Merge "Introduce ImeFocusController" 2020-01-16 15:30:09 +00:00
Joanne Chung
adb9ce4ffe Merge "Made the InlineSuggestion APIs testable." 2020-01-16 12:37:32 +00:00
TreeHugger Robot
f70990753d Merge "Starts a new request on switching back to the existing app" 2020-01-16 11:18:12 +00:00
Jorim Jaggi
73c2063811 Merge "Handle cases when multiple type are animating" 2020-01-16 09:41:24 +00:00
Ana Krulec
fea971787a WindowManager: Send layer priority hint to SurfaceFlinger
Basic algorithm:
if (!isFocused && preferredModeId > 0) -> priority is 2
if (isFocused && preferredModeId == 0) -> priority is 1
if (isFocused && preferredModeId > 0) -> priority is 0
else priority is INT_MAX

See go/sf-generalizing-refresh-rate for master doc, and
https://docs.google.com/document/d/1ozR7UT3AZclsJ6f4NJ4WXYO2eb-GRdv-Q55AYTltZSo
for WM specific document.

Test: Device starts. Observe logs for errors.
Test: Observe printouts on SF side to make sure the correct number gets passed along.
Test: Unit tests for setting priority on Transaction.
Test: Swappy and Messaging app running in split screen. If swappy in focus,
      it gets priority 0, otherwise 2. If Messsging app in focus it gets priority 1,
      otherwise INT_MAX.
Test: Chrome playing video. Chrome Activity gets priority 0.
Test: Expand status bar. Status bar has priority 1.
Test: Application running. Status bar gets an update. Nothing is passed along.

Bug: 142507166
Change-Id: Iea75f63882b173fad089cd4a32a4831b92206797
2020-01-15 12:43:14 -08:00
Andrii Kulian
946e8df660 Update resource config for default display
When a launched application doesn't occupy the entire screen space,
there is a mismatch between the configuration of the process and the
configuration of activities. This leads to compatibility issues with
apps that don't expect this, read display metrics from Application
resources and try to apply them in activities.

The platform may apply a compatibility mode, in which the process
configuration will match the config of the top running activity. This
means that the process configuration may change and runtime and
result in display adjustments that are different from the default
values. This CL propagates resource configuration updates even for
default display to make sure that the config changes are reflected
for non-activity contexts.

Test: CtsWindowManagerDeviceTestCases:AppConfigurationTests
Change-Id: I91cadc83a82a3be8c8dee810bbd1aa97cbe4e97f
2020-01-15 12:22:46 -08:00
Evan Rosky
718bc41353 Merge "Add focusability into the hierarchy and Container transaction" 2020-01-15 19:42:47 +00:00
lumark
970d9d2e0c Introduce ImeFocusController
Introduced ImeFocusController to manage
IME focus target and retrieve IME target event from ViewRootImpl.

With this CL, removed InputMethodManager focus check related methods
and replaced with below methods in ImeFocusController:
  - onPreWindowFocus
  - onPostWindowFocus
  - onViewFocusChanged
  - onViewDetachedFromWindow
  - onWindowDismissed
  - onProcessImeInputStage

Since all methods are guaranteed to interact within View or
ViewRootImpl with UiThread, so it also benefits that we can without any
lock protection, and ViewRootImpl will no longer depend on
InputMethodManager methods call in the end.

Also, Add mHasImeFocus in View.AttachInfo, for propogating if this view's
window is IME focused, if so, View#notifyFocusChangeToInputMethodManager
-> ImeFocusController#onViewFocusChanged will be called to
notify the focus change to corresponding IME focus controller.

Bug: 141738570
Test: atest SearchViewTest, FocusHandlingTest
Test: atest ActivityViewTest, MultiDisplayClientTests,
      MultiDisplaySystemDecorationTests

Change-Id: Ib455704fe1e9d243f93190a84f230210dbceac2a
2020-01-16 02:57:08 +08:00
TYM Tsai
8839835d27 Starts a new request on switching back to the existing app
The response may be old and incorrect when leave the app then go back. To
avoid using the wrong response, going back to the app will trigger a new
request.

Bug: 146903532
Test: atest CtsAutoFillServiceTestCases
Change-Id: Ibab426183d39e3c51fb0f89ec6ba6ea48012b6a8
2020-01-15 21:12:19 +08:00
ryanlwlin
2cc1d117a8 Added an interface between Sysui and system_server
This interface is used to interact between system UI and system
server for winodow magnification. When magnification mode is window
mode, system UI will set the connection to AccessibilityManagerService
to manipulate window magnification.

Bug: 146400227
Test: WindowMagnificationConnectionWrapperTest
Test: AccessibilityManagerTest
Test: WindowMagnificationManagerTest
Change-Id: I64b22eac3a7be2e1dbced0573988fe75ace921f6
2020-01-15 17:24:43 +08:00
Jacky Kao
873cbc0e14 Merge "Implementing new API : takeScreenshot()" 2020-01-15 08:29:49 +00:00
Jacky Kao
09789e4168 Implementing new API : takeScreenshot()
Implementing the new API for A11y services to take the screenshot
of the specified display.
Bitmap takeScreenshot(int displayId)
1. The main codes is moved from the UiAutomationConnection class and
let the UiAutomation change to use this API.
2. Add a capability at metadata to check whether the A11y services could use this
API or not.
3. This API is a async one for A11y services, but is a sync one for
UiAutomation.

Bug: 10931661
Test: a11y CTS & unit tests
Change-Id: I478bd93c60d4742bef20ae0e423ca9de1bda55d2
2020-01-15 16:23:52 +08:00
Rhed Jao
70cb293d44 Merge changes from topic "A11yShortcut_NeedWithUi"
* changes:
  Accessibility shortcut improvement (10/n)
  Accessibility shortcut improvement (9/n)
  Accessibility shortcut improvement (8/n)
2020-01-15 07:22:32 +00:00
Jackal Guo
7fd8e937bf Merge "Support accessibility on embedded hierarchies (1/n)" 2020-01-15 05:40:36 +00:00
TreeHugger Robot
e33a992c19 Merge "Move focus dispatch to input (2/2)" 2020-01-15 04:52:14 +00:00
Wu Ahan
d5b8f0590d Merge "Make some apis @TestApi and @hide for usage in tests" 2020-01-15 03:33:41 +00:00
Valerie Hau
ac8a052c01 Merge "Add USE_BLAST private flag on ViewRootImpl setView" 2020-01-14 21:40:03 +00:00
Rhed Jao
f526c9995b Accessibility shortcut improvement (10/n)
Update AccessibilityManagerService:
 - Enable multiple shortcut targets support for accessibility button.
 - Remove navibar magnification enabled setting key.

Bug: 136293963
Test: atest AccessibilityShortcutTest
Test: atest AccessibilityUserStateTest
Test: atest AccessibilityShortcutControllerTest
Change-Id: I69facd958307a22f3a0193dd769e595cef324f9f
2020-01-14 12:15:23 +08:00
Joanne Chung
2e707603bc Made the InlineSuggestion APIs testable.
Bug: 146453105
Test: atest CtsInputMethodTestCases
Change-Id: I1a8e6334ffd25d01260659c0ac3c30d10e9745e0
2020-01-14 11:49:25 +08:00
TreeHugger Robot
63b67c0efa Merge "Add the ime package name to the inline suggestions request" 2020-01-14 03:38:00 +00:00
Jackal Guo
79b182e752 Support accessibility on embedded hierarchies (1/n)
To support embedded hierarchies (leash):
1. Add new APIs for leashed child in AccessibilityNodeInfo.
2. SurfaceView needs to use this API to add such child when
   initializing the AccessibilityNodeInfo.

Bug: 137593247
Test: a11y CTS & unit tests
Change-Id: Ieaa57c6ad65f4c199175d929c3bcba7fb7e6ef26
2020-01-14 10:29:54 +08:00
Evan Rosky
226de13773 Add focusability into the hierarchy and Container transaction
Split-screen will eventually be replaced by a hierarchical
mechinasm. This means the RAC.mIsDockMinimized and primary split
checking will go away.

In its place, add focusable to windowcontainer and have it
override all children's focusability.

Also, fixes a bug where activity configuration wasn't updated
properly after a WC transaction.

Bug: 133381284
Test: added wmtest
Change-Id: I35ed1561cc32785528854a8a53e52a13144f31c1
2020-01-13 16:27:16 -08:00
Feng Cao
16b2de5a40 Add the ime package name to the inline suggestions request
Test: manual
Bug: 147229274

Change-Id: I3d81b1d56989e46f65f9b9fc6e497952486335b5
2020-01-13 15:15:24 -08:00
Valerie Hau
8c2357a312 Add USE_BLAST private flag on ViewRootImpl setView
Bug: 147018830
Test: build, boot, manual
Change-Id: I0fc84aab5ee04eb7abe4f745410910ddafc3707d
2020-01-13 15:01:03 -08:00
Jorim Jaggi
1f2c7eb7f5 Handle cases when multiple type are animating
We need to keep track of the animations, but also it's nature,
such that we can make an appropriate decision whether to cancel or
ignore in show/hide.

Test: InsetsControllerTest
Bug: 111084606
Change-Id: I9d13a22ce179c2949b889fea80d29094845260e7
2020-01-11 00:04:16 +01:00
Rob Carr
57b072545f Merge "Introduce TaskOrganizer" 2020-01-10 20:27:27 +00:00
Siarhei Vishniakou
3b8e872e9b Move focus dispatch to input (2/2)
Input now tells the app when it has focus.

Touch mode information will now also be sent to the apps through input.

When a key targeting a non-focused display is processed, run the
'moveDisplayToTop' synchronously to ensure that setInputWindows with the
correct window focus information is completed. This would ensure that
the focus event is enqueued before the key event.

Bug: 70668286
Test: atest WindowFocusTests
Change-Id: Iff0b88a05441b29834741aa3dfae31d55871ddd6
2020-01-10 11:14:20 -08: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