Commit Graph

13757 Commits

Author SHA1 Message Date
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
Jorim Jaggi
2b16b5993d Merge "Fix up new insets dispatch behavior" 2020-01-21 18:28:58 +00: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
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
Jorim Jaggi
7f7618748d Migrate LAYOUT_STABLE in new insets world
WindowInsets.getSystemInsets returns the stable insets if the
window has set SYSTEM_UI_FLAG_STABLE set.

Furthermore, consuming stable will also consume system insets, and
consuming system insets will consume stable. However, DecorView
will not longer consume stable.

Bug: 118118435
Test: InsetsStateTest, WindowInsetsTest
Change-Id: I232e90a6ec34036e830a53437cf32a2b794c5257
2020-01-17 22:42:02 +00:00
Galia Peycheva
35f900a4d0 Add a TestApi to DM to get the last requested MPP
This CL exposes DisplayManager.getRequestedMinimalPostProcessing
for testing purposes. The call is propagated to
LogicalDisplay.getRequestedMinimalPostProcessingLocked().

Bug: 139369866

Test: m, flash, atest
CtsWindowManagerDeviceTestCases:MinimalPostProcessingTests

Change-Id: I7736d6e7a5c97d663111d10efa66d6d38a7e70bd
2020-01-17 20:23:01 +01:00
Valerie Hau
3036055686 Preserve intended width/height for Blast adapter layers
Some surfaces may be a different size from the requested width/height.
Pass back calculated width/height from WindowStateAnimator back to
ViewRootImpl

Bug: 147674215, 147689472
Test: build, boot, manual
Change-Id: Ib557a4769d79e6414b9bebab8cb006adfb551e4d
2020-01-17 07:49:32 -08:00
wilsonshih
e832194dd0 Split status bar window (1/N)
This is the first step to create another new window for status bar.

Small window => TYPE_STATUS_BAR: The bar on top of screen.
Large window => TYPE_NOTIFICATION_SHADE: Anything else.

Bug: 136993073
Test: build then flash
Test: atest WmTests SystemUITests
Test: atest RegisterStatusBarResultTest InsetsFlagsTest

Manual Test:
- Bouncer can show when leave showWhenLocked activity.
- StatusBar can show when comes HUN in fullscreen mode.
- StatusBar can play enter/leave animation in fullscreen mode.
- Able to drag notification panel when bubble/glow existing.
- Switch to market launcher, and run above tests.
- Drag notification panel from launcher several times and observe it
  works fine.

Change-Id: Id9f72cd0e21f01b50d57f02ea60f97c6460926b7
2020-01-17 15:33:56 +00:00
Joanne Chung
b0dbf96728 Merge "TextLinks API updates." 2020-01-17 09:06:52 +00:00
shawnlin
d0e23be2e7 Add a new flag ALWAYS for layoutInDisplayCutoutMode
In R, we will allow cutouts on long edges of a display.
We need to add a new flag for this.

Test: atest PhoneWindowTest
Bug: 146875740
Change-Id: Iebb5f14c0a693f8229fef67d80f2afc3029c3deb
2020-01-17 16:29:46 +08: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