Commit Graph

16951 Commits

Author SHA1 Message Date
Tiger Huang
4fba1c4453 Merge "Prevent adding methods in WindowInsetsAnimationController" into sc-v2-dev 2021-09-03 10:40:38 +00:00
Shawn Lin
97b0de7326 Merge "[DO NOT MERGE]Support rounded corner for multi-display devices" into sc-v2-dev 2021-09-03 03:57:09 +00:00
Vishnu Nair
8047839069 Merge "Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy" into sc-v2-dev 2021-09-03 02:01:53 +00:00
Evan Rosky
2dd3adff43 Merge "Fix some NPEs in shell transitions" into sc-v2-dev 2021-09-02 20:43:51 +00:00
Tiger Huang
4ba9fc6168 Prevent adding methods in WindowInsetsAnimationController
It is a public interface which should not have different versions
sharing the same API level. This CL moves the methods to an
@hide interface.

Fix: 198614722
Test: atest android.signature.cts.api.current.SignatureTest
Change-Id: Ib02708aeb1ec960bda20b6b60d4df6f0c9b4d9d6
2021-09-03 04:24:34 +08:00
Tiger Huang
a42a8d6bf3 Merge "Invoke insets animation callbacks when resizing system bars" into sc-v2-dev 2021-09-02 11:12:17 +00:00
Winson Chung
851f1df2f1 Return the existing display ids when registering a display window listener
- This ensures that the caller can synchronously initialize the existing
  displays without waiting for the onDisplayAdded() callback, which can
  happen asynchronously (since the callback is oneway).

Bug: 196186963
Test: atest WMShellUnitTests
Test: atest ActivityTaskManagerServiceTests
Change-Id: I0a8d5f9b4ede7b487a8de14bdb6eaacae7d03d9f
2021-09-01 13:37:31 -07:00
Vishnu Nair
26ed47443c Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy
SurfaceView clients may hold on to surface references. In S this means
they would extend the lifetime of the SurfaceControl resulting in
"leaking" buffers until the references are cleared or the app is
terminated.

Fix this by calling a new destroy function on Surface which will
explicitly remove references to the SurfaceControl and BBQ it holds.
This is safe because SurfaceView controls the lifecycle of the Surface
and knows when the Surface will become invalid. Once invalid, the Surface
cannot become valid again.

Test: repro steps in bug
Bug: 198133921
Change-Id: I5c7e43736f025fc0965eae2f19719ba40df3cb70
2021-08-30 23:42:01 +00:00
Evan Rosky
223ff6bd39 Fix some NPEs in shell transitions
Missed some null checks which resulted in crashes during some
tests.

Bug: 183993924
Test: atest WindowInsetsPolicyTest
Change-Id: Iaa84b2d9e824223cead9ba78247129b77b1f217e
2021-08-30 12:04:38 -07:00
Ming-Shin Lu
6902904e97 Refine WindowInsets logs
- Add WM_DEBUG_WINDOW_INSETS ProtoLogGroup to use for logging
  general Insets logs in WM core.
- Refine InsetsSourceProvider#updateVisibility proto log format
  to add insets type information.
- Add InsetsSurceControl#toString to print control target info.

Bug: 197189357
Test: adb shell wm logging enable-text WM_DEBUG_WINDOW_INSETS
Test: atest ProtoLogImplTest \
            ProtoLogViewerConfigReaderTest \
            WmTests:ProtoLogIntegrationTest \
            LogDataTypeTest \
            protologtool-tests
Change-Id: I1f01ce4d9fe5cb17f7bd60a424689260682b1dfc
2021-08-30 22:43:46 +08:00
Charles Chen
d51d2f5efb Merge "Remove WindowManager usage in ViewConfiguration" into sc-v2-dev 2021-08-26 12:43:52 +00:00
Charles Chen
0f4ce51bc2 Remove WindowManager usage in ViewConfiguration
[1] made context created via #createConfigurationContext
access ViewConfiguration without StrictModeViolation.
However, we may obtain WindowManager in ViewConfiguration and
still breaks the violation.
This CL gets rid of WindowManager usage to prevent the violation.

Test: atest StrictModeTest
Bug: 197282789
Bug: 191683535

Change-Id: Ifed3f318601ad2214db137ed3d75efdf2157799e
2021-08-26 12:43:36 +00:00
Chris Li
118428b624 Include TaskFragment bounds change in app transition
Bug: 196173550
Test: behave currently with demo app
Change-Id: I9a0f5b7033e5575806d904196594466004458c34
2021-08-25 10:09:13 -07:00
Charles Chen
c2fc67837e Merge "Reland "Introduce TaskFragment transition type"" into sc-v2-dev 2021-08-25 10:23:48 +00:00
shawnlin
6603444a76 [DO NOT MERGE]Support rounded corner for multi-display devices
- Add new array configs for every rounded corner configs.
- Update rounded corner drawable when a display changes in
  ScreenDecorations.

Bug: 131221697
Test: atest DisplayCutoutTest RoundedCornersTest LocalDisplayAdapterTest
      ScreenDecorationsTest
Change-Id: I1f32ff680609267010b05a39a5b8e84511bf1243
2021-08-25 15:58:28 +08:00
Charles Chen
5e55e3976d Reland "Introduce TaskFragment transition type"
Previously AppTransitionController didn't recognize TaskFragment
transitions, so it uses Task opening/closing animation for
TaskFragment transitions.
This CL introduces and uses TaskFragment transition if the animation
target is TaskFragment. The new transition type can be used for registering
RemoteAnimation implemented by TaskFragmentOrganizer as well.
It also provides a fallback mechanism for TaskFragment transitions
if the RemoteAnimation fails or one of opening/closing animation target
is not a pure organized TaskFragment.

Note that previous reverted CL[1] didn't cover the case that the
animation target is promoted to TaskDisplayArea. This CL fixes it by
introducing WindowContainer#canBeAnimationTarget to filter out the case.

Bug: 194649929
Test: manual - the reproducible step in b/194649929#comment1
Test: atest WmTests:AppTransitionTests AppTransitionControllerTest
Test: atest MultiDisplayPolicyTests#testAppTransitionForActivityOnDifferentDisplay
[1]: I0094694fa5cd95d8bbb7da94d2aaf7aac6e1fe09

Change-Id: I5520803f3018d2dd67c96db55daceef740b2cf0b
2021-08-25 15:01:36 +08:00
Android Build Prod User
4de4893707 Merge "Revert "Introduce TaskFragment transition type"" into sc-v2-dev 2021-08-24 23:08:05 +00:00
Daniel Solomon
f74aa266d3 Revert "Introduce TaskFragment transition type"
This reverts commit 3f7830eaf1.

Reason for revert: Broke test android.server.wm.MultiDisplayPolicyTests#testAppTransitionForActivityOnDifferentDisplay on git_master on cf_x86_64_phone-userdebug

Bug: 197639726
Change-Id: I7705b36a3fa8de5ce98774c809a0cc309a08937c
2021-08-24 17:08:32 +00:00
Sally Yuen
0e08f81393 Merge "Add AccessibilityAction and AccessibilityEvent API for drag & drop" into sc-v2-dev 2021-08-24 12:21:46 +00:00
Charles Chen
03adaa2230 Merge "Introduce TaskFragment transition type" into sc-v2-dev 2021-08-24 10:08:57 +00:00
Charles Chen
3f7830eaf1 Introduce TaskFragment transition type
Previously AppTransitionController didn't recognize TaskFragment
transitions, so it uses Task opening/closing animation for
TaskFragment transitions.
This CL introduces and uses TaskFragment transition if the animation
target is TaskFragment. The new transition type can be used for registering
RemoteAnimation implemented by TaskFragmentOrganizer as well.
This CL also provides a fallback mechanism for TaskFragment transitions
if the RemoteAnimation fails or one of opening/closing animation target
is not a pure organized TaskFragment.

Bug: 194649929
Test: manual - the reproducible step in b/194649929#comment1
Test: atest WmTests:AppTransitionTests AppTransitionControllerTest
Change-Id: I0094694fa5cd95d8bbb7da94d2aaf7aac6e1fe09
2021-08-24 14:52:15 +08:00
chaviw
911be61b61 Cache IWindow in InputWindowHandle
Converting IBinder to IWindow is inefficient so instead cache IWindow
object directly. When calling native to Java, the IWindow object may not
be populated yet so we lazy cache it when getWindow is called.

Test: atest WindowAddRemovePerfTest
Fixes: 197219430
Change-Id: I15f7d7cd9775592a5545ddaf276c1b1db2777ac9
2021-08-23 20:37:01 +00:00
sallyyuen
a8e74160de Add AccessibilityAction and AccessibilityEvent API for drag & drop
go/a11yDragAndDrop

Drag & drop in the system has zero accessibility support.
Add actions to dragging, cancelingl, and dropingp
Add WINDOW_CONTENT_CHANGED subtype events for the start of a drag,
the cancellation of a drag, and a drop. Other changes, like
when a11y actions change, will be denoted by
CONTENT_CHANGE_TYPE_UNDEFINED

Test: builds
Bug: 26871588
Change-Id: Ie4eeb54dd612fd92c107a267e884498656c1fac8
2021-08-23 13:27:30 -07:00
TreeHugger Robot
dded85a1bd Merge "Fix pip or bubbles is under split divider" into sc-v2-dev 2021-08-20 02:57:09 +00:00
Joanne Chung
4ef811bca9 Merge "Update javadoc for UiTranslation functions." into sc-dev am: eba4265116 am: 1957020797
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14880635

Change-Id: I9535507caefddcaf47fecb546ba26cb9072cacc9
2021-08-19 10:29:24 +00:00
Joanne Chung
1957020797 Merge "Update javadoc for UiTranslation functions." into sc-dev am: eba4265116
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14880635

Change-Id: Idb7e697a519ef246b057012fa5ddd01e9f2587c0
2021-08-19 10:19:20 +00:00
Tony Huang
95d37cedff Fix pip or bubbles is under split divider
In stage split, it always set the divider layer to top and it would
Cover some layer it should not cover such as pip or bubbles.

In legacy split, this ordering is handled by TDA but it cannot apply
on stage split because it directly use WindowlessWindowManager without
shell root.

Fix it by simplify the layer ordering. Make divider layer as a fixed
value. Normal task layer should always lower than it and always on top
tasks layer count start from it so we can ensure always on top tasks
higher than the divider.

Also move some constants layer value to WindowManagerPolicyConstants
for managerment and accessed by both wm-core and wm-shell.

Fix: 194359996
Test: open a pip app and active stage split then drap the pip to
      divider.
Test: Pass existing tests.
Change-Id: I6e4002435be350872aec5fa154849ed6e9561ce0
2021-08-19 14:12:04 +08:00
Joanne Chung
119f044e62 Update javadoc for UiTranslation functions.
1. Provide more detailed information for UiTranslationManager.
2. Clarify the difference for VTC#onClearTranslation and
VTC#onHideTranslation.

Bug: 178044703
Test: n/a. Change javadoc not change code.

Change-Id: I4b2ef1a6c39c3bbbb85d0dcda519d286f10deb25
2021-08-19 05:15:31 +00:00
Chavi Weingarten
f3cee944ae Merge "Pass IWindow to InputWindowHandle." into sc-v2-dev 2021-08-18 22:27:54 +00:00
chaviw
0527f21cdb Pass IWindow to InputWindowHandle.
This allows listeners to identify which WindowInfo belongs to which
IWindow. Using InputChannel token may not work since not every Window
has an InputChannel, but every window should have an IWindow token.
There may still be WindowInfo data that doesn't contain an IWindow token
if they were created as pure layers, and not windows.

Test: IWindow token sent to listeners
Bug: 188792659
Change-Id: Ie90453d40906c0ee8312a23a6f4c8e85310bbaf7
2021-08-18 10:11:33 -05:00
Joanne Chung
202ae02849 Bug Fix: fix NullPointerException while scrolling message apps am: 018e3d97d0 am: dd622014fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15605141

Change-Id: I0e1de4f04140c3dde12f13604e05cd21e9598492
2021-08-18 15:01:38 +00:00
Joanne Chung
dd622014fe Bug Fix: fix NullPointerException while scrolling message apps am: 018e3d97d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15605141

Change-Id: I17cbd83fd37aeef4eafbfd44d9ec5fd05466e04c
2021-08-18 14:46:35 +00:00
Joanne Chung
018e3d97d0 Bug Fix: fix NullPointerException while scrolling message apps
The issue will occur when the view is removed from the hierarchy by
the time the translation response returns. Do a null check to make
sure the view still exists.

Bug: 196933332
Test: atest CtsTranslationTestCases
Tese: manual. not see the crash when scrolling the apps.

Change-Id: Ifee933a802385750d431800ef50f6f2c306ccc0f
2021-08-18 06:50:28 +00:00
Charles Chen
617f80257d Merge "Fix NPE in testWindowContextAddMismatchedWindowType" into sc-v2-dev 2021-08-17 06:57:55 +00:00
Charles Chen
eff3dfe443 Fix NPE in testWindowContextAddMismatchedWindowType
fixes: 196781957
Test: atest WindowContextPolicyTests
Change-Id: If0f8e124f3ee7939bf1e121d6d73616ff07e0829
2021-08-17 10:22:46 +08:00
Chavi Weingarten
73f529933e Merge "Add transform matrix to InputWindowHandle." into sc-v2-dev 2021-08-16 18:13:46 +00:00
chaviw
8ca2be726d Add transform matrix to InputWindowHandle.
Added the transform matrix from WindowInfo native to the Java side
InputWindowHandle. This is to allow clients that register a
WindowInfoListener to translate the window's screen coordinates to
window space.

Test: Transform is now sent to WindowInfoListener
Bug: 188792659
Change-Id: Ifba8488ff470d3c6c8066e23b871c3d541cff0a1
2021-08-16 14:50:22 +00:00
Mark Renouf
b17fd37eef Merge changes from topic "screenshots_logs" into sc-qpr1-dev am: f88195c2dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15533669

Change-Id: Ibee0de54eee462207f66d0157d633f13d662e214
2021-08-13 17:18:25 +00:00
Charles Chen
cc2f80f5a0 Merge "Allow WPS to create windows with multiple type" into sc-v2-dev 2021-08-13 06:24:45 +00:00
Chris Li
a5e7ce9b16 Merge "Invoke keyguard going away when it is collecting for wake" into sc-v2-dev 2021-08-12 18:32:53 +00:00
Mark Renouf
04bcff1e9f Return packageName to scroll capture requests from SysUI
Bug: 195013652
Test: manual
Change-Id: Ib623e34031b7a5117d9c5afb439fc382f9c77dd1
2021-08-11 18:57:28 +00:00
Charles Chen
8bae39cab2 Allow WPS to create windows with multiple type
Before WindowProviderService, Service can add windows with several
window types. This is previously not allowed for WindowProviderService
because a context can only associate with a window container.
However, it may cause regressions because Service is used to add
windows with multiple types.
This CL allows WindowProviderService to do so, but WindowProviderService
can only associate with the window type returned by #getWindowType.
This CL also extracts some methods to WindowContext interface so that
WindowContext and WindowProviderService can reuse the same interface.

Test: atest WindowContextPolicyTests StrictModeTest
Test: atest ContextIsUiContextTest ContextGetDisplayTest
Test: atest WindowContextTest WindowContextTests
fixes: 191959013

Change-Id: Ie16916b370a4cbb8a17ccaec9870d47b4b089390
2021-08-11 23:43:01 +08:00
Chris Li
2c0834c5e5 Invoke keyguard going away when it is collecting for wake
Before, when KEYGUARD_GOING_AWAY is called before WAKE starts,it will
not be passed to the keyguard service to dimiss keyguard. Now, we
merge the flags and add check for that.

Bug: 193564917
Test: check with/without sEnableRemoteKeyguardAnimation
Change-Id: I28d40664b4fbdc0ea199baa32ccefba7dea473f8
2021-08-10 11:26:31 -07:00
TreeHugger Robot
3e5e27f2b6 Merge "MediaProjection captures DisplayArea" into sc-v2-dev 2021-08-10 14:03:05 +00:00
Tony Huang
ffc8cceadf Merge "Fix split caused apps ANR" into sc-v2-dev 2021-08-10 05:28:43 +00:00
Tony Huang
b29b6aac05 Fix split caused apps ANR
If mWindowDrawCountDown is set to non null when mReportNextDraw
is false, it won't get cleared in performingDraw.
If another draw occurs afterwards where mReportNextDraw is true,
but requestDrawWindow doesn't get called, an ANR will occur.
This is because performDraw will end up waiting forever since
mWindowDrawCountDown was previously set to non null,
but there will never be any calls reportDrawFinish to handle the
countDown.

We should only create latch and wait it when mReportNextDraw is
true.

Bug: 195262673
Test: Pass existing tests
Test: Drag and drop split divider quickly
Change-Id: I4ee81a41687c4f61a4828d4c61ba01abee795e89
2021-08-10 05:27:41 +00:00
Naomi Musgrave
fd5715bb31 MediaProjection captures DisplayArea
MediaProjection is used by apps to capture the contents of
a display. Apps consume the content from a surface passed
in to MediaProjection#createVirtualDisplay. The images
written out to the surface can be used for saving
screenshots of the current display, screen recording,
or casting to a different display.

MediaProjection is currently tied to capturing a physical
display. This change instead captures the DisplayArea
the app is launched on. This is consistent with Display API
sandboxing, which returns the DisplayArea bounds rather
than the physical display bounds.

Note that apps use the Display APIs to size the
VirtualDisplay and output surface.

Verified: screenshots, screen recording, and casting

Bug: 180624777
Bug: 195280234
Test: atest WmTests:DisplayContentTests

Change-Id: I086fa1ae668dbdf0f25252c13614445af04d86f3
2021-08-09 15:20:32 +00:00
Joanne Chung
fb94c27386 Merge "Fix the Translator references are gone when receiving response." into sc-dev am: 9d17b85ce7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15444547

Change-Id: I7485e3f8fdbb357dd38d5ea4e5b249652e12793b
2021-08-05 13:54:10 +00:00
Naomi Musgrave
5dd564dcf3 Merge "Temporary flag for Launcher to debug their usage of sandboxed display APIs" into sc-v2-dev 2021-08-05 08:54:12 +00:00
Joanne Chung
fd19460694 Fix the Translator references are gone when receiving response.
There are some issues TranslationService already sent the response
but the View onResponse doesn't be called. The reference seems to be
gone. If we don't fix the problem, we will missing the ui translation
even the service already give us the response. To fix the problem, we
change it to strong reference.

The change is low risk, the only risk is if TranslationService doesn
not release the reference to the callback properly causing a memory
leak for apps but this can recovered by app update.

Bug: 194973014
Test: atest CtsTranslationTestCases
Test: The translation for chat apps work fine. The memory is decreased
after receiving the responses for a while.

Change-Id: Ib3956b2250c54a29acf9f7d51f51e8191fe8aba2
2021-08-05 07:07:18 +00:00