- Better logging
- Remove method form OnBackInvokedDispatcher interface (but not the
implementation)
- Add test for ag/17211289
Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
- Use the focused window instead of the topApp window
- Instead we now rely on WindowManagerService to get
the focused window.
- SystemUI does not have ActivityRecord so we can't rely
on the top window of the Task to find the correct
window on which the callback will be called.
- Introduce a Builder for BackNavigationInfo
- This reduces the number of variable needed outside the synchonized
block.
- It also reduces the number of early return of BackNavigationInfo
instances
- Adding log messages to help further debug the method.
Test: BackNavigationControllerTests
Test: Manual dismiss of SystemUi dialog in QS
Bug: 216604581
Fixes: 221458292
Change-Id: I9ba2c7f89956f34d6338824502c210b3e58dc076
Introduce builder for BackNavigationInfo
Change-Id: I14b4a4b3abc8f417998b7b32831cb3d5c4faa491
As a followup to ag/17258046, since we don't have any use case to
rely on handling input during animation, disable input even if it
is trusted embedding so that it could cover some edge-cases when
a previously truste host starts doing something bad.
Bug: 197364677
Test: atest WmTests:AppTransitionControllerTest
Change-Id: I7312b6ed961891c5c58adad73f660d4a18084c52
For cross-process embedding, there can be activity of other app embedded
in untrusted mode. When it happens, we need to disable all input on the
Task if we are going to play client-driven animation to make sure the
host client can't abuse the animation leash.
Bug: 197364677
Test: atest WmTests:AppTransitionControllerTest
Change-Id: I3e299c0a43ac823b7df6af9d02c7168bd65d3271
The functionality has morphed since its original transitions-only
incarnation. Now it is a general queue mechanism for SyncEngine.
So, move it into BLASTSyncEngine and clean-up the abstraction
a little-bit. This should make it more usable for some upcoming
fixes.
Bug: 222033492
Test: existing tests pass (just a refactor)
Change-Id: Ia057e816ad5635e9681d3273d139e494c18216d9
If, for whatever reason, the SystemUI process crashed and restarted,
the IME wasn't functional anymore (it would not become visible).
That happened because, after the SystemUI crash, the IME was
unorganized for a while and the framework reparented its surface
under an activity.
With this commit we fix this issue by reparenting the IME under its
parent when it becomes organized again.
Manual Test: Checked that the IME becomes visible after a systemui
crash.
Test: atest DisplayContentTests
#testImeContainerIsReparentedUnderParentWhenOrganized
Bug: 224800157
Change-Id: I303baf96c905a9c4b444189b731f63c7d51a11f2
Change-Id: I4d2934516e528bf353395e1759f59612542bdb56
Bug: 224664116
Test: build, verify with enabling proto log:
adb shell wm logging enable WM_DEBUG_IME, see if IME snapshot logs
printed.
Change-Id: Ia61e6f3955178d9a4deb68ba1d8ae7d4ebb341d1
Introduces layer mirorring of a single task, given the task is both
identified (future work - dependency on setup flow in SysUI) and the
flag is enabled (currently disabled).
Error handling (tearing down the VirtualDisplay if task recording setup failed)
will come in a future change
Bug: 216625226
Test: atest WmTests:DisplayContentTests
Test: atest WmTests:ContentRecorderTests
Change-Id: I16abd55ce75537ff8fbbb379e4970668ea02a230
controllers.
Test: m -j.
Test: Open and swipe back on pre-T and T apps.
Test: atest BackNavigationControllerTests
Test: atest BackAnimationControllerTest
Bug: 195946584
Change-Id: I981f8deff9fad75355ee0e8bbe08b375f4da6e74
Content recording relies upon a class describing current state.
rather than passing around details from media > display > wm.
WMService keeps track of the session in ContentRecordingController.
ContentRecordingController manages hand-off between different
DisplayContent instances, as the session details are changed.
Manually tested that fold/unfold handling when screen recording
from QS tile still works, and that taking over a screen cast
with a screen recording works.
Refactoring logic from DisplayContent into new recording
delegate will come in a future change.
Bug: 216756854
Test: atest FrameworksCoreTests:ContentRecordingSessionTest
Test: atest WmTests:DisplayContentTests
Test: atest WmTests:ContentRecordingControllerTests
Change-Id: Ib4f125dd703d362ac13fcbe469d00b345827e706
When a freeform app launched and focused, but its window is not ready,
the input focus stays on the window of the previously focused freeform
app. The focus should be removed from the previously foccused app, so
ANR can be triggered correctly.
Bug: 216852742
Test: atest AnrTests#slowOnCreateWithKeyEventTriggersAnr
Change-Id: Id00c147ffab9b11fb2abdf0f3020bc017a31bea7
Add a manifest flag for applications to opt-out of the new back
navigation system.
Test: atest
CtsWindowManagerDeviceTestCases: android.server.wm.BackNavigationLegacyTest
Bug: 217709328
Change-Id: I43d09a37b126e59bdb8f20bb83cf6d99e53a1e91
Test: m -j.
Test: Open and swipe back on pre-T and T apps.
Test: atest .../BackNavigationControllerTests.java
Test: atest .../BackAnimationControllerTest.java
Bug: b/195946584
Change-Id: I00cf7ab5b57760d57d30ac74dc5b3443a4203f38
This CL enable OnBackInvokedCallback to be saved in a WindowState and
queried by the BackNavigationController to be returned when
ATM.startBackNavigation() is called.
The DecorView provides a PendingOnBackInvokedDispatcher that can receive
callback registration before being added to a ViewRootImpl.
Test: atest FrameworksCoreTests:BackNavigationTest
Bug: 131727607
Change-Id: I01528a22ea4a6583a56ade4eab69136d727855d0
... when preparing transition targets.
Previously, the first step of the calculation finds the top participant
if possible, and once there is one, only the level above task will be
added. Because it assumes that the parent of participant can represent
it. But there are more than one participants belong to an ancestor, the
descendants may have individual changes, so they should be still in the
transition targets. Otherwise the animation may have nothing to do.
Now all valid participants are added into the target lists, and then
combine the targets from bottom to up based on depth. So it can be
done in 1 pass (originally it requires 3 passes when launching a new
task from home, 4 passes when starting recents).
The population of ChangeInfo#mParent is moved after tryPromo so it
can skip the targets which were removed, and the parent info can
be updated in a single place.
Bug: 213867980
Test: TransitionTests#testOpenActivityInTheSameTaskWithDisplayChange
Test: adb shell setprop persist.debug.shell_transit 1; reboot
Start a landscape activity from a portrait activity in the
same task. The animation should not jump cut.
Change-Id: I23a3326611dcb5664b204748280ae15b2377f318
This is a step to move the layout logic to the client side. We won't
invoke IWindowSession#relayout then.
Bug: 161810301
Test: atest WmTests
Change-Id: Ib5ac048a573907af0a81f3e228575d9458862cfd
This is a step to move the layout logic to the client side. We won't
invoke IWindowSession#relayout then, and the client should be able to
set the transform hint on its own.
Bug: 161810301
Test: presubmit
Change-Id: Ib12a76fcc9906b3d9c487fb89bbe4520c682379a
We currently queue applySyncTransaction in WM Shell, but it doesn't sync
with Shell transition collection. However, when both happen, it may
cause issue because the BLASTSyncEngine currently only support 1 sync at
a time.
Move the Shell transition queue to WindowOrganizerController as we only
queue organizer sync. Unfortunately, unlike organizer sync that is in
one WCT, we can't prevent any core-initiated transition.
We don't expect it to happen, but if it does, we need to handle them
case by case.
Fix: 213866869
Test: atest WMShellFlickerTests:ExpandBubbleScreen
Change-Id: Ida331585b018e848e2f801da55cb6a4b999950f4
Shell Transitions only supports 1 transition collecting at a time.
This limitation comes from BLASTSyncEngine. However, because Shell
can call startTransition at any time (and doesn't have a way to
know if WM is already "collecting" for a transition), we can't
just crash in this case. We also can't just use the existing
transition because it has a different "client" expecting results.
So, the best we can do is queue them up. Fortunately, the
startTransition API Shell uses is designed such that all the
relevant operations are in one WCT, so we can maintain server-side
correctness.
This CL adds a queueing mechanism for these situations. In practice,
this should actually never be needed; however, it is *technically*
possible and automated tests are more likely to hit it.
Bug: 183993924
Test: pass existing
Change-Id: I255fb336cb30c7d1e1b82188a31f9c693b9e138c
This CL introduces the BackNavigationController that gathers the
required data to be passed to WMShell to create the back animation
These data are passed via the BackNavigationInfo Parcelable.
The CL also containes a basic screenshoting mechanism as a temporary
solution until a proper screenshoting infrastructure is created
(b/207481538).
Test: atest BackNavigationControllerTests
Bug: 131727607
Change-Id: Ibd7fc78e590794daf35f7718ddfa53e7f439813b
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback
Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled
Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
WM delays to destroy window surface if the window is running an exit
animation, and clean it up after the animation finishes. In case the
clean up process was not triggered, we do it before starting an app
transition.
Note that this is a safe guard for potential bugs. The surface shall
be destroyed as soon as an animation finishes, so the clean up should
have been done before an app transition starts.
Bug: 205335975
Test: atest AppTransitionControllerTest
Change-Id: I9c37ab9ebc57ef48827df25ecc52bf09101ad419
Loosen the check on FLAG_RESUME_WHILE_PAUSING in
TaskFragment#startPausing for auto-enter-pip.
Fixed also the round corner radius calculation in WMShell component for
entering PiP transition.
Bug: 198227082
Bug: 202574512
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bEPWcJSn8iGbLLNg6cM0E3
Test: no auto-enter on quick switch and does on launching new Task,
see video for details
Test: atest PinnedStackTests#testAutoPipOnLaunchingAnotherActivity
Change-Id: I53e62a5f6e663b2d6df8cd0aaa858ff01ef073e8
Previously, WMS always associate TYPE_APPLICATION WindowContext with
the default TDA. This CL provides the capibility to select a TDA by
DisplayAreaPolicy.
Test: atest DisplayAreaPolicyBuilderTest
fixes: 185769955
Change-Id: Ie7cb686cd5d1da81ef618a3f1316dc3932a8272f
Change-Id: Ia25854feed3bb6b037d4510a6b5000d906d27313
Merged-In: Ia25854feed3bb6b037d4510a6b5000d906d27313
Bug: 198593156
Test: manual. capture winscope dump and see it.
PiP Shell Transitions needs to be more robust to pass CTS tests
reliably.
Some changes:
1. DELIVERED_TO_TOP intents don't create a transition since there is
no change to the WM hierarchy. This way the app-launch transition
won't conflict with activityRestartAttempt.
2. If PiP started an expand transition while an enter transition is
ongoing, cancel the enter transition.
a. Additionally, because PiP doesn't resize task until the enter
transition finishes, the expand transition will actually be
a no-op. If we see this pattern, also cancel the enter
transition.
3. When taskVanished, make sure to call any pending finishCallback
because it doesn't allow the running animator to properly finish.
Transition systems require the finish callback to function
properly.
4. Minimize the uses of finishTransition with a sync callback. We
probably need to phase this out because it can conflict with
subsequent startTransition calls (because only 1 sync is supported
at a time).
Bug: 183993924
Test: atest PinnedStackTests
Change-Id: Ieb573032839a2f31b0bb371410484fc93a1714fa
We don't want to allow the client to animate for wallpaper or any
non-app windows.
Bug: 201482129
Bug: 196173550
Test: atest WmTests:AppTransitionControllerTest
#testOverrideTaskFragmentAdapter_noOverrideWithWallpaper
Change-Id: Ic29db59fc9f9695df9c8ba3a6d812ad217cdd641
We want to allow organizer to handle the transition in case like
launching split TaskFragments from a non-embedded activity.
Bug: 200496784
Test: atest WmTests:AppTransitionControllerTest
Test: test with demo app to launch split from non-embedded
Change-Id: Iaf1d07c8cf43fa773fede3c031855085147be263
TaskFragment can be empty for either 1. wait for new launch activity, or
2. last activity just removed.
For 1, we want to wait for the activity launch.
For 2, we want to wait for organizer to remove the TaskFragment.
Bug: 196173550
Test: atest WmTests:AppTransitionControllerTest
#testTransitionGoodToGoForTaskFragments
Change-Id: I73ac239ef2e5a75d05af6f6ae97e3f2278ebb4c3
Query the surface flinger property
ro.surface_flinger.primary_display_orientation to determine the
primary display's install orientation. If the window is on the
primary display, then update the transform hint passed on to the
client.
Bug: 196167822
Test: check initial buffer transforms on displays with a different
install orientation
Change-Id: Idf010cd6be73172ba708820f87046c3ba3cf8001
In shell transitions, recents opens on top, but in transient mode
(meaning it doesn't cause the other apps to pause). This means the
other apps should be running un-interrupted. This includes not
taking the IME away.
To handle this, adjust the IME logic so that transient-launching
activities are NOT canBeImeTarget.
Also fix a bug in isVisibleOrAdding where it was using
visibleRequested instead of visible (if you look at the change
history, !hiddenRequested was incorrectly replaced by
visibleRequested instead of visible).
Also fix a bug where a defer/continue of updateImeTarget was
updating the target even when an update was never requested while
it was deferred. This was causing it to be called prematurely
during activitystarter (where global lock is held).
Bug: 193565597
Test: atest ReOpenImeWindowTest SwitchImeWindowsFromGestureNavTest
Change-Id: Ic537d77c8b0e10e80444dd46d7b49e5a9bd63d6c
An app may pass a null surface to MediaProjection#createVirtualDisplay,
and later set the surface on the VirtualDisplay. The display's state
will change from off to on when the surface is set.
When determining if layer mirroring should be started/updated in
DisplayContent, take the presence of the surface/display state
into account, to prevent the app from crashing.
Bug: 197863746
Test: atest WmTests:DisplayContentTests
Change-Id: I01af07fff681aab6fc8235c861375eb79118cbfe